Allows access to the IDFA (iOS) and GAID (Android)
npm install @capacitor-community/advertising-id
npx cap sync
iOS requires the following usage description be added and filled out for your app in Info.plist
to use the requestTracking()
method:
NSUserTrackingUsageDescription
(Privacy - Tracking Usage Description
)
This plugin will use the following project variables (defined in your app's variables.gradle
file):
playServicesAdsId
version ofcom.google.android.gms:play-services-ads-identifier
(default:18.2.0
)
requestTracking() => Promise<{ value: AdvertisingStatus; }>
Returns: Promise<{ value: AdvertisingStatus; }>
getAdvertisingId() => Promise<{ id: string; status: AdvertisingStatus; }>
Returns: Promise<{ id: string; status: AdvertisingStatus; }>
getAdvertisingStatus() => Promise<{ status: AdvertisingStatus; }>
Returns: Promise<{ status: AdvertisingStatus; }>
'Authorized' | 'Denied' | 'Not Determined' | 'Restricted'