ios-4.3.0
Added UMPDebugSettings on Admob.requestConsentInfoUpdateWithParameters
: testDeviceIdentifiers
and geography
More info here: https://developers.google.com/admob/ump/ios/quick-start#testing
Admob = require('ti.admob');
Admob.requestConsentInfoUpdateWithParameters({
tagForUnderAgeOfConsent: false,
testDeviceIdentifiers: [Admob.SIMULATOR_ID, "YOUR TEST DEVICE ID"],
geography: Admob.DEBUG_GEOGRAPHY_EEA, // Admob.DEBUG_GEOGRAPHY_NOT_EEA or Admob.UMPDebugGeographyDisabled
callback: function (e) {
console.log("requestConsentInfoUpdateWithParameters callback");
console.log(e);
if (Admob.adProviders) {
if (Admob.adProviders.length > 0) {
if (Admob.adProviders[0].privacyPolicyURL) {
Ti.API.info('adProviders.length:', adProviders.length);
Ti.API.info('adProviders[0].privacyPolicyUR');
};
};
};
if (e.success) {
// If the status is required or unknown
if ([Admob.CONSENT_STATUS_REQUIRED, Admob.CONSENT_STATUS_UNKNOWN].includes(e.status)) {
Admob.loadForm({
callback: (e) => {
console.log("Admob.loadConsentForm callback:");
console.log(e);
if (e.dismissError || e.loadError) {
Ti.API.error(e.dismissError || e.loadError);
}
// If the status is "obtained" (freshly granted) or not required (already granted) continue
if ([Admob.CONSENT_STATUS_NOT_REQUIRED, Admob.CONSENT_STATUS_OBTAINED].includes(e.status)) {
// OK CAN LOAD YOUR ADS!
} else {
alert('Not ready to show ads! Status = ' + e.status);
}
}
})
} else {
// OK CAN LOAD YOUR ADS!
}
}
}
});