emi-indo-cordova-plugin-admob 1.4.1 → 1.4.3
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 +220 -159
- 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 +60 -109
- package/example/interstitial_ads.html +28 -44
- package/example/rewarded_ads.html +29 -45
- package/example/rewarded_interstitial_ads.html +27 -44
- package/package.json +1 -2
- package/plugin.xml +3 -3
- package/src/android/emiAdmobPlugin.java +1 -1
- package/src/ios/emiAdmobPlugin.h +4 -2
- package/src/ios/emiAdmobPlugin.m +451 -482
- package/www/emiAdmobPlugin.js +21 -27
- package/example/Advanced topics/auto_load_and_show.html +0 -94
package/README.md
CHANGED
@@ -1,58 +1,21 @@
|
|
1
1
|
# emi-indo-cordova-plugin-admob
|
2
2
|
Cordova Plugin Admob Android and IOS
|
3
3
|
|
4
|
-
### Mobile Ads SDK (Android: 22.
|
5
|
-
|
6
|
-
### Mobile Ads SDK (IOS: 10.3.0) [Release Notes:](https://developers.google.com/admob/ios/rel-notes)
|
7
|
-
|
8
|
-
### [Documentation for IOS](https://github.com/EMI-INDO/emi-indo-cordova-plugin-admob/discussions/3)
|
9
|
-
|
10
|
-
-
|
11
|
-
|
12
|
-
|
13
|
-
> __Note__
|
14
|
-
> - ## It's Not a fork, it's purely rewritten, clean of 3rd party code.
|
15
|
-
|
16
|
-
> __Note__
|
17
|
-
> - ### No Ad-Sharing
|
18
|
-
> - ### No Remote Control
|
19
|
-
> - ### I guarantee 100% revenue for you.
|
20
|
-
> - [Code source:](https://github.com/googleads/googleads-mobile-android-examples) - Admob:
|
21
|
-
|
22
|
-
|
23
|
-
## 💰Sponsor this project
|
24
|
-
[](https://paypal.me/emiindo)
|
25
|
-
|
26
|
-
## [Check all release notes:](https://github.com/EMI-INDO/emi-indo-cordova-plugin-admob/releases/)
|
4
|
+
### Mobile Ads SDK (Android: 22.6.0) [Release Notes:](https://developers.google.com/admob/android/rel-notes)
|
27
5
|
|
6
|
+
### Mobile Ads SDK (IOS: 10.14.0) [Release Notes:](https://developers.google.com/admob/ios/rel-notes)
|
28
7
|
|
29
8
|
## Minimum Cordova Engines
|
30
|
-
- cordova version =
|
31
|
-
- cordova-
|
32
|
-
- cordova-ios version = 6.0.0
|
9
|
+
- cordova-android version = 12.0.0
|
10
|
+
- cordova-ios version = 7.0.0
|
33
11
|
|
34
|
-
## Features
|
35
|
-
|
36
|
-
- SDK initialize
|
37
|
-
- targeting
|
38
|
-
- globalSettings
|
39
|
-
- App Open Ads
|
40
|
-
- Banner Ads
|
41
|
-
- Interstitial Ads
|
42
|
-
- Rewarded Ads
|
43
|
-
- Rewarded interstitial Ads
|
44
|
-
- [Consent](https://github.com/EMI-INDO/emi-indo-cordova-plugin-admob/blob/main/example/Advanced%20topics/consent_GDPR_IAB_TFCv2.2.html)
|
45
|
-
- Mediation
|
46
12
|
|
47
|
-
|
48
|
-
-
|
49
|
-
-
|
50
|
-
-
|
51
|
-
-
|
52
|
-
|
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)
|
13
|
+
## Minimum macOS | Xcode, and others
|
14
|
+
- Monterey
|
15
|
+
- Xcode 14.1 or higher
|
16
|
+
- Command Line Tools 14.1 or higher
|
17
|
+
- Target iOS 11.0 or higher
|
18
|
+
https://developers.google.com/admob/ios/quick-start
|
56
19
|
|
57
20
|
|
58
21
|
|
@@ -60,100 +23,112 @@
|
|
60
23
|
## Installation
|
61
24
|
|
62
25
|
```sh
|
63
|
-
cordova plugin add emi-indo-cordova-plugin-admob --variable APP_ID_ANDROID=ca-app-pub-
|
26
|
+
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
27
|
```
|
65
28
|
### Or
|
66
29
|
```sh
|
67
|
-
cordova plugin add https://github.com/EMI-INDO/emi-indo-cordova-plugin-admob --variable APP_ID_ANDROID=ca-app-pub-
|
30
|
+
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
31
|
```
|
69
32
|
## Remove
|
70
33
|
```sh
|
71
34
|
cordova plugin rm emi-indo-cordova-plugin-admob
|
72
35
|
```
|
73
36
|
|
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
37
|
|
80
38
|
|
39
|
+
## Import the Mobile Ads SDK
|
40
|
+
### Then from the command line run:
|
41
|
+
- cd platforms/ios
|
42
|
+
### Then from the command line run:
|
43
|
+
- pod install --repo-update
|
81
44
|
|
82
|
-
> __Note__
|
83
|
-
>
|
84
45
|
|
85
|
-
> - # Plugin version @1.4.0
|
86
46
|
|
87
|
-
|
88
|
-
- replace all AdUnitId to adUnitId
|
89
|
-
- new banner size: FULL_WIDTH
|
47
|
+
# >>>>>> Device Ready <<<<<<
|
90
48
|
|
91
|
-
|
49
|
+
- [AppTrackingTransparency (ATT) framework:](https://developer.apple.com/documentation/apptrackingtransparency/attrackingmanager/authorizationstatus)
|
50
|
+
- [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)
|
92
51
|
|
93
|
-
|
52
|
+
- [Example Get Consent Status:](https://github.com/EMI-INDO/emi-indo-cordova-plugin-admob/blob/main/example/Advanced%20topics/consent.html) index.html
|
53
|
+
- [Example requestIDFA:](https://github.com/EMI-INDO/emi-indo-cordova-plugin-admob/blob/main/example/Advanced%20topics/requestIDFA.html) index.html
|
54
|
+
- [Example IABTFC:](https://github.com/EMI-INDO/emi-indo-cordova-plugin-admob/blob/main/example/Advanced%20topics/IABTFC.html) index.html
|
55
|
+
```
|
56
|
+
// Support Platform: Android or IOS
|
57
|
+
<script>
|
58
|
+
cordova.plugins.emiAdmobPlugin.globalSettings([config_globalSettings]);
|
59
|
+
cordova.plugins.emiAdmobPlugin.targeting([config_Targeting]);
|
60
|
+
cordova.plugins.emiAdmobPlugin.initialize();
|
61
|
+
|
62
|
+
/*
|
63
|
+
cordova.plugins.emiAdmobPlugin.requestIDFA(); // UMP SDK to handle Apple's App Tracking Transparency (ATT) (Platform: IOS)
|
64
|
+
cordova.plugins.emiAdmobPlugin.getIabTfc((IABTFC) => {JSONstringify(IABTFC)}); // CMP SDK 2.2 (Platform: Both)
|
65
|
+
|
66
|
+
// UMP SDK 2.1.0
|
67
|
+
cordova.plugins.emiAdmobPlugin.getConsentRequest(); // (Platform: Both)
|
68
|
+
cordova.plugins.emiAdmobPlugin.consentReset(); // (Platform: Both)
|
69
|
+
cordova.plugins.emiAdmobPlugin.showPrivacyOptionsForm(); // (Platform: Both)
|
70
|
+
*/
|
71
|
+
</script>
|
72
|
+
```
|
94
73
|
|
95
|
-
|
74
|
+
### AppOpenAd ADS
|
75
|
+
[FULL AppOpenAd basic:](https://github.com/EMI-INDO/emi-indo-cordova-plugin-admob/blob/main/example/app_open_ads.html) index.html
|
76
|
+
```
|
77
|
+
<script>
|
78
|
+
// Support Platform: Android | IOS
|
79
|
+
cordova.plugins.emiAdmobPlugin.loadAppOpenAd([config_AppOpenAd]);
|
80
|
+
cordova.plugins.emiAdmobPlugin.showAppOpenAd();
|
81
|
+
</script>
|
82
|
+
```
|
96
83
|
|
97
|
-
### [ App Open Ad code example: ](https://github.com/EMI-INDO/emi-indo-cordova-plugin-admob/blob/main/example/app_open_ads.html)
|
98
|
-
### [ Banner Ad code example: ](https://github.com/EMI-INDO/emi-indo-cordova-plugin-admob/blob/main/example/banner_ads.html)
|
99
|
-
### [ Interstitial Ad code example: ](https://github.com/EMI-INDO/emi-indo-cordova-plugin-admob/blob/main/example/interstitial_ads.html)
|
100
|
-
### [ Rewarded interstitial Ad code example: ](https://github.com/EMI-INDO/emi-indo-cordova-plugin-admob/blob/main/example/rewarded_interstitial_ads.html)
|
101
|
-
### [ Rewarded Ad code example: ](https://github.com/EMI-INDO/emi-indo-cordova-plugin-admob/blob/main/example/rewarded_ads.html)
|
102
84
|
|
103
|
-
###
|
85
|
+
### BANNER ADS
|
86
|
+
[FULL Banner basic:](https://github.com/EMI-INDO/emi-indo-cordova-plugin-admob/blob/main/example/banner_ads.html) index.html
|
87
|
+
```
|
88
|
+
// Support Platform: Android | IOS
|
89
|
+
<script>
|
90
|
+
cordova.plugins.emiAdmobPlugin.loadBannerAd([bannerConfig]);
|
91
|
+
cordova.plugins.emiAdmobPlugin.showBannerAd();
|
92
|
+
cordova.plugins.emiAdmobPlugin.hideBannerAd();
|
93
|
+
cordova.plugins.emiAdmobPlugin.removeBannerAd();
|
94
|
+
</script>
|
95
|
+
```
|
104
96
|
|
105
|
-
|
106
|
-
|
97
|
+
### Interstitial ADS
|
98
|
+
[FULL Interstitial basic:](https://github.com/EMI-INDO/emi-indo-cordova-plugin-admob/blob/main/example/interstitial_ads.html) index.html
|
99
|
+
```
|
100
|
+
// Support Platform: Android | IOS
|
101
|
+
<script>
|
102
|
+
cordova.plugins.emiAdmobPlugin.loadInterstitialAd([config_Interstitial]);
|
103
|
+
cordova.plugins.emiAdmobPlugin.showInterstitialAd();
|
104
|
+
</script>
|
105
|
+
```
|
107
106
|
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
107
|
+
|
108
|
+
### Rewarded Interstitial ADS
|
109
|
+
[FULL Rewarded Interstitial basic:](https://github.com/EMI-INDO/emi-indo-cordova-plugin-admob/blob/main/example/rewarded_interstitial_ads.html) index.html
|
110
|
+
```
|
111
|
+
// Support Platform: Android | IOS
|
112
|
+
<script>
|
113
|
+
cordova.plugins.emiAdmobPlugin.loadRewardedInterstitialAd([config_rewardedInt]);
|
114
|
+
cordova.plugins.emiAdmobPlugin.showRewardedInterstitialAd();
|
115
|
+
</script>
|
116
|
+
```
|
117
|
+
|
118
|
+
### Rewarded ADS
|
119
|
+
[FULL Rewarded basic:](https://github.com/EMI-INDO/emi-indo-cordova-plugin-admob/blob/main/example/rewarded_ads.html) index.html
|
120
|
+
```
|
121
|
+
// Support Platform: Android | IOS
|
122
|
+
<script>
|
123
|
+
cordova.plugins.emiAdmobPlugin.loadRewardedAd([config_rewarded]);
|
124
|
+
cordova.plugins.emiAdmobPlugin.showRewardedAd();
|
125
|
+
</script>
|
126
|
+
```
|
119
127
|
|
120
128
|
|
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
129
|
|
128
|
-
// A small example
|
129
|
-
var fundingChoices;
|
130
|
-
|
131
|
-
fundingChoices = info.IABTCF_PurposeConsents;
|
132
|
-
if (fundingChoices === "1111111111"){
|
133
|
-
|
134
|
-
// Enable app features.
|
135
|
-
loadRewardedAd();
|
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
|
-
});
|
153
130
|
|
154
|
-
|
155
131
|
|
156
|
-
```
|
157
132
|
|
158
133
|
|
159
134
|
# Event | callback:
|
@@ -206,19 +181,17 @@ alert("On App Open Ad loaded");
|
|
206
181
|
|
207
182
|
### size
|
208
183
|
|
209
|
-
-
|
210
|
-
-
|
184
|
+
- ANCHORED
|
185
|
+
- IN_LINE
|
186
|
+
- FULL_WIDTH
|
211
187
|
- BANNER
|
212
188
|
- FLUID
|
213
189
|
- LARGE_BANNER
|
214
190
|
- MEDIUM_RECTANGLE
|
215
191
|
- FULL_BANNER
|
216
192
|
- LEADERBOARD
|
217
|
-
-
|
193
|
+
- adaptive_Width = number
|
218
194
|
- Smart Banners = DEPRECATED
|
219
|
-
- default: FULL_WIDTH
|
220
|
-
|
221
|
-
Note: Smart Banners = DEPRECATED ( Replaced by Adaptive_FULL_WIDTH )
|
222
195
|
|
223
196
|
|
224
197
|
### Event Load
|
@@ -235,6 +208,7 @@ Note: Smart Banners = DEPRECATED ( Replaced by Adaptive_FULL_WIDTH )
|
|
235
208
|
### NEW
|
236
209
|
- on.banner.revenue
|
237
210
|
- on.banner.remove
|
211
|
+
- on.banner.hide
|
238
212
|
|
239
213
|
|
240
214
|
|
@@ -305,52 +279,139 @@ Note: Smart Banners = DEPRECATED ( Replaced by Adaptive_FULL_WIDTH )
|
|
305
279
|
|
306
280
|
|
307
281
|
|
308
|
-
## Response Info
|
309
|
-
- Here is a sample output returned by responseInfo = true showing the debugging data returned for a loaded ad:
|
310
282
|
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
283
|
+
> __Note__
|
284
|
+
> - ## It's Not a fork, it's purely rewritten, clean of 3rd party code.
|
285
|
+
|
286
|
+
> __Note__
|
287
|
+
> - ### No Ad-Sharing
|
288
|
+
> - ### No Remote Control
|
289
|
+
> - ### I guarantee 100% revenue for you.
|
290
|
+
> - [Code source:](https://github.com/googleads/googleads-mobile-android-examples) - Admob:
|
291
|
+
|
292
|
+
|
293
|
+
## 💰Sponsor this project
|
294
|
+
[](https://paypal.me/emiindo)
|
295
|
+
|
296
|
+
## [Check all release notes:](https://github.com/EMI-INDO/emi-indo-cordova-plugin-admob/releases/)
|
297
|
+
|
298
|
+
|
299
|
+
|
300
|
+
|
301
|
+
## Features
|
302
|
+
|
303
|
+
- SDK initialize
|
304
|
+
- targeting
|
305
|
+
- globalSettings
|
306
|
+
- App Open Ads
|
307
|
+
- Banner Ads
|
308
|
+
- Interstitial Ads
|
309
|
+
- Rewarded Ads
|
310
|
+
- Rewarded interstitial Ads
|
311
|
+
- [Consent](https://github.com/EMI-INDO/emi-indo-cordova-plugin-admob/blob/main/example/Advanced%20topics/consent.html)
|
312
|
+
- Mediation
|
313
|
+
- impression-level-ad-revenue
|
314
|
+
- GDPR IAB TFCv2.2
|
315
|
+
- AppTrackingTransparency (ATT)
|
316
|
+
- Collapsible banner ads (BETA)
|
317
|
+
|
318
|
+
## Coming soon
|
319
|
+
- App Open Ads ( Finished )
|
320
|
+
- User Consent ( Finished )
|
321
|
+
- Mediation ( Finished )
|
322
|
+
- https://developers.google.com/admob/android/native/start
|
323
|
+
- https://developers.google.com/admob/android/impression-level-ad-revenue ( Finished ) v1.1.9
|
324
|
+
- https://developers.google.com/admob/android/ssv
|
325
|
+
- 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)
|
326
|
+
- 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)
|
327
|
+
|
328
|
+
|
329
|
+
|
330
|
+
|
331
|
+
|
332
|
+
|
333
|
+
|
334
|
+
|
335
|
+
> __Note__
|
336
|
+
>
|
337
|
+
|
338
|
+
> - # Plugin version @1.4.0
|
339
|
+
|
340
|
+
### [ GDPR | IAB TFC code example: ](https://github.com/EMI-INDO/emi-indo-cordova-plugin-admob/blob/main/example/Advanced%20topics/consent_GDPR_IAB_TFCv2.2.html)
|
341
|
+
- replace all AdUnitId to adUnitId
|
342
|
+
- new banner size: FULL_WIDTH
|
343
|
+
### New only on github
|
344
|
+
https://github.com/EMI-INDO/emi-indo-cordova-plugin-admob/releases/tag/%401.4.0
|
345
|
+
|
346
|
+
> - # Plugin version @1.3.9
|
347
|
+
|
348
|
+
[FULL Example ](https://github.com/EMI-INDO/emi-indo-cordova-plugin-admob/blob/main/example/) - index.html:
|
349
|
+
|
350
|
+
### [ App Open Ad code example: ](https://github.com/EMI-INDO/emi-indo-cordova-plugin-admob/blob/main/example/app_open_ads.html)
|
351
|
+
### [ Banner Ad code example: ](https://github.com/EMI-INDO/emi-indo-cordova-plugin-admob/blob/main/example/banner_ads.html)
|
352
|
+
### [ Interstitial Ad code example: ](https://github.com/EMI-INDO/emi-indo-cordova-plugin-admob/blob/main/example/interstitial_ads.html)
|
353
|
+
### [ Rewarded interstitial Ad code example: ](https://github.com/EMI-INDO/emi-indo-cordova-plugin-admob/blob/main/example/rewarded_interstitial_ads.html)
|
354
|
+
### [ Rewarded Ad code example: ](https://github.com/EMI-INDO/emi-indo-cordova-plugin-admob/blob/main/example/rewarded_ads.html)
|
355
|
+
|
356
|
+
### [ Advanced topics: ](https://github.com/EMI-INDO/emi-indo-cordova-plugin-admob/tree/main/example/Advanced%20topics)
|
357
|
+
|
358
|
+
# IAB Europe Transparency & Consent Framework
|
359
|
+
### Example How to read consent choices
|
360
|
+
|
361
|
+
|
362
|
+
// index.html https://github.com/EMI-INDO/emi-indo-cordova-plugin-admob/blob/main/example/Advanced%20topics/consent_GDPR_IAB_TFCv2.2.html
|
363
|
+
```sh
|
364
|
+
// >>>>>>>> New features (UMP) SDK v2.1.0
|
365
|
+
// https://developers.google.com/admob/android/privacy/gdpr
|
366
|
+
/*
|
367
|
+
If the user chooses not to display ads,
|
368
|
+
you can restrict access to the app, or ban it,
|
369
|
+
until they change their decision back,
|
370
|
+
Just call showPrivacyOptionsForm();
|
371
|
+
*/
|
372
|
+
|
373
|
+
|
374
|
+
cordova.plugins.emiAdmobPlugin.getIabTfc(
|
375
|
+
(info) => {
|
376
|
+
// How to read consent choices
|
377
|
+
console.log("IABTCF_gdprApplies: " + info.IABTCF_gdprApplies);
|
378
|
+
console.log("IABTCF_PurposeConsents: " + info.IABTCF_PurposeConsents);
|
379
|
+
console.log("IABTCF_TCString: " + info.IABTCF_TCString);
|
347
380
|
|
381
|
+
// A small example
|
382
|
+
var fundingChoices;
|
383
|
+
|
384
|
+
fundingChoices = info.IABTCF_PurposeConsents;
|
385
|
+
if (fundingChoices === "1111111111"){
|
386
|
+
|
387
|
+
// Enable app features.
|
388
|
+
loadRewardedAd();
|
389
|
+
|
390
|
+
} else if (fundingChoices === "") {
|
391
|
+
|
392
|
+
// disable app features.
|
393
|
+
|
394
|
+
} else {
|
395
|
+
|
396
|
+
// You have to test everything yourself.
|
397
|
+
console.log(info);
|
398
|
+
|
399
|
+
}
|
400
|
+
|
401
|
+
},
|
402
|
+
(error) => {
|
403
|
+
console.log("Error: " + error);
|
404
|
+
|
405
|
+
});
|
406
|
+
|
407
|
+
|
348
408
|
|
349
409
|
```
|
350
410
|
|
351
411
|
|
352
412
|
|
353
413
|
|
414
|
+
|
354
415
|
# Admob Mediation
|
355
416
|
<img src="https://user-images.githubusercontent.com/78555833/229587307-91a7e380-aa2d-4140-a62d-fa8e6a8dd153.png" width="500">
|
356
417
|
|
@@ -15,63 +15,27 @@
|
|
15
15
|
|
16
16
|
let cleanText = () => { event.value = '' };
|
17
17
|
|
18
|
-
let debug = false;
|
19
|
-
|
20
|
-
|
21
|
-
|
22
18
|
// Load Rewarded Ad
|
19
|
+
let loadRewardedAd = () => {
|
20
|
+
cordova.plugins.emiAdmobPlugin.loadRewardedAd([adUnitId = "ca-app-pub-3940256099942544/5224354917", autoShow = true ]);
|
21
|
+
// call loadRewardedAd();
|
22
|
+
}
|
23
23
|
|
24
|
+
// Show Rewarded Ad
|
25
|
+
let showRewardedAd = () => {
|
26
|
+
cordova.plugins.emiAdmobPlugin.showRewardedAd();
|
27
|
+
// call showRewardedAd();
|
28
|
+
}
|
24
29
|
|
25
|
-
|
26
|
-
cordova.plugins.emiAdmobPlugin.loadRewardedAd(
|
27
|
-
AdUnitId = "ca-app-pub-3940256099942544/5224354917",
|
28
|
-
npa = "1", // String | 0 | 1
|
29
|
-
responseInfo = debug, // boolean
|
30
|
-
|
31
|
-
|
32
|
-
(info) => {
|
33
|
-
|
34
|
-
if (debug === true) {
|
35
|
-
|
36
|
-
event.value += "\n ResponseInfo: " + info; // responseInfo = true
|
37
|
-
|
38
|
-
} else
|
39
|
-
if (debug === false) {
|
40
|
-
|
41
|
-
// responseInfo = false
|
42
|
-
// event name: on.rewardedInt.revenue
|
43
|
-
|
44
|
-
event.value += "\n Micros: " + info.micros;
|
45
|
-
event.value += "\n Currency: " + info.currency;
|
46
|
-
event.value += "\n Precision: " + info.precision;
|
47
|
-
event.value += "\n AdUnitId: " + info.adUnitId;
|
48
|
-
|
49
|
-
}
|
50
|
-
|
51
|
-
},
|
52
|
-
(error) => {
|
53
|
-
|
54
|
-
event.value += "\n Error: " + error
|
55
|
-
|
56
|
-
});
|
57
|
-
}
|
58
|
-
|
59
|
-
// Show Rewarded Ad
|
60
|
-
|
61
|
-
let showRewardedAd = () => {
|
62
|
-
cordova.plugins.emiAdmobPlugin.showRewardedAd();
|
63
|
-
|
64
|
-
}
|
65
|
-
|
66
|
-
// >>>>>>>> User Messaging Platform (UMP) SDK.
|
30
|
+
// >>>>>>>> User Messaging Platform (UMP) SDK 2.1.0
|
67
31
|
|
68
32
|
let getConsentRequest = () => {
|
69
33
|
// https://developers.google.com/admob/android/privacy
|
70
34
|
cordova.plugins.emiAdmobPlugin.getConsentRequest(
|
71
35
|
|
72
|
-
(
|
36
|
+
(ststus) => {
|
73
37
|
|
74
|
-
event.value += "\n Consent Status: " +
|
38
|
+
event.value += "\n Consent Status: " + ststus;
|
75
39
|
|
76
40
|
},
|
77
41
|
(error) => {
|
@@ -164,19 +128,18 @@
|
|
164
128
|
|
165
129
|
document.addEventListener("deviceready", function () {
|
166
130
|
|
167
|
-
|
168
|
-
|
131
|
+
|
132
|
+
const config_Targeting = [
|
169
133
|
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
event.value += (info)
|
174
|
-
},
|
175
|
-
(error) => {
|
134
|
+
childDirectedTreatment = 0, // value: 0 | -1 | 1
|
135
|
+
underAgeOfConsent = false, // default: false
|
136
|
+
contentRating = "G" // value: G | MA | PG | T | ""
|
176
137
|
|
177
|
-
|
138
|
+
]
|
178
139
|
|
179
|
-
|
140
|
+
|
141
|
+
cordova.plugins.emiAdmobPlugin.targeting(config_Targeting);
|
142
|
+
cordova.plugins.emiAdmobPlugin.initialize();
|
180
143
|
|
181
144
|
|
182
145
|
// Rewarded Ad EVENT
|
@@ -201,62 +164,7 @@
|
|
201
164
|
|
202
165
|
});
|
203
166
|
|
204
|
-
|
205
|
-
|
206
|
-
event.value += ("\n on.rewarded.failed.load");
|
207
|
-
|
208
|
-
});
|
209
|
-
|
210
|
-
document.addEventListener('on.rewarded.click', () => {
|
211
|
-
|
212
|
-
event.value += ("\n on.rewarded.click");
|
213
|
-
|
214
|
-
});
|
215
|
-
|
216
|
-
document.addEventListener('on.rewarded.dismissed', () => {
|
217
|
-
|
218
|
-
event.value += ("\n on.rewarded.dismissed");
|
219
|
-
|
220
|
-
});
|
221
|
-
|
222
|
-
document.addEventListener('on.rewarded.failed.show', () => {
|
223
|
-
|
224
|
-
event.value += ("\n on.rewarded.failed.show");
|
225
|
-
|
226
|
-
});
|
227
|
-
|
228
|
-
document.addEventListener('on.rewarded.impression', () => {
|
229
|
-
|
230
|
-
event.value += ("\n on.rewarded.impression");
|
231
|
-
|
232
|
-
});
|
233
|
-
|
234
|
-
document.addEventListener('on.rewarded.show', () => {
|
235
|
-
|
236
|
-
event.value += ("\n on.rewarded.show");
|
237
|
-
|
238
|
-
});
|
239
|
-
|
240
|
-
document.addEventListener('on.rewarded.revenue', () => {
|
241
|
-
|
242
|
-
event.value += ("\n on.rewarded.revenue");
|
243
|
-
|
244
|
-
});
|
245
|
-
|
246
|
-
document.addEventListener('on.rewarded.ad.skip', () => {
|
247
|
-
|
248
|
-
event.value += ("\n on.rewarded.ad.skip");
|
249
|
-
|
250
|
-
});
|
251
|
-
|
252
|
-
|
253
|
-
document.addEventListener('on.reward.userEarnedReward', () => {
|
254
|
-
|
255
|
-
event.value += ("\n on.reward.userEarnedReward");
|
256
|
-
|
257
|
-
});
|
258
|
-
|
259
|
-
|
167
|
+
|
260
168
|
|
261
169
|
}, false);
|
262
170
|
|