1 year ago
#387295
nosTa
Ionic cordova admob plus consent
I am trying to figure out how to use the consent plugin.
Following the documentation on https://admob-plus.github.io/docs/cordova/consent I can make it work to show the form and receive the status but it does not matter what I click in the form, the status does not change.
async checkConsent() {
document.addEventListener(
'deviceready',
async () => {
console.log(consent);
if (this.platform.is('ios')) {
const status = await consent.trackingAuthorizationStatus();
/*
trackingAuthorizationStatus:
0 = notDetermined
1 = restricted
2 = denied
3 = authorized
*/
const statusNew = await consent.requestTrackingAuthorization();
}
const consentStatus = await consent.getConsentStatus();
console.log('CONSENT STATUS:', consentStatus);
await consent.requestInfoUpdate();
console.log('CONSENT STATUS:', consentStatus);
// if (consentStatus === consent.ConsentStatus.Required) {
// await consent.requestInfoUpdate();
// }
const formStatus = await consent.getFormStatus();
console.log('FORM STATUS: ', formStatus);
if (formStatus === consent.FormStatus.Available) {
const form = await consent.loadForm();
let result = await form.show();
console.log(result);
}
},
false,
);
}
Anyone can help here?
Best regards, nosTa
cordova
ionic-framework
admob
0 Answers
Your Answer