emi-indo-cordova-plugin-admob 1.4.2 → 1.4.4
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/README.md +522 -248
- package/example/Advanced topics/{consent_GDPR_IAB_TFCv2.2.html → IABTFC.html } +22 -114
- package/example/Advanced topics/consent.html +47 -35
- package/example/Advanced topics/globalSettings.html +17 -8
- package/example/Advanced topics/requestIDFA.html +59 -0
- package/example/Advanced topics/targeting.html +14 -28
- package/example/app_open_ads.html +20 -43
- package/example/banner_ads.html +62 -97
- package/example/interstitial_ads.html +28 -44
- package/example/rewarded_ads.html +29 -45
- package/example/rewarded_interstitial_ads.html +27 -44
- package/example/wewrtr.html +0 -0
- package/package.json +1 -1
- package/plugin.xml +3 -3
- package/src/android/emiAdmobPlugin.java +1 -1
- package/src/ios/emiAdmobPlugin.h +3 -2
- package/src/ios/emiAdmobPlugin.m +371 -515
- package/www/emiAdmobPlugin.js +24 -23
- package/example/Advanced topics/auto_load_and_show.html +0 -94
package/README.md
CHANGED
@@ -1,14 +1,26 @@
|
|
1
|
+
|
2
|
+
|
1
3
|
# emi-indo-cordova-plugin-admob
|
2
4
|
Cordova Plugin Admob Android and IOS
|
3
5
|
|
4
|
-
### Mobile Ads SDK (Android: 22.
|
6
|
+
### Mobile Ads SDK (Android: 22.6.0) [Release Notes:](https://developers.google.com/admob/android/rel-notes)
|
7
|
+
|
8
|
+
### Mobile Ads SDK (IOS: 10.14.0) [Release Notes:](https://developers.google.com/admob/ios/rel-notes)
|
5
9
|
|
6
|
-
|
10
|
+
## Minimum Cordova Engines
|
11
|
+
- cordova-android version = 12.0.0
|
12
|
+
- cordova-ios version = 7.0.0
|
7
13
|
|
8
|
-
### [Documentation for IOS](https://github.com/EMI-INDO/emi-indo-cordova-plugin-admob/discussions/3)
|
9
14
|
|
10
|
-
|
15
|
+
## Minimum macOS | Xcode, and others
|
16
|
+
- Monterey
|
17
|
+
- Xcode 14.1 or higher
|
18
|
+
- Command Line Tools 14.1 or higher
|
19
|
+
- Target iOS 11.0 or higher
|
20
|
+
https://developers.google.com/admob/ios/quick-start
|
11
21
|
|
22
|
+
<details>
|
23
|
+
<summary>Guaranteed income using this plugin #14</summary>
|
12
24
|
|
13
25
|
> __Note__
|
14
26
|
> - ## It's Not a fork, it's purely rewritten, clean of 3rd party code.
|
@@ -18,340 +30,606 @@
|
|
18
30
|
> - ### No Remote Control
|
19
31
|
> - ### I guarantee 100% revenue for you.
|
20
32
|
> - [Code source:](https://github.com/googleads/googleads-mobile-android-examples) - Admob:
|
21
|
-
|
33
|
+
> -
|
34
|
+
</details>
|
22
35
|
|
23
36
|
## 💰Sponsor this project
|
24
37
|
[](https://paypal.me/emiindo)
|
25
38
|
|
26
39
|
## [Check all release notes:](https://github.com/EMI-INDO/emi-indo-cordova-plugin-admob/releases/)
|
27
40
|
|
28
|
-
|
29
|
-
## Minimum Cordova Engines
|
30
|
-
- cordova version = 10.0.0
|
31
|
-
- cordova-android version = 11.0.0
|
32
|
-
- cordova-ios version = 6.0.0
|
33
|
-
|
34
41
|
## Features
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
-
|
50
|
-
|
51
|
-
|
52
|
-
- https://developers.google.com/admob/android/impression-level-ad-revenue ( Finished ) v1.1.9
|
53
|
-
- https://developers.google.com/admob/android/ssv
|
54
|
-
- https://developers.google.com/admob/android/privacy/gdpr ( Finished ) v1.4.0 [index.html](https://github.com/EMI-INDO/emi-indo-cordova-plugin-admob/blob/main/example/Advanced%20topics/consent_GDPR_IAB_TFCv2.2.html)
|
55
|
-
- https://github.com/InteractiveAdvertisingBureau/GDPR-Transparency-and-Consent-Framework/ ( Finished ) v1.4.0 [index.html](https://github.com/EMI-INDO/emi-indo-cordova-plugin-admob/blob/main/example/Advanced%20topics/consent_GDPR_IAB_TFCv2.2.html)
|
56
|
-
|
57
|
-
|
58
|
-
|
42
|
+
<details>
|
43
|
+
<summary>Features #1</summary>
|
44
|
+
<ul>
|
45
|
+
<li> initialize</li>
|
46
|
+
<li> targeting</li>
|
47
|
+
<li> globalSettings</li>
|
48
|
+
<li> AppTrackingTransparency (ATT)</li>
|
49
|
+
<li> CMP SDK</li>
|
50
|
+
<li> UMP SDK</li>
|
51
|
+
<li> App Open Ads</li>
|
52
|
+
<li> Banner Ads</li>
|
53
|
+
<li> Interstitial Ads</li>
|
54
|
+
<li> Rewarded Ads</li>
|
55
|
+
<li> Mediation</li>
|
56
|
+
<li> impression-level-ad-revenue</li>
|
57
|
+
</ul>
|
58
|
+
</details>
|
59
59
|
|
60
60
|
## Installation
|
61
61
|
|
62
62
|
```sh
|
63
|
-
cordova plugin add emi-indo-cordova-plugin-admob --variable APP_ID_ANDROID=ca-app-pub-
|
63
|
+
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
|
64
64
|
```
|
65
65
|
### Or
|
66
66
|
```sh
|
67
|
-
cordova plugin add https://github.com/EMI-INDO/emi-indo-cordova-plugin-admob --variable APP_ID_ANDROID=ca-app-pub-
|
67
|
+
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
|
68
68
|
```
|
69
69
|
## Remove
|
70
70
|
```sh
|
71
71
|
cordova plugin rm emi-indo-cordova-plugin-admob
|
72
72
|
```
|
73
73
|
|
74
|
-
## upgrade Mobile Ads SDK
|
75
|
-
[Release Notes Mobile Ads SDK:](https://developers.google.com/admob/android/rel-notes)
|
76
|
-
```sh
|
77
|
-
cordova plugin add emi-indo-cordova-plugin-admob --variable APP_ID_ANDROID=ca-app-pub-3940256099942544~3347511713 --variable PLAY_SERVICES_VERSION="xxxx"
|
78
|
-
```
|
79
74
|
|
80
75
|
|
76
|
+
## Import the Mobile Ads SDK IOS
|
77
|
+
### Then from the command line run:
|
78
|
+
- cd platforms/ios
|
79
|
+
### Then from the command line run:
|
80
|
+
- pod install --repo-update
|
81
81
|
|
82
|
-
> __Note__
|
83
|
-
>
|
84
82
|
|
85
|
-
> - # Plugin version @1.4.0
|
86
83
|
|
87
|
-
|
88
|
-
- replace all AdUnitId to adUnitId
|
89
|
-
- new banner size: FULL_WIDTH
|
84
|
+
## >>> Device Ready <<<
|
90
85
|
|
91
|
-
|
86
|
+
<details>
|
87
|
+
<summary>Methods: #2</summary>
|
88
|
+
<pre>
|
89
|
+
// Support Platform: Android | IOS
|
90
|
+
cordova.plugins.emiAdmobPlugin.globalSettings([config_globalSettings]);
|
91
|
+
cordova.plugins.emiAdmobPlugin.targeting([config_Targeting]);
|
92
|
+
cordova.plugins.emiAdmobPlugin.initialize();
|
93
|
+
// UMP SDK 2.1.0
|
94
|
+
cordova.plugins.emiAdmobPlugin.getConsentRequest(); // (Platform: Both)
|
95
|
+
cordova.plugins.emiAdmobPlugin.consentReset(); // (Platform: Both)
|
96
|
+
cordova.plugins.emiAdmobPlugin.showPrivacyOptionsForm(); // (Platform: Both)
|
97
|
+
// CMP SDK 2.2.0
|
98
|
+
cordova.plugins.emiAdmobPlugin.requestIDFA(); // UMP SDK to handle Apple's App Tracking Transparency (ATT) (Platform: IOS)
|
99
|
+
cordova.plugins.emiAdmobPlugin.getIabTfc((IABTFC) => { console.log(JSONstringify(IABTFC)) }); // CMP SDK 2.2 (Platform: Both)
|
92
100
|
|
93
|
-
>
|
101
|
+
</pre>
|
102
|
+
<details>
|
103
|
+
<summary>Note setDebugGeography #2</summary>
|
104
|
+
Testing is very easy, no need for VPN, TEST-DEVICE-HASHED-ID, or anything else, everything has been made programmatically.
|
94
105
|
|
95
|
-
|
106
|
+
must be false if the application is released to the play store / app store.
|
107
|
+
consent from will continue to be called regardless of its status 0,1,2,3,
|
108
|
+
until the value is changed to false.
|
96
109
|
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
110
|
+
setDebugGeography = true | false
|
111
|
+
</details>
|
112
|
+
<li>example</li></ul>
|
113
|
+
<pre>
|
114
|
+
|
102
115
|
|
103
|
-
|
116
|
+
document.addEventListener("deviceready", function(){
|
117
|
+
|
118
|
+
const config_globalSettings = [
|
119
|
+
|
120
|
+
setAppMuted = false, // default: false
|
121
|
+
setAppVolume = 1, // float: default: 1
|
122
|
+
enableSameAppKey = false, // default: false
|
123
|
+
npa = "1", // string "0" | "1"
|
124
|
+
enableCollapsible = true, // (BETA) activate the collapsible banner ads
|
125
|
+
responseInfo = false, // default: false
|
126
|
+
setDebugGeography = false // default: false
|
127
|
+
|
128
|
+
]
|
129
|
+
|
130
|
+
cordova.plugins.emiAdmobPlugin.getConsentRequest( (ststus) => { console.log("Consent Status: " + ststus) });
|
131
|
+
cordova.plugins.emiAdmobPlugin.globalSettings(config_globalSettings);
|
132
|
+
|
133
|
+
document.addEventListener('on.get.consent.status', () => {
|
134
|
+
// Regardless of the state, call SDK initialize
|
135
|
+
|
136
|
+
cordova.plugins.emiAdmobPlugin.initialize();
|
137
|
+
cordova.plugins.emiAdmobPlugin.getIabTfc((IABTFC) => { console.log(JSONstringify(IABTFC)) });
|
138
|
+
});
|
104
139
|
|
105
|
-
|
106
|
-
### Example How to read consent choices
|
140
|
+
}, false);
|
107
141
|
|
108
|
-
|
109
|
-
// index.html https://github.com/EMI-INDO/emi-indo-cordova-plugin-admob/blob/main/example/Advanced%20topics/consent_GDPR_IAB_TFCv2.2.html
|
110
|
-
```sh
|
111
|
-
// >>>>>>>> New features (UMP) SDK v2.1.0
|
112
|
-
// https://developers.google.com/admob/android/privacy/gdpr
|
113
|
-
/*
|
114
|
-
If the user chooses not to display ads,
|
115
|
-
you can restrict access to the app, or ban it,
|
116
|
-
until they change their decision back,
|
117
|
-
Just call showPrivacyOptionsForm();
|
118
|
-
*/
|
142
|
+
</pre>
|
119
143
|
|
144
|
+
</details>
|
120
145
|
|
121
|
-
cordova.plugins.emiAdmobPlugin.getIabTfc(
|
122
|
-
(info) => {
|
123
|
-
// How to read consent choices
|
124
|
-
console.log("IABTCF_gdprApplies: " + info.IABTCF_gdprApplies);
|
125
|
-
console.log("IABTCF_PurposeConsents: " + info.IABTCF_PurposeConsents);
|
126
|
-
console.log("IABTCF_TCString: " + info.IABTCF_TCString);
|
127
146
|
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
} else if (fundingChoices === "") {
|
138
|
-
|
139
|
-
// disable app features.
|
140
|
-
|
141
|
-
} else {
|
142
|
-
|
143
|
-
// You have to test everything yourself.
|
144
|
-
console.log(info);
|
145
|
-
|
146
|
-
}
|
147
|
-
|
148
|
-
},
|
149
|
-
(error) => {
|
150
|
-
console.log("Error: " + error);
|
151
|
-
|
152
|
-
});
|
147
|
+
<details>
|
148
|
+
<summary>Event UMP SDK #3</summary>
|
149
|
+
<pre>
|
150
|
+
on.get.consent.status
|
151
|
+
<br>
|
152
|
+
</pre>
|
153
|
+
<li>example:#4</li></ul>
|
154
|
+
<pre>
|
155
|
+
document.addEventListener('on.get.consent.status', () => {
|
153
156
|
|
154
|
-
|
157
|
+
console.log("on get consent status");
|
155
158
|
|
156
|
-
|
159
|
+
});
|
160
|
+
</pre>
|
161
|
+
</details>
|
162
|
+
|
163
|
+
<details>
|
164
|
+
<summary>Event CMP SDK #5</summary>
|
165
|
+
<pre>
|
166
|
+
on.getIabTfc
|
167
|
+
on.TCString.expired
|
168
|
+
on.TCString.remove
|
169
|
+
<br>
|
170
|
+
</pre>
|
171
|
+
|
172
|
+
<details>
|
173
|
+
<summary>Note #6</summary>
|
174
|
+
TCString expires 360 days, plugin automatically deletes it after 360 days. call consentRest()
|
175
|
+
</details>
|
176
|
+
<li>example: #7</li></ul>
|
177
|
+
<pre>
|
178
|
+
document.addEventListener('on.TCString.expired', () => {
|
179
|
+
|
180
|
+
console.log("on TCString expires 360 days");
|
181
|
+
cordova.plugins.emiAdmobPlugin.consentReset();
|
157
182
|
|
183
|
+
});
|
184
|
+
</pre>
|
185
|
+
</details>
|
158
186
|
|
159
|
-
# Event | callback:
|
160
|
-
### Example event code
|
161
187
|
|
162
|
-
|
188
|
+
|
189
|
+
|
190
|
+
- [AppTrackingTransparency (ATT) framework:](https://developer.apple.com/documentation/apptrackingtransparency/attrackingmanager/authorizationstatus)
|
191
|
+
- [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)
|
192
|
+
|
193
|
+
- [Example Get Consent Status:](https://github.com/EMI-INDO/emi-indo-cordova-plugin-admob/blob/main/example/Advanced%20topics/consent.html) index.html
|
194
|
+
- [Example requestIDFA:](https://github.com/EMI-INDO/emi-indo-cordova-plugin-admob/blob/main/example/Advanced%20topics/requestIDFA.html) index.html
|
195
|
+
- [Example IABTFC:](https://github.com/EMI-INDO/emi-indo-cordova-plugin-admob/blob/main/example/Advanced%20topics/IABTFC.html) index.html
|
196
|
+
|
197
|
+
|
198
|
+
|
199
|
+
## Global Variable adunitId
|
200
|
+
|
201
|
+
```
|
202
|
+
<script>
|
203
|
+
Ad format Demo ad unit ID
|
204
|
+
// https://developers.google.com/admob/android/test-ads
|
205
|
+
// https://developers.google.com/admob/ios/test-ads
|
206
|
+
|
207
|
+
var App_Open_ID;
|
208
|
+
var Banner_ID;
|
209
|
+
var Interstitial_ID;
|
210
|
+
var Rewarded_ID;
|
211
|
+
var Rewarded_Interstitial_ID;
|
212
|
+
|
213
|
+
if (window.cordova.platformId === 'ios') {
|
214
|
+
|
215
|
+
App_Open_ID = 'ca-app-pub-3940256099942544/5575463023';
|
216
|
+
Banner_ID = 'ca-app-pub-3940256099942544/2934735716';
|
217
|
+
Interstitial_ID = 'ca-app-pub-3940256099942544/4411468910';
|
218
|
+
Rewarded_ID = 'ca-app-pub-3940256099942544/1712485313';
|
219
|
+
Rewarded_Interstitial_ID = 'ca-app-pub-3940256099942544/6978759866';
|
220
|
+
|
221
|
+
} else {
|
222
|
+
// Assume Android
|
223
|
+
App_Open_ID = 'ca-app-pub-3940256099942544/9257395921';
|
224
|
+
Banner_ID = 'ca-app-pub-3940256099942544/6300978111';
|
225
|
+
Interstitial_ID = 'ca-app-pub-3940256099942544/1033173712';
|
226
|
+
Rewarded_ID = 'ca-app-pub-3940256099942544/5224354917';
|
227
|
+
Rewarded_Interstitial_ID = 'ca-app-pub-3940256099942544/5354046379';
|
228
|
+
}
|
229
|
+
</script>
|
230
|
+
```
|
231
|
+
|
232
|
+
|
233
|
+
## AppOpenAd ADS
|
234
|
+
|
235
|
+
<details>
|
236
|
+
<summary>Methods:</summary>
|
237
|
+
<pre>
|
238
|
+
// Support Platform: Android | IOS
|
239
|
+
cordova.plugins.emiAdmobPlugin.loadAppOpenAd([config_AppOpenAd]);
|
240
|
+
cordova.plugins.emiAdmobPlugin.showAppOpenAd();
|
241
|
+
<br>
|
242
|
+
</pre>
|
243
|
+
<li>example:</li></ul>
|
244
|
+
<pre>
|
245
|
+
|
246
|
+
// WARNING config must be an array[] not an object{}
|
247
|
+
// adUnitId = call Global Variable
|
248
|
+
|
249
|
+
cordova.plugins.emiAdmobPlugin.loadAppOpenAd([ adUnitId = App_Open_ID, autoShow = true ]);
|
250
|
+
</pre>
|
251
|
+
</details>
|
252
|
+
|
253
|
+
<details>
|
254
|
+
<summary>Event</summary>
|
255
|
+
<pre>
|
256
|
+
on.appOpenAd.loaded
|
257
|
+
on.appOpenAd.failed.loaded
|
258
|
+
on.appOpenAd.dismissed
|
259
|
+
on.appOpenAd.failed.show
|
260
|
+
on.appOpenAd.show
|
261
|
+
on.appOpenAd.revenue
|
262
|
+
<br>
|
263
|
+
</pre>
|
264
|
+
<li>example:</li></ul>
|
265
|
+
<pre>
|
163
266
|
document.addEventListener('on.appOpenAd.loaded', () => {
|
164
267
|
|
165
|
-
|
268
|
+
console.log("On App Open Ad loaded");
|
166
269
|
|
167
270
|
});
|
271
|
+
</pre>
|
272
|
+
</details>
|
168
273
|
|
169
|
-
|
274
|
+
- [FULL AppOpenAd basic:](https://github.com/EMI-INDO/emi-indo-cordova-plugin-admob/blob/main/example/app_open_ads.html) -index.html
|
170
275
|
|
171
|
-
> __Note__
|
172
|
-
### (final) cannot be changed.
|
173
276
|
|
174
|
-
## ( SDK )
|
175
|
-
- on.sdkInitialization
|
176
277
|
|
177
|
-
|
278
|
+
|
279
|
+
## BANNER ADS
|
280
|
+
|
281
|
+
<details>
|
282
|
+
<summary>Methods:</summary>
|
283
|
+
<pre>
|
284
|
+
cordova.plugins.emiAdmobPlugin.loadBannerAd([bannerConfig]);
|
285
|
+
cordova.plugins.emiAdmobPlugin.showBannerAd();
|
286
|
+
cordova.plugins.emiAdmobPlugin.hideBannerAd();
|
287
|
+
cordova.plugins.emiAdmobPlugin.removeBannerAd();
|
288
|
+
</pre>
|
289
|
+
<li>example:</li></ul>
|
290
|
+
<pre>
|
291
|
+
// WARNING config must be an array[] not an object{}
|
292
|
+
// adUnitId = call Global Variable
|
293
|
+
|
294
|
+
const bannerConfig = [
|
295
|
+
|
296
|
+
adUnitId = Banner_ID,
|
297
|
+
position = "bottom-center",
|
298
|
+
size = "BANNER",
|
299
|
+
collapsible = "bottom", // (BETA) enable in globalSettings
|
300
|
+
adaptive_Width = 320, // Ignored
|
301
|
+
autoShow = true // boolean
|
302
|
+
|
303
|
+
]
|
304
|
+
|
305
|
+
cordova.plugins.emiAdmobPlugin.loadBannerAd(bannerConfig);
|
306
|
+
|
307
|
+
</pre>
|
308
|
+
</details>
|
309
|
+
|
310
|
+
<details>
|
311
|
+
<summary>Position type string</summary>
|
312
|
+
<pre>
|
313
|
+
top-right
|
314
|
+
top-center
|
315
|
+
left
|
316
|
+
center
|
317
|
+
right
|
318
|
+
bottom-center
|
319
|
+
bottom-right
|
320
|
+
</pre>
|
321
|
+
</details>
|
322
|
+
|
323
|
+
<details>
|
324
|
+
<summary>Size type string</summary>
|
325
|
+
<pre>
|
326
|
+
ANCHORED
|
327
|
+
IN_LINE
|
328
|
+
FULL_WIDTH
|
329
|
+
BANNER
|
330
|
+
FLUID
|
331
|
+
LARGE_BANNER
|
332
|
+
MEDIUM_RECTANGLE
|
333
|
+
FULL_BANNER
|
334
|
+
LEADERBOARD
|
335
|
+
adaptive_Width = number
|
336
|
+
</pre>
|
337
|
+
</details>
|
338
|
+
|
339
|
+
<details>
|
340
|
+
<summary>Event</summary>
|
341
|
+
<pre>
|
342
|
+
on.banner.load
|
343
|
+
on.banner.failed.load
|
344
|
+
on.banner.click
|
345
|
+
on.banner.close
|
346
|
+
on.banner.impression
|
347
|
+
on.banner.open
|
348
|
+
// new
|
349
|
+
on.banner.revenue
|
350
|
+
on.banner.remove
|
351
|
+
on.banner.hide
|
352
|
+
</pre>
|
353
|
+
<li>example:</li></ul>
|
354
|
+
<pre>
|
355
|
+
document.addEventListener('on.banner.load', () => {
|
356
|
+
|
357
|
+
console.log("on banner load");
|
358
|
+
|
359
|
+
});</pre>
|
360
|
+
</details>
|
361
|
+
|
362
|
+
[FULL Banner basic:](https://github.com/EMI-INDO/emi-indo-cordova-plugin-admob/blob/main/example/banner_ads.html) index.html
|
363
|
+
|
364
|
+
|
365
|
+
## Interstitial ADS
|
366
|
+
|
367
|
+
|
368
|
+
<details>
|
369
|
+
<summary>Methods:</summary>
|
370
|
+
<pre>
|
371
|
+
// Support Platform: Android | IOS
|
372
|
+
cordova.plugins.emiAdmobPlugin.loadInterstitialAd([config_Interstitial]);
|
373
|
+
cordova.plugins.emiAdmobPlugin.showInterstitialAd();
|
374
|
+
<br>
|
375
|
+
</pre>
|
376
|
+
<li>example:</li></ul>
|
377
|
+
<pre>
|
378
|
+
|
379
|
+
// WARNING config must be an array[] not an object{}
|
380
|
+
// adUnitId = call Global Variable
|
381
|
+
|
382
|
+
cordova.plugins.emiAdmobPlugin.loadInterstitialAd([ adUnitId = Interstitial_ID, autoShow = true ]);
|
383
|
+
</pre>
|
384
|
+
</details>
|
385
|
+
|
386
|
+
<details>
|
387
|
+
<summary>Event</summary>
|
388
|
+
<pre>
|
389
|
+
on.interstitial.loaded
|
390
|
+
on.interstitial.failed.load
|
391
|
+
on.interstitial.click
|
392
|
+
on.interstitial.dismissed
|
393
|
+
on.interstitial.failed.show
|
394
|
+
on.interstitial.impression
|
395
|
+
on.interstitial.show
|
396
|
+
// new
|
397
|
+
on.interstitial.revenue
|
398
|
+
<br>
|
399
|
+
</pre>
|
400
|
+
<li>example:</li></ul>
|
401
|
+
<pre>
|
402
|
+
document.addEventListener('on.interstitial.loaded', () => {
|
403
|
+
|
404
|
+
console.log("on interstitial Ad loaded");
|
178
405
|
|
179
|
-
|
406
|
+
});
|
407
|
+
</pre>
|
408
|
+
</details>
|
180
409
|
|
181
|
-
- on.appOpenAd.loaded
|
182
|
-
- on.appOpenAd.failed.loaded
|
183
410
|
|
184
|
-
|
411
|
+
[FULL Interstitial basic:](https://github.com/EMI-INDO/emi-indo-cordova-plugin-admob/blob/main/example/interstitial_ads.html) index.html
|
185
412
|
|
186
|
-
- on.appOpenAd.dismissed
|
187
|
-
- on.appOpenAd.failed.show
|
188
|
-
- on.appOpenAd.show
|
189
|
-
### NEW
|
190
|
-
- on.appOpenAd.revenue
|
191
413
|
|
192
414
|
|
193
|
-
## ( Banner Ads )
|
194
415
|
|
195
|
-
|
416
|
+
## Rewarded Interstitial ADS
|
196
417
|
|
197
|
-
- top-right
|
198
|
-
- top-center
|
199
|
-
- left
|
200
|
-
- center
|
201
|
-
- right
|
202
|
-
- bottom-center
|
203
|
-
- bottom-right
|
204
418
|
|
205
419
|
|
420
|
+
<details>
|
421
|
+
<summary>Methods:</summary>
|
422
|
+
<pre>
|
423
|
+
// Support Platform: Android | IOS
|
424
|
+
cordova.plugins.emiAdmobPlugin.loadRewardedInterstitialAd([config_rewardedInt]);
|
425
|
+
cordova.plugins.emiAdmobPlugin.showRewardedInterstitialAd();
|
426
|
+
<br>
|
427
|
+
</pre>
|
428
|
+
<li>example:</li></ul>
|
429
|
+
<pre>
|
206
430
|
|
207
|
-
|
431
|
+
// WARNING config must be an array[] not an object{}
|
432
|
+
// adUnitId = call Global Variable
|
208
433
|
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
- FLUID
|
213
|
-
- LARGE_BANNER
|
214
|
-
- MEDIUM_RECTANGLE
|
215
|
-
- FULL_BANNER
|
216
|
-
- LEADERBOARD
|
217
|
-
- adaptiveWidth = number
|
218
|
-
- Smart Banners = DEPRECATED
|
219
|
-
- default: FULL_WIDTH
|
434
|
+
cordova.plugins.emiAdmobPlugin.loadRewardedInterstitialAd([ adUnitId = Rewarded_Interstitial_ID, autoShow = true ]);
|
435
|
+
</pre>
|
436
|
+
</details>
|
220
437
|
|
221
|
-
|
438
|
+
<details>
|
439
|
+
<summary>Event</summary>
|
440
|
+
<pre>
|
441
|
+
on.rewardedInt.loaded
|
442
|
+
on.rewardedInt.failed.load
|
443
|
+
on.rewardedInt.click
|
444
|
+
on.rewardedInt.dismissed
|
445
|
+
on.rewardedInt.failed.show
|
446
|
+
on.rewardedInt.impression
|
447
|
+
on.rewardedInt.showed
|
448
|
+
on.rewardedInt.userEarnedReward
|
449
|
+
// new
|
450
|
+
on.rewardedInt.revenue
|
451
|
+
on.rewardedInt.ad.skip
|
452
|
+
<br>
|
453
|
+
</pre>
|
454
|
+
<li>example:</li></ul>
|
455
|
+
<pre>
|
456
|
+
document.addEventListener('on.rewardedInt.loaded', () => {
|
222
457
|
|
458
|
+
console.log("on rewarded Interstitial load");
|
223
459
|
|
224
|
-
|
460
|
+
});
|
461
|
+
</pre>
|
462
|
+
</details>
|
225
463
|
|
226
|
-
-
|
227
|
-
- on.banner.failed.load
|
464
|
+
[FULL Rewarded Interstitial basic:](https://github.com/EMI-INDO/emi-indo-cordova-plugin-admob/blob/main/example/rewarded_interstitial_ads.html) index.html
|
228
465
|
|
229
|
-
### Event Show
|
230
466
|
|
231
|
-
- on.banner.click
|
232
|
-
- on.banner.close
|
233
|
-
- on.banner.impression
|
234
|
-
- on.banner.open
|
235
|
-
### NEW
|
236
|
-
- on.banner.revenue
|
237
|
-
- on.banner.remove
|
238
|
-
|
239
467
|
|
468
|
+
## Rewarded ADS
|
240
469
|
|
241
470
|
|
242
|
-
## ( Interstitial Ads )
|
243
471
|
|
244
|
-
|
472
|
+
<details>
|
473
|
+
<summary>Methods:</summary>
|
474
|
+
<pre>
|
475
|
+
// Support Platform: Android | IOS
|
476
|
+
cordova.plugins.emiAdmobPlugin.loadRewardedAd([config_rewarded]);
|
477
|
+
cordova.plugins.emiAdmobPlugin.showRewardedAd();
|
478
|
+
<br>
|
479
|
+
</pre>
|
480
|
+
<li>example:</li></ul>
|
481
|
+
<pre>
|
482
|
+
// adUnitId = call Global Variable
|
245
483
|
|
246
|
-
|
247
|
-
|
484
|
+
cordova.plugins.emiAdmobPlugin.loadRewardedAd([ adUnitId = Rewarded_ID, autoShow = true ]);
|
485
|
+
</pre>
|
486
|
+
</details>
|
248
487
|
|
249
|
-
|
488
|
+
<details>
|
489
|
+
<summary>Event</summary>
|
490
|
+
<pre>
|
491
|
+
on.rewarded.loaded
|
492
|
+
on.rewarded.failed.load
|
493
|
+
on.rewarded.click
|
494
|
+
on.rewarded.dismissed
|
495
|
+
on.rewarded.failed.show
|
496
|
+
on.rewarded.impression
|
497
|
+
on.rewarded.show
|
498
|
+
on.reward.userEarnedReward
|
499
|
+
// new
|
500
|
+
on.rewarded.revenue
|
501
|
+
on.rewarded.ad.skip
|
250
502
|
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
### NEW
|
257
|
-
- on.interstitial.revenue
|
503
|
+
<br>
|
504
|
+
</pre>
|
505
|
+
<li>example:</li></ul>
|
506
|
+
<pre>
|
507
|
+
document.addEventListener('on.rewarded.loaded', () => {
|
258
508
|
|
509
|
+
console.log("on rewarded Ad loaded");
|
259
510
|
|
511
|
+
});
|
512
|
+
</pre>
|
513
|
+
</details>
|
260
514
|
|
515
|
+
[FULL Rewarded basic:](https://github.com/EMI-INDO/emi-indo-cordova-plugin-admob/blob/main/example/rewarded_ads.html) index.html
|
261
516
|
|
262
517
|
|
263
|
-
## ( Rewarded Ads )
|
264
518
|
|
265
|
-
### Event Load
|
266
519
|
|
267
|
-
- on.rewarded.loaded
|
268
|
-
- on.rewarded.failed.load
|
269
520
|
|
270
521
|
|
271
|
-
### Event Show
|
272
522
|
|
273
|
-
- on.rewarded.click
|
274
|
-
- on.rewarded.dismissed
|
275
|
-
- on.rewarded.failed.show
|
276
|
-
- on.rewarded.impression
|
277
|
-
- on.rewarded.show
|
278
|
-
### NEW
|
279
|
-
- on.rewarded.revenue
|
280
|
-
- on.rewarded.ad.skip
|
281
|
-
- on.reward.userEarnedReward
|
282
523
|
|
283
524
|
|
284
525
|
|
285
|
-
## ( Rewarded interstitial Ads )
|
286
526
|
|
287
|
-
### Event Load
|
288
527
|
|
289
|
-
- on.rewardedInt.loaded
|
290
|
-
- on.rewardedInt.failed.load
|
291
528
|
|
292
529
|
|
293
|
-
### Event Show
|
294
530
|
|
295
|
-
|
296
|
-
|
297
|
-
- on.rewardedInt.failed.show
|
298
|
-
- on.rewardedInt.impression
|
299
|
-
- on.rewardedInt.showed
|
300
|
-
### NEW
|
301
|
-
- on.rewardedInt.revenue
|
302
|
-
- on.rewardedInt.ad.skip
|
303
|
-
- on.rewardedInt.userEarnedReward
|
531
|
+
<details>
|
532
|
+
<summary>Features and Coming soon #13</summary>
|
304
533
|
|
534
|
+
## Features
|
305
535
|
|
536
|
+
- SDK initialize
|
537
|
+
- targeting
|
538
|
+
- globalSettings
|
539
|
+
- App Open Ads
|
540
|
+
- Banner Ads
|
541
|
+
- Interstitial Ads
|
542
|
+
- Rewarded Ads
|
543
|
+
- Rewarded interstitial Ads
|
544
|
+
- [Consent](https://github.com/EMI-INDO/emi-indo-cordova-plugin-admob/blob/main/example/Advanced%20topics/consent.html)
|
545
|
+
- Mediation
|
546
|
+
- impression-level-ad-revenue
|
547
|
+
- GDPR IAB TFCv2.2
|
548
|
+
- AppTrackingTransparency (ATT)
|
549
|
+
- Collapsible banner ads (BETA)
|
306
550
|
|
551
|
+
## Coming soon
|
552
|
+
- App Open Ads ( Finished )
|
553
|
+
- User Consent ( Finished )
|
554
|
+
- Mediation ( Finished )
|
555
|
+
- https://developers.google.com/admob/android/native/start
|
556
|
+
- https://developers.google.com/admob/android/impression-level-ad-revenue ( Finished ) v1.1.9
|
557
|
+
- https://developers.google.com/admob/android/ssv
|
558
|
+
- https://developers.google.com/admob/android/privacy/gdpr ( Finished ) v1.4.0 [index.html](https://github.com/EMI-INDO/emi-indo-cordova-plugin-admob/blob/main/example/Advanced%20topics/consent_GDPR_IAB_TFCv2.2.html)
|
559
|
+
- https://github.com/InteractiveAdvertisingBureau/GDPR-Transparency-and-Consent-Framework/ ( Finished ) v1.4.0 [index.html](https://github.com/EMI-INDO/emi-indo-cordova-plugin-admob/blob/main/example/Advanced%20topics/consent_GDPR_IAB_TFCv2.2.html)
|
307
560
|
|
308
|
-
## Response Info
|
309
|
-
- Here is a sample output returned by responseInfo = true showing the debugging data returned for a loaded ad:
|
310
561
|
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
"Ad Source Instance ID": "4665218928925097",
|
334
|
-
"Credentials": {},
|
335
|
-
"Ad Error": "null"
|
336
|
-
},
|
337
|
-
"Response Extras": {
|
338
|
-
"mediation_group_name": "Campaign"
|
339
|
-
}
|
340
|
-
}
|
562
|
+
</details>
|
563
|
+
|
564
|
+
|
565
|
+
|
566
|
+
|
567
|
+
|
568
|
+
# IAB Europe Transparency & Consent Framework
|
569
|
+
|
570
|
+
<details>
|
571
|
+
<summary>Example How to read consent choices #12</summary>
|
572
|
+
|
573
|
+
// index.html https://github.com/EMI-INDO/emi-indo-cordova-plugin-admob/blob/main/example/Advanced%20topics/consent_GDPR_IAB_TFCv2.2.html
|
574
|
+
```sh
|
575
|
+
// >>>>>>>> New features (UMP) SDK v2.1.0
|
576
|
+
// https://developers.google.com/admob/android/privacy/gdpr
|
577
|
+
/*
|
578
|
+
If the user chooses not to display ads,
|
579
|
+
you can restrict access to the app, or ban it,
|
580
|
+
until they change their decision back,
|
581
|
+
Just call showPrivacyOptionsForm();
|
582
|
+
*/
|
583
|
+
|
341
584
|
|
585
|
+
cordova.plugins.emiAdmobPlugin.getIabTfc(
|
586
|
+
(info) => {
|
587
|
+
// How to read consent choices
|
588
|
+
console.log("IABTCF_gdprApplies: " + info.IABTCF_gdprApplies);
|
589
|
+
console.log("IABTCF_PurposeConsents: " + info.IABTCF_PurposeConsents);
|
590
|
+
console.log("IABTCF_TCString: " + info.IABTCF_TCString);
|
342
591
|
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
592
|
+
// A small example
|
593
|
+
var fundingChoices;
|
594
|
+
|
595
|
+
fundingChoices = info.IABTCF_PurposeConsents;
|
596
|
+
if (fundingChoices === "1111111111"){
|
597
|
+
|
598
|
+
// Enable app features.
|
599
|
+
loadRewardedAd();
|
600
|
+
|
601
|
+
} else if (fundingChoices === "") {
|
602
|
+
|
603
|
+
// disable app features.
|
604
|
+
|
605
|
+
} else {
|
606
|
+
|
607
|
+
// You have to test everything yourself.
|
608
|
+
console.log(info);
|
609
|
+
|
610
|
+
}
|
611
|
+
|
612
|
+
},
|
613
|
+
(error) => {
|
614
|
+
console.log("Error: " + error);
|
615
|
+
|
616
|
+
});
|
347
617
|
|
618
|
+
|
348
619
|
|
349
620
|
```
|
350
621
|
|
622
|
+
</details>
|
351
623
|
|
352
624
|
|
353
625
|
|
354
626
|
# Admob Mediation
|
627
|
+
|
628
|
+
<details>
|
629
|
+
<summary>Mediation #9</summary>
|
630
|
+
|
631
|
+
|
632
|
+
|
355
633
|
<img src="https://user-images.githubusercontent.com/78555833/229587307-91a7e380-aa2d-4140-a62d-fa8e6a8dd153.png" width="500">
|
356
634
|
|
357
635
|
|
@@ -426,10 +704,16 @@ cordova plugin add emi-indo-cordova-plugin-mediation-chartboost
|
|
426
704
|
```sh
|
427
705
|
cordova plugin add emi-indo-cordova-plugin-mediation-ironsource
|
428
706
|
```
|
707
|
+
</details>
|
429
708
|
|
430
709
|
|
431
710
|
|
432
711
|
## Variables name or preference name
|
712
|
+
|
713
|
+
<details>
|
714
|
+
<summary>Variables name #10</summary>
|
715
|
+
|
716
|
+
|
433
717
|
> __Warning__
|
434
718
|
> This is so that if I don't have time to update the Mediation Adapter version later, you can do it yourself as below.
|
435
719
|
|
@@ -461,24 +745,10 @@ cordova plugin add emi-indo-cordova-plugin-mediation-meta --variable META_ADAPTE
|
|
461
745
|
- IRONSOURCE_ADAPTER_VERSION
|
462
746
|
|
463
747
|
- ================================
|
748
|
+
</details>
|
464
749
|
|
465
750
|
|
466
|
-
emi-indo-cordova-plugin-admob@0.0.5
|
467
751
|
|
468
|
-
|
469
|
-
> - ## Note Release
|
470
|
-
- [emi-indo-cordova-plugin-admob@0.0.4](https://github.com/EMI-INDO/emi-indo-cordova-plugin-admob/releases/tag/%400.0.4)
|
471
|
-
|
472
|
-
- [emi-indo-cordova-plugin-admob@0.0.5](https://github.com/EMI-INDO/emi-indo-cordova-plugin-admob/releases/tag/v0.0.5)
|
473
|
-
|
474
|
-
<img src="https://user-images.githubusercontent.com/78555833/231241800-8834ca2a-fa95-4cc2-91ca-1478c6b3c1ef.jpg" width="250">
|
475
|
-
|
476
|
-
- [emi-indo-cordova-plugin-admob@0.0.6](https://github.com/EMI-INDO/emi-indo-cordova-plugin-admob/releases/tag/v0.0.6)
|
477
|
-
|
478
|
-
|
479
|
-
### Platform Support
|
480
|
-
- Android
|
481
|
-
- IOS
|
482
752
|
|
483
753
|
|
484
754
|
## 💰Sponsor this project
|
@@ -486,6 +756,10 @@ emi-indo-cordova-plugin-admob@0.0.5
|
|
486
756
|
|
487
757
|
|
488
758
|
## Earn more money, with other ad networks.
|
759
|
+
|
760
|
+
<details>
|
761
|
+
<summary>Other plugins #11</summary>
|
762
|
+
|
489
763
|
- ### emi-indo-cordova-plugin-fan
|
490
764
|
|
491
765
|
[Facebook Audience Network:](https://github.com/EMI-INDO/emi-indo-cordova-plugin-fan) - Ads:
|
@@ -506,4 +780,4 @@ emi-indo-cordova-plugin-admob@0.0.5
|
|
506
780
|
- ### emi-indo-cordova-plugin-fanalytics
|
507
781
|
|
508
782
|
[Cordova Plugin Firebase Analytics:](https://github.com/EMI-INDO/emi-indo-cordova-plugin-fanalytics) - Firebase Analytics:
|
509
|
-
|
783
|
+
</details>
|