Android SDK 中的儿童模式

如果您的 Android 应用面向儿童,则必须遵守 Google 的相关政策。如果您正在使用 Adapty SDK,只需几个简单步骤即可完成配置,以满足这些政策要求并通过应用商店审核。

需要配置哪些内容?

你需要配置 Adapty SDK,禁止收集以下信息:

  • Android 广告 ID(AAID/GAID)
  • IP 地址 此外,我们建议谨慎使用 customer user ID。格式为 <FirstName.LastName> 的用户 ID 与使用电子邮件一样,肯定会被视为收集个人数据。对于儿童模式,最佳做法是使用随机或匿名标识符(例如哈希 ID 或设备生成的 UUID),以确保合规性。

启用儿童模式

在 Adapty 看板中进行更新

在 Adapty 看板中,您需要禁用 IP 地址收集。请前往 App settings,并在 Collect users’ IP address 下点击 Disable IP address collection

在移动应用代码中进行更新

为遵守相关政策,您需要在初始化 Adapty SDK 时禁用 Android 广告 ID(AAID/GAID)和 IP 地址的收集:

Kotlin:

override fun onCreate() {
    super.onCreate()
    Adapty.activate(
      applicationContext,
      AdaptyConfig.Builder("PUBLIC_SDK_KEY")
          .withAdIdCollectionDisabled(true) // set to `true`
          .withIpAddressCollectionDisabled(true) // set to `true`
          .build()
    )
}

Java:

@Override
public void onCreate() {
    super.onCreate();
    Adapty.activate(
      applicationContext,
      new AdaptyConfig.Builder("PUBLIC_SDK_KEY")
          .withAdIdCollectionDisabled(true) // set to `true`
          .withIpAddressCollectionDisabled(true) // set to `true`
          .build()
    );
}

Android 清单更新

如果你的应用面向儿童用户,且编译目标为 Android 13(API 33)或更高版本,Google Play 要求你不得请求 AD_ID 权限。应用中的其他 SDK(如分析、归因或广告 SDK)可能通过清单合并的方式添加该权限。设置 withAdIdCollectionDisabled(true) 可阻止 Adapty 收集该 ID,但无法移除其他 SDK 声明的权限。

要移除该权限,请在 app/src/main/AndroidManifest.xml<manifest> 元素内添加以下内容。<manifest> 元素必须声明 xmlns:tools="http://schemas.android.com/tools"

<uses-permission
    android:name="com.google.android.gms.permission.AD_ID"
    tools:node="remove" />