Allows access to the IDFA (iOS) and GAID (Android)
Install
npm install @capacitor-community/advertising-id
npx cap sync
iOS
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
)
API
requestTracking()
requestTracking() => Promise<{ value: AdvertisingStatus; }>
Returns: Promise<{ value: AdvertisingStatus; }>
getAdvertisingId()
getAdvertisingId() => Promise<{ id: string; status: AdvertisingStatus; }>
Returns: Promise<{ id: string; status: AdvertisingStatus; }>
getAdvertisingStatus()
getAdvertisingStatus() => Promise<{ status: AdvertisingStatus; }>
Returns: Promise<{ status: AdvertisingStatus; }>
Type Aliases
AdvertisingStatus
'Authorized' | 'Denied' | 'Not Determined' | 'Restricted'