Vaibs
Vaibs

Reputation: 1138

Callback to app when Reset Google Advertising ID

An App uses Google Advertising ID. But as read online this tends to be changed based on User event.

If user visits Google Settings -> Ads screen and resets the ID than a new ID is been issued.

My Question is do other Android App gets a broadcast or a callback which states the Advertising ID has been changed. This is just to avoid re-query AdvertisingIdClient.getAdvertisingInfo(context).getId(); on every onResume.

Please guide if someone has any suggestion for the same.

Upvotes: 1

Views: 1346

Answers (1)

Android Enthusiast
Android Enthusiast

Reputation: 4950

At the moment, there is no callback which can give when the Advertising ID has been changed. The best way to detect if the Advertising Id has been changed is to get the AdvertisingIdClient.info.

AdvertisingIdClient is a helper library for retrieval of advertising ID and related information such as the limit ad tracking setting.

It is intended that the advertising ID completely replace existing usage of other identifiers for ads purposes (such as use of ANDROID_ID in Settings.Secure) when Google Play Services is available. Cases where Google Play Services is unavailable are indicated by a GooglePlayServicesNotAvailableException being thrown by getAdvertisingIdInfo().

Upvotes: 0

Related Questions