emi-indo-cordova-plugin-admob 1.4.8 → 1.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/ISSUE_TEMPLATE/bug_report.md +3 -0
- package/README.md +525 -82
- package/package.json +2 -1
- package/plugin.xml +302 -309
- package/src/android/emiAdmobPlugin.kt +1843 -0
- package/src/ios/emiAdmobPlugin.h +6 -2
- package/src/ios/emiAdmobPlugin.m +1646 -2560
- package/www/emiAdmobPlugin.js +42 -17
- package/example/Advanced topics/IABTFC.html +0 -187
- package/example/Advanced topics/consent.html +0 -156
- package/example/Advanced topics/globalSettings.html +0 -49
- package/example/Advanced topics/requestIDFA.html +0 -59
- package/example/Advanced topics/targeting.html +0 -64
- package/example/app_open_ads.html +0 -128
- package/example/banner_ads.html +0 -213
- package/example/interstitial_ads.html +0 -150
- package/example/rewarded_ads.html +0 -169
- package/example/rewarded_interstitial_ads.html +0 -167
- package/example/wewrtr.html +0 -0
- package/src/android/emiAdmobPlugin.java +0 -1
package/README.md
CHANGED
@@ -3,19 +3,28 @@
|
|
3
3
|
# emi-indo-cordova-plugin-admob
|
4
4
|
Cordova Plugin Admob Android and IOS
|
5
5
|
|
6
|
-
### Mobile Ads SDK (Android:
|
6
|
+
### Mobile Ads SDK (Android: 23.4.0) [Release Notes:](https://developers.google.com/admob/android/rel-notes)
|
7
|
+
|
8
|
+
### Mobile Ads SDK (IOS: 11.5.0) [Release Notes:](https://developers.google.com/admob/ios/rel-notes)
|
9
|
+
|
10
|
+
### User Messaging Platform (UMP: 3.0.0) [Release Notes:](https://developers.google.com/admob/android/privacy/release-notes)
|
11
|
+
### IAB Europe Transparency & Consent Framework (CPM: 2.2.0)
|
12
|
+
|
13
|
+
|
7
14
|
|
8
|
-
### Mobile Ads SDK (IOS: 10.14.0) [Release Notes:](https://developers.google.com/admob/ios/rel-notes)
|
9
15
|
|
10
16
|
## Minimum Cordova Engines
|
11
17
|
- cordova-android version = 12.0.0
|
12
18
|
- cordova-ios version = 7.0.0
|
13
19
|
|
20
|
+
> [!WARNING]
|
21
|
+
> - Minimum supported Xcode version to 14.3
|
22
|
+
> - Maximum supported Xcode version up to 15.2
|
14
23
|
## Minimum macOS | Xcode, and others
|
15
24
|
- Monterey
|
16
|
-
- Xcode 14.
|
25
|
+
- Xcode min 14.3 > max 15.2
|
17
26
|
- Command Line Tools 14.1 or higher
|
18
|
-
- Target iOS
|
27
|
+
- Target iOS 12.0
|
19
28
|
https://developers.google.com/admob/ios/quick-start
|
20
29
|
|
21
30
|
<details>
|
@@ -53,7 +62,9 @@ https://developers.google.com/admob/ios/quick-start
|
|
53
62
|
[](https://youtu.be/YYMJuf7gIsg)
|
54
63
|
|
55
64
|
|
65
|
+
## VIDEO Test Collapsible banner autoResize with Xcode/IOS
|
56
66
|
|
67
|
+
[](https://youtu.be/sLXHKdU6DAg)
|
57
68
|
|
58
69
|
|
59
70
|
|
@@ -62,6 +73,18 @@ https://developers.google.com/admob/ios/quick-start
|
|
62
73
|
|
63
74
|
## [Check all release notes:](https://github.com/EMI-INDO/emi-indo-cordova-plugin-admob/releases/)
|
64
75
|
|
76
|
+
> [!WARNING]
|
77
|
+
> WARNING options configuration was previously an array [], now v.1.4.9 or later must be an object{}
|
78
|
+
> example
|
79
|
+
```
|
80
|
+
previous example
|
81
|
+
[ adUnitId = App_Open_ID, autoShow = true ] // Deprecated
|
82
|
+
now
|
83
|
+
{ adUnitId: App_Open_ID, autoShow: true }
|
84
|
+
|
85
|
+
cordova.plugins.emiAdmobPlugin.loadAppOpenAd({ adUnitId: App_Open_ID, autoShow: true });
|
86
|
+
```
|
87
|
+
|
65
88
|
## Features
|
66
89
|
<details>
|
67
90
|
<summary>Features #1</summary>
|
@@ -86,10 +109,7 @@ https://developers.google.com/admob/ios/quick-start
|
|
86
109
|
```sh
|
87
110
|
cordova plugin add emi-indo-cordova-plugin-admob --save --variable APP_ID_ANDROID=ca-app-pub-xxx~xxx --variable APP_ID_IOS=ca-app-pub-xxx~xxx
|
88
111
|
```
|
89
|
-
|
90
|
-
```sh
|
91
|
-
cordova plugin add https://github.com/EMI-INDO/emi-indo-cordova-plugin-admob --save --variable APP_ID_ANDROID=ca-app-pub-xxx~xxx --variable APP_ID_IOS=ca-app-pub-xxx~xxx
|
92
|
-
```
|
112
|
+
|
93
113
|
## Remove
|
94
114
|
```sh
|
95
115
|
cordova plugin rm emi-indo-cordova-plugin-admob
|
@@ -110,15 +130,38 @@ cordova plugin rm emi-indo-cordova-plugin-admob
|
|
110
130
|
<details>
|
111
131
|
<summary>Methods: #2</summary>
|
112
132
|
<pre>
|
133
|
+
|
134
|
+
cordova.plugins.emiAdmobPlugin.initialize({
|
135
|
+
|
136
|
+
isUsingAdManagerRequest: true, // true = AdManagerAdRequest.Builder | false = AdRequest.Builder (Default true)
|
137
|
+
isResponseInfo: true, // Default false (Debug true)
|
138
|
+
isConsentDebug: true, // Default false (Debug true)
|
139
|
+
|
140
|
+
}
|
141
|
+
|
142
|
+
document.addEventListener('on.sdkInitialization', (data) => {
|
143
|
+
// JSON.stringify(data)
|
144
|
+
const sdkVersion = data.version;
|
145
|
+
// const adAdapter = data.adapters;
|
146
|
+
// const conStatus = data.consentStatus;
|
147
|
+
// const gdprApplie = data.gdprApplies;
|
148
|
+
// const purposeConsent = data.purposeConsents;
|
149
|
+
// const vendorConsents = data.vendorConsents;
|
150
|
+
// const conTCString = data.consentTCString;
|
151
|
+
// const additionalConsent = data.additionalConsent;
|
152
|
+
console.log("On Sdk Initialization version: " + sdkVersion);
|
153
|
+
|
154
|
+
});
|
155
|
+
|
113
156
|
// Support Platform: Android | IOS
|
114
|
-
cordova.plugins.emiAdmobPlugin.globalSettings(
|
115
|
-
cordova.plugins.emiAdmobPlugin.targeting(
|
116
|
-
cordova.plugins.emiAdmobPlugin.initialize();
|
157
|
+
cordova.plugins.emiAdmobPlugin.globalSettings({config_globalSettings}); // Optional
|
158
|
+
cordova.plugins.emiAdmobPlugin.targeting({config_Targeting}); // Optional
|
117
159
|
// UMP SDK 2.1.0
|
118
|
-
cordova.plugins.emiAdmobPlugin.getConsentRequest(); // (Platform: Both)
|
119
|
-
cordova.plugins.emiAdmobPlugin.consentReset(); // (Platform: Both)
|
120
|
-
cordova.plugins.emiAdmobPlugin.showPrivacyOptionsForm(); // (Platform: Both)
|
160
|
+
cordova.plugins.emiAdmobPlugin.getConsentRequest(); // (Platform: Both) // Deprecated
|
161
|
+
cordova.plugins.emiAdmobPlugin.consentReset(); // (Platform: Both) // Optional
|
162
|
+
cordova.plugins.emiAdmobPlugin.showPrivacyOptionsForm(); // (Platform: Both) // Optional
|
121
163
|
// CMP SDK 2.2.0
|
164
|
+
// Optional
|
122
165
|
cordova.plugins.emiAdmobPlugin.requestIDFA(); // UMP SDK to handle Apple's App Tracking Transparency (ATT) (Platform: IOS)
|
123
166
|
cordova.plugins.emiAdmobPlugin.getIabTfc((IABTFC) => { console.log(JSONstringify(IABTFC)) }); // CMP SDK 2.2 (Platform: Both)
|
124
167
|
|
@@ -131,7 +174,7 @@ must be false if the application is released to the play store / app store.
|
|
131
174
|
consent from will continue to be called regardless of its status 0,1,2,3,
|
132
175
|
until the value is changed to false.
|
133
176
|
|
134
|
-
|
177
|
+
isConsentDebug: true | false
|
135
178
|
</details>
|
136
179
|
<li>example</li></ul>
|
137
180
|
<pre>
|
@@ -139,28 +182,25 @@ setDebugGeography = true | false
|
|
139
182
|
|
140
183
|
document.addEventListener("deviceready", function(){
|
141
184
|
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
185
|
+
document.addEventListener('on.sdkInitialization', (data) => {
|
186
|
+
// JSON.stringify(data)
|
187
|
+
const sdkVersion = data.version;
|
188
|
+
// const adAdapter = data.adapters;
|
189
|
+
// const conStatus = data.consentStatus;
|
190
|
+
// const gdprApplie = data.gdprApplies;
|
191
|
+
// const purposeConsent = data.purposeConsents;
|
192
|
+
// const vendorConsents = data.vendorConsents;
|
193
|
+
// const conTCString = data.consentTCString;
|
194
|
+
// const additionalConsent = data.additionalConsent;
|
195
|
+
console.log("On Sdk Initialization version: " + data.consentStatus);
|
153
196
|
|
154
|
-
cordova.plugins.emiAdmobPlugin.getConsentRequest( (ststus) => { console.log("Consent Status: " + ststus) });
|
155
|
-
cordova.plugins.emiAdmobPlugin.globalSettings(config_globalSettings);
|
156
|
-
|
157
|
-
document.addEventListener('on.get.consent.status', () => {
|
158
|
-
// Regardless of the state, call SDK initialize
|
159
|
-
|
160
|
-
cordova.plugins.emiAdmobPlugin.initialize();
|
161
|
-
cordova.plugins.emiAdmobPlugin.getIabTfc((IABTFC) => { console.log(JSONstringify(IABTFC)) });
|
162
197
|
});
|
163
198
|
|
199
|
+
// cordova.plugins.emiAdmobPlugin.getConsentRequest( (ststus) => { console.log("Consent Status: " + ststus) }); // Deprecated
|
200
|
+
// cordova.plugins.emiAdmobPlugin.showPrivacyOptionsForm();
|
201
|
+
|
202
|
+
|
203
|
+
|
164
204
|
}, false);
|
165
205
|
|
166
206
|
</pre>
|
@@ -212,11 +252,11 @@ document.addEventListener('on.TCString.expired', () => {
|
|
212
252
|
|
213
253
|
|
214
254
|
- [AppTrackingTransparency (ATT) framework:](https://developer.apple.com/documentation/apptrackingtransparency/attrackingmanager/authorizationstatus)
|
215
|
-
- [Consent Management Platform API:](https://github.com/InteractiveAdvertisingBureau/GDPR-Transparency-and-Consent-Framework/blob/master/TCFv2/IAB%20Tech%20Lab%20-%20CMP%20API%20v2.md#in-app-details)
|
255
|
+
- [Consent Management Platform API:](https://github.com/InteractiveAdvertisingBureau/GDPR-Transparency-and-Consent-Framework/blob/master/TCFv2/IAB%20Tech%20Lab%20-%20CMP%20API%20v2.md#in-app-details)
|
216
256
|
|
217
|
-
- [Example Get Consent Status:](https://github.com/EMI-INDO/emi-indo-cordova-plugin-admob/blob/main/example/Advanced%20topics/consent.html) index.html
|
218
|
-
- [Example requestIDFA:](https://github.com/EMI-INDO/emi-indo-cordova-plugin-admob/blob/main/example/Advanced%20topics/requestIDFA.html) index.html
|
219
|
-
- [Example IABTFC:](https://github.com/EMI-INDO/emi-indo-cordova-plugin-admob/blob/main/example/Advanced%20topics/IABTFC.html) index.html
|
257
|
+
- [Example Get Consent Status:](https://github.com/EMI-INDO/emi-indo-cordova-plugin-admob/blob/main/example/Advanced%20topics/consent.html) index.html (Not yet updated)
|
258
|
+
- [Example requestIDFA:](https://github.com/EMI-INDO/emi-indo-cordova-plugin-admob/blob/main/example/Advanced%20topics/requestIDFA.html) index.html (Not yet updated)
|
259
|
+
- [Example IABTFC:](https://github.com/EMI-INDO/emi-indo-cordova-plugin-admob/blob/main/example/Advanced%20topics/IABTFC.html) index.html (Not yet updated)
|
220
260
|
|
221
261
|
|
222
262
|
|
@@ -250,6 +290,62 @@ if (window.cordova.platformId === 'ios') {
|
|
250
290
|
Rewarded_ID = 'ca-app-pub-3940256099942544/5224354917';
|
251
291
|
Rewarded_Interstitial_ID = 'ca-app-pub-3940256099942544/5354046379';
|
252
292
|
}
|
293
|
+
|
294
|
+
|
295
|
+
cordova.plugins.emiAdmobPlugin.initialize({
|
296
|
+
isUsingAdManagerRequest: true, // true = AdManagerAdRequest.Builder | false = AdRequest.Builder (Default true)
|
297
|
+
isResponseInfo: true, // Default false
|
298
|
+
isConsentDebug: true, // Default false
|
299
|
+
});
|
300
|
+
|
301
|
+
|
302
|
+
document.addEventListener('on.sdkInitialization', (data) => {
|
303
|
+
// JSON.stringify(data)
|
304
|
+
const sdkVersion = data.version;
|
305
|
+
// const adAdapter = data.adapters;
|
306
|
+
// const conStatus = data.consentStatus;
|
307
|
+
// const gdprApplie = data.gdprApplies;
|
308
|
+
// const purposeConsent = data.purposeConsents;
|
309
|
+
// const vendorConsents = data.vendorConsents;
|
310
|
+
// const conTCString = data.consentTCString;
|
311
|
+
// const additionalConsent = data.additionalConsent;
|
312
|
+
console.log("On Sdk Initialization version: " + sdkVersion);
|
313
|
+
|
314
|
+
|
315
|
+
cordova.plugins.emiAdmobPlugin.loadInterstitialAd({
|
316
|
+
adUnitId: "ca-app-pub-3940256099942544/1033173712",
|
317
|
+
autoShow: true
|
318
|
+
});
|
319
|
+
|
320
|
+
});
|
321
|
+
|
322
|
+
|
323
|
+
document.addEventListener('on.interstitial.loaded', () => {
|
324
|
+
|
325
|
+
console.log("on interstitial Ad loaded");
|
326
|
+
|
327
|
+
});
|
328
|
+
|
329
|
+
// all events that contain the keyword dismissed there is a block to load the ad after it is closed by the user.
|
330
|
+
// 'on.interstitial.dismissed' | 'on.rewardedInt.dismissed' | 'on.rewarded.dismissed'
|
331
|
+
document.addEventListener('on.interstitial.dismissed', () => {
|
332
|
+
|
333
|
+
console.log("on interstitial Ad dismissed");
|
334
|
+
console.log("you can load ads automatically after the ads are closed by users");
|
335
|
+
// loadInterstitialAd();
|
336
|
+
|
337
|
+
});
|
338
|
+
|
339
|
+
function loadInterstitialAd(){
|
340
|
+
|
341
|
+
cordova.plugins.emiAdmobPlugin.loadInterstitialAd({
|
342
|
+
adUnitId: "ca-app-pub-3940256099942544/1033173712",
|
343
|
+
autoShow: false
|
344
|
+
});
|
345
|
+
|
346
|
+
}
|
347
|
+
|
348
|
+
|
253
349
|
</script>
|
254
350
|
```
|
255
351
|
|
@@ -260,17 +356,42 @@ if (window.cordova.platformId === 'ios') {
|
|
260
356
|
<summary>Methods:</summary>
|
261
357
|
<pre>
|
262
358
|
// Support Platform: Android | IOS
|
263
|
-
cordova.plugins.emiAdmobPlugin.loadAppOpenAd(
|
264
|
-
cordova.plugins.emiAdmobPlugin.showAppOpenAd();
|
359
|
+
cordova.plugins.emiAdmobPlugin.loadAppOpenAd({config});
|
360
|
+
cordova.plugins.emiAdmobPlugin.showAppOpenAd(); // default
|
361
|
+
|
362
|
+
// Advanced Show (Optional)
|
363
|
+
cordova.plugins.emiAdmobPlugin.showAppOpenAd(
|
364
|
+
|
365
|
+
(data) => {
|
366
|
+
|
367
|
+
console.log("Micros: " + data.micros);
|
368
|
+
console.log("Currency: " + data.currency);
|
369
|
+
console.log("Precision: " + data.precision);
|
370
|
+
console.log("AdUnitId: " + data.adUnitId};
|
371
|
+
|
372
|
+
},
|
373
|
+
(error) => {
|
374
|
+
|
375
|
+
console.error("Error: " + error);
|
376
|
+
|
377
|
+
});
|
378
|
+
|
379
|
+
|
265
380
|
<br>
|
266
381
|
</pre>
|
267
382
|
<li>example:</li></ul>
|
268
383
|
<pre>
|
384
|
+
|
385
|
+
WARNING options configuration was previously an array [], now v.1.4.9 or later must be an object{}
|
386
|
+
example
|
387
|
+
```
|
388
|
+
previous example
|
389
|
+
[ adUnitId = App_Open_ID, autoShow = true ] // Deprecated
|
390
|
+
now
|
391
|
+
{ adUnitId: App_Open_ID, autoShow: true }
|
269
392
|
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
cordova.plugins.emiAdmobPlugin.loadAppOpenAd([ adUnitId = App_Open_ID, autoShow = true ]);
|
393
|
+
cordova.plugins.emiAdmobPlugin.loadAppOpenAd({ adUnitId: App_Open_ID, autoShow: true });
|
394
|
+
```
|
274
395
|
</pre>
|
275
396
|
</details>
|
276
397
|
|
@@ -292,10 +413,11 @@ document.addEventListener('on.appOpenAd.loaded', () => {
|
|
292
413
|
console.log("On App Open Ad loaded");
|
293
414
|
|
294
415
|
});
|
416
|
+
|
295
417
|
</pre>
|
296
418
|
</details>
|
297
419
|
|
298
|
-
- [FULL AppOpenAd basic:](https://github.com/EMI-INDO/emi-indo-cordova-plugin-admob/blob/main/example/app_open_ads.html) -index.html
|
420
|
+
- [FULL AppOpenAd basic: Not yet updated](https://github.com/EMI-INDO/emi-indo-cordova-plugin-admob/blob/main/example/app_open_ads.html) -index.html
|
299
421
|
|
300
422
|
|
301
423
|
|
@@ -305,16 +427,18 @@ document.addEventListener('on.appOpenAd.loaded', () => {
|
|
305
427
|
<details>
|
306
428
|
<summary>Methods:</summary>
|
307
429
|
<pre>
|
308
|
-
cordova.plugins.emiAdmobPlugin.
|
309
|
-
cordova.plugins.emiAdmobPlugin.
|
310
|
-
cordova.plugins.emiAdmobPlugin.
|
311
|
-
cordova.plugins.emiAdmobPlugin.
|
430
|
+
cordova.plugins.emiAdmobPlugin.styleBannerAd({ padding: 50, margins: 50 }); // (Optional)
|
431
|
+
cordova.plugins.emiAdmobPlugin.loadBannerAd({config});
|
432
|
+
cordova.plugins.emiAdmobPlugin.showBannerAd(); // default
|
433
|
+
cordova.plugins.emiAdmobPlugin.hideBannerAd(); // default
|
434
|
+
cordova.plugins.emiAdmobPlugin.removeBannerAd(); // default
|
312
435
|
</pre>
|
313
436
|
<li>example:</li></ul>
|
314
437
|
<pre>
|
315
|
-
|
316
|
-
// adUnitId = call Global Variable
|
438
|
+
WARNING options configuration was previously an array [], now v.1.4.9 or later must be an object{}
|
317
439
|
|
440
|
+
// Deprecated
|
441
|
+
/*
|
318
442
|
const bannerConfig = [
|
319
443
|
|
320
444
|
adUnitId = Banner_ID,
|
@@ -323,11 +447,42 @@ const bannerConfig = [
|
|
323
447
|
collapsible = "bottom", // (BETA) enable in globalSettings
|
324
448
|
adaptive_Width = 320, // Ignored
|
325
449
|
autoShow = true // boolean
|
326
|
-
|
327
450
|
]
|
451
|
+
*/
|
452
|
+
|
453
|
+
// NEW
|
454
|
+
|
455
|
+
const bannerConfig = {
|
456
|
+
|
457
|
+
adUnitId: "ca-app-pub-3940256099942544/9214589741", //Banner_ID,
|
458
|
+
position: "bottom-center",
|
459
|
+
size: "responsive_adaptive", // autoResize: true (only responsive_adaptive)
|
460
|
+
collapsible: "bottom", // position: top | bottom (disable, empty string)
|
461
|
+
autoResize: true, // on.screen.rotated === orientation.portrait || on.screen.rotated === orientation.landscape
|
462
|
+
autoShow: true, // boolean
|
463
|
+
|
464
|
+
}
|
328
465
|
|
329
466
|
cordova.plugins.emiAdmobPlugin.loadBannerAd(bannerConfig);
|
330
467
|
|
468
|
+
|
469
|
+
// Advanced Show (Optional)
|
470
|
+
cordova.plugins.emiAdmobPlugin.showBannerAd(
|
471
|
+
|
472
|
+
(data) => {
|
473
|
+
|
474
|
+
console.log("Micros: " + data.micros);
|
475
|
+
console.log("Currency: " + data.currency);
|
476
|
+
console.log("Precision: " + data.precision);
|
477
|
+
console.log("AdUnitId: " + data.adUnitId};
|
478
|
+
|
479
|
+
},
|
480
|
+
(error) => {
|
481
|
+
|
482
|
+
console.error("Error: " + error);
|
483
|
+
|
484
|
+
});
|
485
|
+
|
331
486
|
</pre>
|
332
487
|
</details>
|
333
488
|
|
@@ -347,16 +502,28 @@ bottom-right
|
|
347
502
|
<details>
|
348
503
|
<summary>Size type string</summary>
|
349
504
|
<pre>
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
505
|
+
|
506
|
+
responsive_adaptive
|
507
|
+
anchored_adaptive
|
508
|
+
full_width_adaptive
|
509
|
+
in_line_adaptive
|
510
|
+
banner
|
511
|
+
large_banner
|
512
|
+
medium_rectangle
|
513
|
+
full_banner
|
514
|
+
leaderboard
|
515
|
+
fluid
|
516
|
+
|
517
|
+
ANCHORED // Deprecated
|
518
|
+
IN_LINE // Deprecated
|
519
|
+
FULL_WIDTH // Deprecated
|
520
|
+
BANNER // Deprecated
|
521
|
+
FLUID // Deprecated
|
522
|
+
LARGE_BANNER // Deprecated
|
523
|
+
MEDIUM_RECTANGLE // Deprecated
|
524
|
+
FULL_BANNER // Deprecated
|
525
|
+
LEADERBOARD // Deprecated
|
526
|
+
adaptive_Width = number // Deprecated
|
360
527
|
</pre>
|
361
528
|
</details>
|
362
529
|
|
@@ -373,6 +540,8 @@ on.banner.open
|
|
373
540
|
on.banner.revenue
|
374
541
|
on.banner.remove
|
375
542
|
on.banner.hide
|
543
|
+
// new
|
544
|
+
on.is.collapsible
|
376
545
|
</pre>
|
377
546
|
<li>example:</li></ul>
|
378
547
|
<pre>
|
@@ -380,10 +549,17 @@ document.addEventListener('on.banner.load', () => {
|
|
380
549
|
|
381
550
|
console.log("on banner load");
|
382
551
|
|
383
|
-
})
|
552
|
+
});
|
553
|
+
|
554
|
+
document.addEventListener('on.is.collapsible', function(event) {
|
555
|
+
// bannerConfig collapsible: "bottom", // position: top | bottom (disable, empty string)
|
556
|
+
console.log("Collapsible Status: " + event.collapsible);
|
557
|
+
|
558
|
+
});
|
559
|
+
</pre>
|
384
560
|
</details>
|
385
561
|
|
386
|
-
[FULL Banner basic:](https://github.com/EMI-INDO/emi-indo-cordova-plugin-admob/blob/main/example/banner_ads.html) index.html
|
562
|
+
[FULL Banner basic: Not yet updated](https://github.com/EMI-INDO/emi-indo-cordova-plugin-admob/blob/main/example/banner_ads.html) index.html
|
387
563
|
|
388
564
|
|
389
565
|
## Interstitial ADS
|
@@ -393,17 +569,42 @@ document.addEventListener('on.banner.load', () => {
|
|
393
569
|
<summary>Methods:</summary>
|
394
570
|
<pre>
|
395
571
|
// Support Platform: Android | IOS
|
396
|
-
cordova.plugins.emiAdmobPlugin.loadInterstitialAd(
|
397
|
-
cordova.plugins.emiAdmobPlugin.showInterstitialAd();
|
572
|
+
cordova.plugins.emiAdmobPlugin.loadInterstitialAd({config});
|
573
|
+
cordova.plugins.emiAdmobPlugin.showInterstitialAd(); // default
|
574
|
+
|
575
|
+
// Advanced Show (Optional)
|
576
|
+
cordova.plugins.emiAdmobPlugin.showInterstitialAd(
|
577
|
+
|
578
|
+
(data) => {
|
579
|
+
|
580
|
+
console.log("Micros: " + data.micros);
|
581
|
+
console.log("Currency: " + data.currency);
|
582
|
+
console.log("Precision: " + data.precision);
|
583
|
+
console.log("AdUnitId: " + data.adUnitId};
|
584
|
+
|
585
|
+
},
|
586
|
+
(error) => {
|
587
|
+
|
588
|
+
console.error("Error: " + error);
|
589
|
+
|
590
|
+
});
|
398
591
|
<br>
|
399
592
|
</pre>
|
400
593
|
<li>example:</li></ul>
|
401
594
|
<pre>
|
402
595
|
|
403
|
-
|
404
|
-
|
596
|
+
WARNING options configuration was previously an array [], now v.1.4.9 or later must be an object{}
|
597
|
+
example
|
598
|
+
```
|
599
|
+
/*
|
600
|
+
previous example
|
601
|
+
[ adUnitId = Interstitial_ID, autoShow = true ] // Deprecated
|
602
|
+
|
603
|
+
{ adUnitId: Interstitial_ID, autoShow: true } // NEW
|
604
|
+
*/
|
605
|
+
cordova.plugins.emiAdmobPlugin.loadInterstitialAd({ adUnitId: "ca-app-pub-3940256099942544/1033173712", autoShow: true });
|
606
|
+
```
|
405
607
|
|
406
|
-
cordova.plugins.emiAdmobPlugin.loadInterstitialAd([ adUnitId = Interstitial_ID, autoShow = true ]);
|
407
608
|
</pre>
|
408
609
|
</details>
|
409
610
|
|
@@ -428,11 +629,23 @@ document.addEventListener('on.interstitial.loaded', () => {
|
|
428
629
|
console.log("on interstitial Ad loaded");
|
429
630
|
|
430
631
|
});
|
632
|
+
|
633
|
+
// all events that contain the keyword dismissed there is a block to load the ad after it is closed by the user.
|
634
|
+
// 'on.interstitial.dismissed' | 'on.rewardedInt.dismissed' | 'on.rewarded.dismissed'
|
635
|
+
document.addEventListener('on.interstitial.dismissed', () => {
|
636
|
+
|
637
|
+
console.log("on interstitial Ad dismissed");
|
638
|
+
console.log("you can load ads automatically after the ads are closed by users");
|
639
|
+
// loadInterstitialAd();
|
640
|
+
|
641
|
+
});
|
642
|
+
|
643
|
+
|
431
644
|
</pre>
|
432
645
|
</details>
|
433
646
|
|
434
647
|
|
435
|
-
[FULL Interstitial basic:](https://github.com/EMI-INDO/emi-indo-cordova-plugin-admob/blob/main/example/interstitial_ads.html) index.html
|
648
|
+
[FULL Interstitial basic: Not yet updated](https://github.com/EMI-INDO/emi-indo-cordova-plugin-admob/blob/main/example/interstitial_ads.html) index.html
|
436
649
|
|
437
650
|
|
438
651
|
|
@@ -445,17 +658,34 @@ document.addEventListener('on.interstitial.loaded', () => {
|
|
445
658
|
<summary>Methods:</summary>
|
446
659
|
<pre>
|
447
660
|
// Support Platform: Android | IOS
|
448
|
-
cordova.plugins.emiAdmobPlugin.loadRewardedInterstitialAd(
|
449
|
-
cordova.plugins.emiAdmobPlugin.showRewardedInterstitialAd();
|
661
|
+
cordova.plugins.emiAdmobPlugin.loadRewardedInterstitialAd({config});
|
662
|
+
cordova.plugins.emiAdmobPlugin.showRewardedInterstitialAd(); // default
|
450
663
|
<br>
|
451
664
|
</pre>
|
452
665
|
<li>example:</li></ul>
|
453
666
|
<pre>
|
454
667
|
|
455
|
-
|
456
|
-
|
668
|
+
cordova.plugins.emiAdmobPlugin.loadRewardedInterstitialAd({ adUnitId: Rewarded_Interstitial_ID, autoShow: true });
|
669
|
+
|
670
|
+
// Advanced Show (Optional)
|
671
|
+
cordova.plugins.emiAdmobPlugin.showRewardedInterstitialAd(
|
457
672
|
|
458
|
-
|
673
|
+
(data) => {
|
674
|
+
|
675
|
+
console.log("Micros: " + data.micros);
|
676
|
+
console.log("Currency: " + data.currency);
|
677
|
+
console.log("Precision: " + data.precision);
|
678
|
+
console.log("AdUnitId: " + data.adUnitId};
|
679
|
+
|
680
|
+
},
|
681
|
+
(error) => {
|
682
|
+
|
683
|
+
console.error("Error: " + error);
|
684
|
+
|
685
|
+
});
|
686
|
+
|
687
|
+
|
688
|
+
|
459
689
|
</pre>
|
460
690
|
</details>
|
461
691
|
|
@@ -482,10 +712,22 @@ document.addEventListener('on.rewardedInt.loaded', () => {
|
|
482
712
|
console.log("on rewarded Interstitial load");
|
483
713
|
|
484
714
|
});
|
715
|
+
|
716
|
+
// all events that contain the keyword dismissed there is a block to load the ad after it is closed by the user.
|
717
|
+
// 'on.interstitial.dismissed' | 'on.rewardedInt.dismissed' | 'on.rewarded.dismissed'
|
718
|
+
document.addEventListener('on.rewardedInt.dismissed', () => {
|
719
|
+
|
720
|
+
console.log("on interstitial Ad dismissed");
|
721
|
+
console.log("you can load ads automatically after the ads are closed by users");
|
722
|
+
// loadRewardedInterstitialAd();
|
723
|
+
|
724
|
+
});
|
725
|
+
|
726
|
+
|
485
727
|
</pre>
|
486
728
|
</details>
|
487
729
|
|
488
|
-
[FULL Rewarded Interstitial basic:](https://github.com/EMI-INDO/emi-indo-cordova-plugin-admob/blob/main/example/rewarded_interstitial_ads.html) index.html
|
730
|
+
[FULL Rewarded Interstitial basic: Not yet updated](https://github.com/EMI-INDO/emi-indo-cordova-plugin-admob/blob/main/example/rewarded_interstitial_ads.html) index.html
|
489
731
|
|
490
732
|
|
491
733
|
|
@@ -497,15 +739,33 @@ document.addEventListener('on.rewardedInt.loaded', () => {
|
|
497
739
|
<summary>Methods:</summary>
|
498
740
|
<pre>
|
499
741
|
// Support Platform: Android | IOS
|
500
|
-
cordova.plugins.emiAdmobPlugin.loadRewardedAd(
|
501
|
-
cordova.plugins.emiAdmobPlugin.showRewardedAd();
|
742
|
+
cordova.plugins.emiAdmobPlugin.loadRewardedAd({config});
|
743
|
+
cordova.plugins.emiAdmobPlugin.showRewardedAd(); // default
|
502
744
|
<br>
|
503
745
|
</pre>
|
504
746
|
<li>example:</li></ul>
|
505
747
|
<pre>
|
506
|
-
// adUnitId = call Global Variable
|
507
748
|
|
508
|
-
cordova.plugins.emiAdmobPlugin.loadRewardedAd(
|
749
|
+
cordova.plugins.emiAdmobPlugin.loadRewardedAd({ adUnitId: Rewarded_ID, autoShow: true });
|
750
|
+
|
751
|
+
// Advanced Show (Optional)
|
752
|
+
cordova.plugins.emiAdmobPlugin.showRewardedAd(
|
753
|
+
|
754
|
+
(data) => {
|
755
|
+
|
756
|
+
console.log("Micros: " + data.micros);
|
757
|
+
console.log("Currency: " + data.currency);
|
758
|
+
console.log("Precision: " + data.precision);
|
759
|
+
console.log("AdUnitId: " + data.adUnitId};
|
760
|
+
|
761
|
+
},
|
762
|
+
(error) => {
|
763
|
+
|
764
|
+
console.error("Error: " + error);
|
765
|
+
|
766
|
+
});
|
767
|
+
|
768
|
+
|
509
769
|
</pre>
|
510
770
|
</details>
|
511
771
|
|
@@ -533,19 +793,202 @@ document.addEventListener('on.rewarded.loaded', () => {
|
|
533
793
|
console.log("on rewarded Ad loaded");
|
534
794
|
|
535
795
|
});
|
796
|
+
|
797
|
+
// all events that contain the keyword dismissed there is a block to load the ad after it is closed by the user.
|
798
|
+
// 'on.interstitial.dismissed' | 'on.rewardedInt.dismissed' | 'on.rewarded.dismissed'
|
799
|
+
document.addEventListener('on.rewarded.dismissed', () => {
|
800
|
+
|
801
|
+
console.log("on interstitial Ad dismissed");
|
802
|
+
console.log("you can load ads automatically after the ads are closed by users");
|
803
|
+
// loadRewardedAd();
|
804
|
+
|
805
|
+
});
|
806
|
+
|
807
|
+
|
808
|
+
</pre>
|
809
|
+
</details>
|
810
|
+
|
811
|
+
[FULL Rewarded basic: Not yet updated](https://github.com/EMI-INDO/emi-indo-cordova-plugin-admob/blob/main/example/rewarded_ads.html) index.html
|
812
|
+
|
813
|
+
|
814
|
+
|
815
|
+
|
816
|
+
## New Method (Only Android)
|
817
|
+
### Ad Request Control
|
818
|
+
> [!WARNING]
|
819
|
+
> - isUsingAdManagerRequest: true
|
820
|
+
> - Must run before ad load
|
821
|
+
|
822
|
+
- cordova.plugins.emiAdmobPlugin.targetingAdRequest({configAdRequest});
|
823
|
+
- cordova.plugins.emiAdmobPlugin.setPersonalizationState({config});
|
824
|
+
- cordova.plugins.emiAdmobPlugin.setPPS({config});
|
825
|
+
|
826
|
+
<details>
|
827
|
+
<summary>targetingAdRequest</summary>
|
828
|
+
<pre>
|
829
|
+
|
830
|
+
|
831
|
+
// Check documentation: https://developers.google.com/ad-manager/mobile-ads-sdk/android/targeting
|
832
|
+
|
833
|
+
```
|
834
|
+
const configAdRequest = {
|
835
|
+
|
836
|
+
// enabled, disabled
|
837
|
+
customTargetingEnabled: false,
|
838
|
+
categoryExclusionsEnabled: false,
|
839
|
+
ppIdEnabled: false,
|
840
|
+
contentURLEnabled: false,
|
841
|
+
brandSafetyEnabled: false,
|
842
|
+
|
843
|
+
// set Value
|
844
|
+
customTargetingValue: ["24", "25", "26"], // age
|
845
|
+
categoryExclusionsValue: "automobile", // automobile or boat
|
846
|
+
ppIdValue: "AB123456789",
|
847
|
+
contentURLValue: "https://www.example.com",
|
848
|
+
brandSafetyArr: ["https://www.mycontenturl1.com", "https://www.mycontenturl2.com"],
|
849
|
+
|
850
|
+
}
|
851
|
+
|
852
|
+
cordova.plugins.emiAdmobPlugin.targetingAdRequest(configAdRequest);
|
853
|
+
```
|
854
|
+
|
855
|
+
</pre>
|
856
|
+
</details>
|
857
|
+
|
858
|
+
|
859
|
+
|
860
|
+
|
861
|
+
<details>
|
862
|
+
<summary>setPersonalizationState</summary>
|
863
|
+
<pre>
|
864
|
+
|
865
|
+
// Check documentation: https://developers.google.com/ad-manager/mobile-ads-sdk/android/targeting
|
866
|
+
|
867
|
+
cordova.plugins.emiAdmobPlugin.setPersonalizationState({
|
868
|
+
|
869
|
+
setPersonalizationState: "disabled" // type string: disabled | enabled
|
870
|
+
|
871
|
+
});
|
872
|
+
|
873
|
+
</pre>
|
874
|
+
</details>
|
875
|
+
|
876
|
+
|
877
|
+
|
878
|
+
|
879
|
+
<details>
|
880
|
+
<summary>setPPS</summary>
|
881
|
+
<pre>
|
882
|
+
|
883
|
+
// Check documentation: https://developers.google.com/ad-manager/mobile-ads-sdk/android/targeting
|
884
|
+
|
885
|
+
```
|
886
|
+
cordova.plugins.emiAdmobPlugin.setPPS({
|
887
|
+
|
888
|
+
ppsEnabled: false, // enabled, disabled
|
889
|
+
iabContent: "IAB_AUDIENCE_1_1", // Type string value: IAB_AUDIENCE_1_1 or IAB_CONTENT_2_2
|
890
|
+
ppsArrValue: [6,284], // type arr
|
891
|
+
|
892
|
+
});
|
893
|
+
|
894
|
+
```
|
895
|
+
|
896
|
+
</pre>
|
897
|
+
</details>
|
898
|
+
|
899
|
+
|
900
|
+
<details>
|
901
|
+
<summary>Example:</summary>
|
902
|
+
<pre>
|
903
|
+
|
904
|
+
// Check documentation: https://developers.google.com/ad-manager/mobile-ads-sdk/android/targeting
|
905
|
+
|
906
|
+
```
|
907
|
+
function callSetPPS(){
|
908
|
+
|
909
|
+
cordova.plugins.emiAdmobPlugin.setPPS({
|
910
|
+
|
911
|
+
ppsEnabled: true, // enabled, disabled
|
912
|
+
iabContent: "IAB_AUDIENCE_1_1", // Type string value: IAB_AUDIENCE_1_1 or IAB_CONTENT_2_2
|
913
|
+
ppsArrValue: [6,284], // type arr
|
914
|
+
|
915
|
+
});
|
916
|
+
|
917
|
+
}
|
918
|
+
|
919
|
+
if (callSetPPS()){
|
920
|
+
|
921
|
+
cordova.plugins.emiAdmobPlugin.loadRewardedAd({ adUnitId: Rewarded_ID, autoShow: true });
|
922
|
+
|
923
|
+
}
|
924
|
+
|
925
|
+
```
|
926
|
+
|
927
|
+
|
928
|
+
|
929
|
+
|
930
|
+
|
536
931
|
</pre>
|
537
932
|
</details>
|
538
933
|
|
539
|
-
[FULL Rewarded basic:](https://github.com/EMI-INDO/emi-indo-cordova-plugin-admob/blob/main/example/rewarded_ads.html) index.html
|
540
934
|
|
541
935
|
|
542
936
|
|
937
|
+
## New Method (Only IOS)
|
938
|
+
- You will see higher earnings.
|
939
|
+
> [!NOTE]
|
940
|
+
> - Is forcing the consent form to be displayed against admob policy? (I DON'T KNOW)
|
941
|
+
>
|
942
|
+
<details>
|
943
|
+
<summary>Method:</summary>
|
944
|
+
<pre>
|
945
|
+
|
946
|
+
/*
|
947
|
+
|
948
|
+
Sometimes the consent form in IOS is difficult to display,
|
949
|
+
because ATT has been set by the user,
|
950
|
+
The problem is TCString null,
|
951
|
+
causing very few admob ads to load,
|
952
|
+
This method will force the consent form to be displayed, whatever the user's decision TCString will not be null.
|
953
|
+
|
954
|
+
*/
|
955
|
+
```
|
956
|
+
// Use your own logic, this is just an example
|
957
|
+
|
958
|
+
let userGdpr = null; // global Variable
|
959
|
+
let userTCString = null; // global Variable
|
960
|
+
|
961
|
+
document.addEventListener('on.sdkInitialization', (data) => {
|
962
|
+
userGdpr = data.gdprApplies;
|
963
|
+
userTCString = data.consentTCString;
|
964
|
+
});
|
965
|
+
|
966
|
+
|
967
|
+
if (userGdpr === 1 && userTCString === null){
|
968
|
+
|
969
|
+
cordova.plugins.emiAdmobPlugin.forceDisplayPrivacyForm();
|
970
|
+
|
971
|
+
}
|
972
|
+
```
|
973
|
+
|
974
|
+
</pre>
|
975
|
+
</details>
|
976
|
+
|
543
977
|
|
544
978
|
|
545
979
|
|
546
980
|
|
547
981
|
|
982
|
+
## GLOBAL EVENT Screen (Optional)
|
548
983
|
|
984
|
+
<details>
|
985
|
+
<summary>Event:</summary>
|
986
|
+
<pre>
|
987
|
+
on.screen.rotated
|
988
|
+
on.orientation.portrait
|
989
|
+
on.orientation.landscape
|
990
|
+
</pre>
|
991
|
+
</details>
|
549
992
|
|
550
993
|
|
551
994
|
|
@@ -565,7 +1008,7 @@ document.addEventListener('on.rewarded.loaded', () => {
|
|
565
1008
|
- Interstitial Ads
|
566
1009
|
- Rewarded Ads
|
567
1010
|
- Rewarded interstitial Ads
|
568
|
-
- [Consent](https://github.com/EMI-INDO/emi-indo-cordova-plugin-admob/blob/main/example/Advanced%20topics/consent.html)
|
1011
|
+
- [Consent Not yet updated](https://github.com/EMI-INDO/emi-indo-cordova-plugin-admob/blob/main/example/Advanced%20topics/consent.html)
|
569
1012
|
- Mediation
|
570
1013
|
- impression-level-ad-revenue
|
571
1014
|
- GDPR IAB TFCv2.2
|