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
The advertising ID, or ZeroOut when the user has limited ad tracking.
- Attributes
Remarks
The advertising ID.
The value of the advertising ID depends on a combination of IsLimitAdTrackingEnabled and AccessAdservicesAdId.
When the user has limited ad tracking, the API returns ZeroOut. This disallows a caller from tracking 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.