[MOD-2423] Android: Add non-personalized ads support to "ti.admob"
GitHub Issue | n/a |
---|---|
Type | Improvement |
Priority | Critical |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2018-05-25T12:59:51.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 7.2.0 |
Components | n/a |
Labels | admob, android |
Reporter | Joshua Quick |
Assignee | Hans Knöchel |
Created | 2018-05-21T22:04:20.000+0000 |
Updated | 2018-06-05T22:41:51.000+0000 |
Description
*Summary:*
By default, AdMob provides targeted ads based on user identifiable information. In order to comply with the EU GDPR, we need to be able to provide "non-personalized ads" (aka: "npa") if the end-user has not consented to targeted ads.
https://developers.google.com/admob/android/eu-consent
*Recommended Solution:*
Modify the following AdMob
requestAd()
to accept a dictionary of properties (method currently does not support arguments). The property we need is extras
, which must be a dictionary of strings. The item needed is "npa".
admob.requestAd({
extras: { npa: '1' }
});
This "extras" dictionary of strings will then be blindly copied to an Android Bundle
when requesting an ad, as documented here...
https://developers.google.com/admob/android/eu-consent#forward_consent_to_the_google_mobile_ads_sdk
The advantage of creating an "extras" dictionary is because it'll then behave the same as "ti.admob" for iOS and there are other documented Google extras that can be used.
Also, adding a dictionary of properties to requestAd()
leaves room for the possibility to support interstitial ad support in the future.
PR: https://github.com/appcelerator-modules/ti.admob/pull/77
Closing as PR's are merged & a community member has verified the working.