【发布时间】:2021-05-17 18:32:05
【问题描述】:
具有获取 AdvertisingIdClient.Info 的功能
private static AdvertisingIdClient.Info getAdsClientInfo(@NonNull final Context context) throws GooglePlayServicesNotAvailableException, IOException, GooglePlayServicesRepairableException {
int isGPAvailable = GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(context);
if (isGPAvailable == ConnectionResult.SUCCESS) {
return AdvertisingIdClient.getAdvertisingIdInfo(context);
}
return null;
}
它使用 AdvertisingIdClient.getAdvertisingIdInfo(context)
https://developers.google.com/android/guides/setup中有三个库
Google Mobile Ads com.google.android.gms:play-services-ads:20.1.0
Android Advertising ID (AAID) com.google.android.gms:play-services-ads-identifier:17.0.0
Lightweight version of Google Mobile Ads com.google.android.gms:play-services-ads-lite:20.1.0
它们之间有什么区别,哪一种可以安全使用?
【问题讨论】:
标签: android google-play-services google-ads-api