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
)
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'