AdId.GetAdId Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
The advertising ID.
[Android.Runtime.Register("getAdId", "()Ljava/lang/String;", "GetGetAdIdHandler", ApiSince=34)]
public virtual string GetAdId ();
[<Android.Runtime.Register("getAdId", "()Ljava/lang/String;", "GetGetAdIdHandler", ApiSince=34)>]
abstract member GetAdId : unit -> string
override this.GetAdId : unit -> string
Returns
- Attributes
Remarks
The advertising ID.
The value of advertising Id depends on a combination of #isLimitAdTrackingEnabled()
and android.adservices.common.AdServicesPermissions#ACCESS_ADSERVICES_AD_ID
.
When the user is #isLimitAdTrackingEnabled limiting ad tracking
, the API returns #ZERO_OUT
. This disallows a caller to track the user for monetization purposes.
Otherwise, a string unique to the device and user is returned, which can be used to track users for advertising.
Java documentation for android.adservices.adid.AdId.getAdId()
.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.