问题
Hi we tried to get Advertisement ID using ionic3 application.We added plugin
cordova plugin add cordova-plugin-idfa --save
We tried like this
ONE:
cordova.plugins.idfa.getInfo().then(function(info) {
if (!info.limitAdTracking) {
console.log('OK getting ID**********'+info.idfa || info.aaid);
}
});
we are getting get Cannot read property 'getInfo' of undefined
TWO:
declare var androidIDFA;
@Component({
templateUrl: 'app.html',
})
export class MyApp {
googleAddId:any;
if (this.platform.is('cordova')) {
androidIDFA. getAdId(
(addId) => {
console.log(addId);
this.googleAddId=addId.adId;
},
(e) => {
console.log(e);
//This error message not works on Desktops
}
);
}
We are getting androidIDFA is not defined.Let me know what we missed here.
来源:https://stackoverflow.com/questions/54643118/how-to-get-google-advertisement-id-in-ionic3