如何获取中国市场的广告id(如MIUI和AliOS)

how to get the advertising id on the China market (e.g. on MIUI and AliOS)

我目前有代码可以在 Google Play enabled 和 Kindle 设备上获取设备标识符(广告 ID)。现在我正在寻找针对开发人员的文档,以解释如何在其他 Android 分支(类似于 Amazon's instructions)上获取它,尤其是。在为中国本土市场制造的小米和阿里巴巴手机上。

我能找到的一个资源是 AppsFlyer which is obviously bogus since it states "IMEI and Android ID - Both are necessary for accurate attribution" while the former is disabled since Android 6 (unless you want to prompt the user for a runtime permission) besides other problems with it and the latter is not device unique since Oreo

这不是我想要的答案,但经过进一步研究,"first and largest independent mobile advertising platform of China"、Youmi 确实有一个开源 DeviceInfoUtils class 和他们会执行 AppsFlyer 推荐的所有内容,即 Google 所反对的所有内容。

具体来说,对于每个请求,they send: telephonyManager.getDeviceId(); (IMEI on GSM phones), telephonyManager.getSubscriberId() (IMSI on GSM phones), the MAC addressANDROID_ID。同样,其中前两个要求提示用户允许应用程序 "make and manage phone calls",这非常令人毛骨悚然(导致应用程序评级不佳 and/or 拒绝权限)。后两者曾经有效,但从奥利奥开始,它们不再是设备唯一的,正如我在问题陈述中提到的那样。

更新:我已经下载了小米的Mimo SDK(广告SDK)。反编译显示一个名为 AdvertisingIdHelper 的 class,它只有两种方法,一种是检查设备是否安装了 Google Play 商店,另一种看起来像这样:

  private static d z(Context paramContext)
  {
    if (!y(paramContext)) {
      return null;
    }
    try {
      d localD = new d();
      Intent localIntent = new Intent("com.google.android.gms.ads.identifier.service.START");

      localIntent.setPackage("com.google.android.gms");
      if (paramContext.bindService(localIntent, localD, 1))
        return localD;
    } catch (SecurityException localSecurityException) {
      com.miui.zeus.a.a.b("stacktrace_tag", "stackerror:", localSecurityException);
      return null;
    }
    return null;
  }

它在整个 SDK 中的作用尚不清楚,但它肯定是一种查询 Google 的广告 ID 而不是小米的替代 ID 的方式。如果这适用于所有情况,或仅适用于在中国境外销售的设备(确实有 Google Play 服务),则再次不清楚。

是的,IMEI、Mac 地址和 Android ID 用于中国的 Android 市场。 Unity、Vungle 和 Admob 实际上是在追求 Android 市场。我们还听说其他广告网络专门为中国市场创建了自定义 Android SDK。

上次我在中国的 Android 市场上与一位中国开发商交谈是一段时间以前的事了,所以我的信息可能已经过时了。我今晚会仔细检查。