Skip to content

Cordova plugin to get Advertising ID (IDFA or AAID)

License

Notifications You must be signed in to change notification settings

hoi4/cordova-plugin-idfa

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cordova plugin for getting Advertising ID (IDFA or AAID)

NPM version NPM downloads NPM total downloads PayPal donate Twitter

Index

Supported Platforms

  • iOS
  • Android

Installation

$ cordova plugin add cordova-plugin-idfa

Use variable ANDROID_PLAY_ADID_VERSION to override dependency version on Android.

API

The API is available on the cordova.plugins.idfa global object.

getInfo()

Returns a Promise<object> with the following fields:

  • limitAdTracking: boolean - Whether usage of advertising id is allowed by user.
  • idfa: string (iOS only) - Identifier for advertisers.
  • trackingTransparencyStatus (iOS only): "NotAvailable" | "Authorized" | "Denied" | "Restricted" | "NotDetermined" - Tracking transparency status, available on iOS 14+ devices. On devices with iOS < 14 the value will always be "NotAvailable". For the meaning of other values see the tracking transparency API docs.
  • aaid: string (Android only) - Android advertising ID.

Example

cordova.plugins.idfa.getInfo().then(function(info) {
    if (!info.limitAdTracking) {
        console.log(info.idfa || info.aaid);
    }
});

About

Cordova plugin to get Advertising ID (IDFA or AAID)

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Objective-C 65.2%
  • Java 27.6%
  • JavaScript 7.2%