emi-indo-cordova-plugin-admob 1.0.9 → 1.1.9
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 +124 -0
- package/README.md +120 -456
- package/example/Advanced topics/auto_load_and_show.html +94 -0
- package/example/{consent.html → Advanced topics/consent.html } +51 -22
- package/example/Advanced topics/globalSettings.html +39 -0
- package/example/Advanced topics/targeting.html +78 -0
- package/example/app_open_ads.html +151 -0
- package/example/banner_ads.html +248 -0
- package/example/interstitial_ads.html +166 -0
- package/example/rewarded_ads.html +185 -0
- package/example/rewarded_interstitial_ads.html +184 -0
- package/package.json +1 -1
- package/plugin.xml +8 -5
- package/src/android/emiAdmobPlugin.java +1 -1
- package/www/emiAdmobPlugin.js +20 -16
- package/example/index.html +0 -338
package/example/index.html
DELETED
@@ -1,338 +0,0 @@
|
|
1
|
-
<html>
|
2
|
-
<head>
|
3
|
-
<script type="text/javascript" src="cordova.js"></script>
|
4
|
-
</head>
|
5
|
-
<body>
|
6
|
-
|
7
|
-
<script>
|
8
|
-
|
9
|
-
|
10
|
-
// load App Open Ad
|
11
|
-
|
12
|
-
let loadAppOpenAd = () => {
|
13
|
-
cordova.plugins.emiAdmobPlugin.loadAppOpenAd(
|
14
|
-
AdUnitId = "ca-app-pub-3940256099942544/3419835294",
|
15
|
-
npa = "1", // String | 0 | 1
|
16
|
-
responseInfo = true, // boolean
|
17
|
-
|
18
|
-
// Optional
|
19
|
-
(info) => { alert(info) },
|
20
|
-
(error) => { alert(error)
|
21
|
-
|
22
|
-
});
|
23
|
-
}
|
24
|
-
|
25
|
-
// Show App Open Ad
|
26
|
-
|
27
|
-
let showAppOpenAd = () => {
|
28
|
-
cordova.plugins.emiAdmobPlugin.showAppOpenAd();
|
29
|
-
}
|
30
|
-
|
31
|
-
|
32
|
-
/// setting banner size:
|
33
|
-
/*
|
34
|
-
BANNER
|
35
|
-
FLUID
|
36
|
-
LARGE_BANNER
|
37
|
-
MEDIUM_RECTANGLE
|
38
|
-
FULL_BANNER
|
39
|
-
LEADERBOARD
|
40
|
-
(Smart Banners = DEPRECATED)
|
41
|
-
Inline_adaptive
|
42
|
-
Anchored_adaptive
|
43
|
-
default: Anchored_FULL_WIDTH
|
44
|
-
|
45
|
-
adaptiveWidth = 320 // number (only adaptive banner)
|
46
|
-
|
47
|
-
*/
|
48
|
-
/// setting banner position:
|
49
|
-
/*
|
50
|
-
top-right
|
51
|
-
top-center
|
52
|
-
left
|
53
|
-
center
|
54
|
-
right
|
55
|
-
bottom-center
|
56
|
-
bottom-right
|
57
|
-
default: "bottom-left"
|
58
|
-
*/
|
59
|
-
|
60
|
-
// Banner Adaptive
|
61
|
-
|
62
|
-
let showBannerAdaptive = () => {
|
63
|
-
cordova.plugins.emiAdmobPlugin.showBannerAd(
|
64
|
-
AdUnitId = "ca-app-pub-3940256099942544/6300978111",
|
65
|
-
npa = "1", // String | 0 | 1
|
66
|
-
position = "bottom-center",
|
67
|
-
size = "Anchored_FULL_WIDTH", // | Inline_adaptive | Anchored_adaptive | default: Anchored_FULL_WIDTH
|
68
|
-
adaptiveWidth = 320,
|
69
|
-
responseInfo = true, // boolean
|
70
|
-
|
71
|
-
// Optional
|
72
|
-
(info) => { alert(info) },
|
73
|
-
(error) => { alert(error)
|
74
|
-
|
75
|
-
});
|
76
|
-
}
|
77
|
-
|
78
|
-
// not Adaptive banner
|
79
|
-
|
80
|
-
let showBannerNotAdaptive = () => {
|
81
|
-
cordova.plugins.emiAdmobPlugin.showBannerAd(
|
82
|
-
AdUnitId = "ca-app-pub-3940256099942544/6300978111",
|
83
|
-
npa = "1", // String | 0 | 1
|
84
|
-
position = "bottom-center",
|
85
|
-
size = "FLUID",
|
86
|
-
adaptiveWidth = 320,
|
87
|
-
responseInfo = true, // boolean
|
88
|
-
|
89
|
-
// Optional
|
90
|
-
(info) => { alert(info) },
|
91
|
-
(error) => { alert(error)
|
92
|
-
|
93
|
-
});
|
94
|
-
}
|
95
|
-
|
96
|
-
// Remove Banner
|
97
|
-
|
98
|
-
let removeBannerAd = () => {
|
99
|
-
cordova.plugins.emiAdmobPlugin.removeBannerAd();
|
100
|
-
}
|
101
|
-
|
102
|
-
|
103
|
-
// Load Interstitial Ad
|
104
|
-
|
105
|
-
let loadInterstitialAd = () => {
|
106
|
-
cordova.plugins.emiAdmobPlugin.loadInterstitialAd(
|
107
|
-
AdUnitId = "ca-app-pub-3940256099942544/1033173712",
|
108
|
-
npa = "1", // String | 0 | 1
|
109
|
-
responseInfo = true, // boolean
|
110
|
-
|
111
|
-
// Optional
|
112
|
-
(info) => { alert(info) },
|
113
|
-
(error) => { alert(error)
|
114
|
-
|
115
|
-
});
|
116
|
-
}
|
117
|
-
|
118
|
-
// Show Interstitial Ad
|
119
|
-
|
120
|
-
let showInterstitialAd = () => {
|
121
|
-
cordova.plugins.emiAdmobPlugin.showInterstitialAd();
|
122
|
-
}
|
123
|
-
|
124
|
-
// load Rewarded Interstitial Ad
|
125
|
-
|
126
|
-
let loadRewardedInterstitialAd = () => {
|
127
|
-
cordova.plugins.emiAdmobPlugin.loadRewardedInterstitialAd(
|
128
|
-
AdUnitId = "ca-app-pub-3940256099942544/5354046379",
|
129
|
-
npa = "1", // String | 0 | 1
|
130
|
-
responseInfo = true, // boolean
|
131
|
-
|
132
|
-
// Optional
|
133
|
-
(info) => { alert(info) },
|
134
|
-
(error) => { alert(error)
|
135
|
-
|
136
|
-
});
|
137
|
-
}
|
138
|
-
|
139
|
-
|
140
|
-
// Show Rewarded Interstitial Ad
|
141
|
-
|
142
|
-
const showRewardedInterstitialAd = () => {
|
143
|
-
cordova.plugins.emiAdmobPlugin.showRewardedInterstitialAd();
|
144
|
-
}
|
145
|
-
|
146
|
-
// Load Rewarded Ad
|
147
|
-
|
148
|
-
let loadRewardedAd = () => {
|
149
|
-
cordova.plugins.emiAdmobPlugin.loadRewardedAd(
|
150
|
-
AdUnitId = "ca-app-pub-3940256099942544/5224354917",
|
151
|
-
npa = "1", // String | 0 | 1
|
152
|
-
responseInfo = true, // boolean
|
153
|
-
|
154
|
-
// Optional
|
155
|
-
(info) => { alert(info) },
|
156
|
-
(error) => { alert(error)
|
157
|
-
|
158
|
-
});
|
159
|
-
}
|
160
|
-
|
161
|
-
// Show Rewarded Ad
|
162
|
-
|
163
|
-
let showRewardedAd = () => {
|
164
|
-
cordova.plugins.emiAdmobPlugin.showRewardedAd();
|
165
|
-
}
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
document.addEventListener("deviceready", function(){
|
170
|
-
|
171
|
-
// Before loading ads, have your app initialize the Google Mobile Ads SDK by calling
|
172
|
-
// This needs to be done only once, ideally at app launch.
|
173
|
-
|
174
|
-
cordova.plugins.emiAdmobPlugin.initialize(
|
175
|
-
// Optional
|
176
|
-
(info) => { console.log(info) },
|
177
|
-
(error) => { alert(error)
|
178
|
-
|
179
|
-
});
|
180
|
-
|
181
|
-
// Instruction: https://developers.google.com/admob/android/global-settings
|
182
|
-
|
183
|
-
cordova.plugins.emiAdmobPlugin.globalSettings(
|
184
|
-
|
185
|
-
setAppMuted = true, // Type Boolean default: true
|
186
|
-
setAppVolume = 1.0, // Type float
|
187
|
-
enableSameAppKey = false, // Type Boolean default: false
|
188
|
-
|
189
|
-
// Optional
|
190
|
-
(info) => { console.log(info) },
|
191
|
-
(error) => { alert(error)
|
192
|
-
|
193
|
-
});
|
194
|
-
|
195
|
-
|
196
|
-
// You can see the value when the ad is loaded, set responseInfo = true
|
197
|
-
// Instruction: https://developers.google.com/admob/android/targeting
|
198
|
-
// Overview: https://developers.google.com/android/reference/com/google/android/gms/ads/RequestConfiguration
|
199
|
-
|
200
|
-
cordova.plugins.emiAdmobPlugin.targeting(
|
201
|
-
TagForChildDirectedTreatment = 0, // value: 0 | -1 | 1
|
202
|
-
TagForUnderAgeOfConsent = 0, // // value: 0 | -1 | 1
|
203
|
-
MaxAdContentRating = "G", // value: G | MA | PG | T | ""
|
204
|
-
|
205
|
-
// Optional
|
206
|
-
(info) => { console.log(info) },
|
207
|
-
(error) => { alert(error)
|
208
|
-
|
209
|
-
});
|
210
|
-
|
211
|
-
|
212
|
-
document.addEventListener('on.SdkInitializationComplete', () => {
|
213
|
-
|
214
|
-
alert("on Sdk Initialization Complete");
|
215
|
-
|
216
|
-
|
217
|
-
});
|
218
|
-
|
219
|
-
// AppOpenAd EVEN
|
220
|
-
|
221
|
-
/*
|
222
|
-
on.open.loaded
|
223
|
-
on.open.failed.loaded
|
224
|
-
on.open.dismissed
|
225
|
-
on.open.failed.show
|
226
|
-
on.open.show
|
227
|
-
*/
|
228
|
-
|
229
|
-
|
230
|
-
document.addEventListener('on.open.loaded', () => {
|
231
|
-
|
232
|
-
alert("on app open loaded");
|
233
|
-
|
234
|
-
});
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
// BANNER EVENT
|
239
|
-
|
240
|
-
/*
|
241
|
-
on.bannerAdClicked
|
242
|
-
on.bannerAdClosed
|
243
|
-
on.bannerAdFailedToLoad
|
244
|
-
on.bannerAdImpression
|
245
|
-
on.bannerAdLoaded
|
246
|
-
on.bannerAdOpened
|
247
|
-
*/
|
248
|
-
document.addEventListener('on.bannerAdLoaded', () => {
|
249
|
-
|
250
|
-
alert("on banner Ad Loaded");
|
251
|
-
|
252
|
-
});
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
// Interstitial EVENT
|
257
|
-
|
258
|
-
/*
|
259
|
-
on.InterstitialAdLoaded
|
260
|
-
on.InterstitialAdFailedToLoad
|
261
|
-
on.InterstitialAdClicked
|
262
|
-
on.InterstitialAdDismissedFullScreenContent
|
263
|
-
on.InterstitialAdFailedToShowFullScreenContent
|
264
|
-
on.InterstitialAdImpression
|
265
|
-
on.InterstitialAdShowedFullScreenContent
|
266
|
-
*/
|
267
|
-
|
268
|
-
document.addEventListener('on.InterstitialAdLoaded', () => {
|
269
|
-
|
270
|
-
alert("on Interstitial Ad Loaded");
|
271
|
-
|
272
|
-
});
|
273
|
-
|
274
|
-
|
275
|
-
// Rewarded Interstitial EVENT
|
276
|
-
|
277
|
-
/*
|
278
|
-
on.RewardedInterstitialAdLoaded
|
279
|
-
on.RewardedInterstitialAdFailedToLoad
|
280
|
-
on.rewardedInterstitialAdClicked
|
281
|
-
on.rewardedInterstitialAdDismissedFullScreenContent
|
282
|
-
on.rewardedInterstitialAdFailedToShowFullScreenContent
|
283
|
-
on.rewardedInterstitialAdImpression
|
284
|
-
on.rewardedInterstitialAdShowedFullScreenContent
|
285
|
-
on.rewardedInterstitial.rewarded
|
286
|
-
*/
|
287
|
-
|
288
|
-
document.addEventListener('on.RewardedInterstitialAdLoaded', () => {
|
289
|
-
|
290
|
-
alert("on Rewarded Interstitial Loaded");
|
291
|
-
|
292
|
-
});
|
293
|
-
|
294
|
-
|
295
|
-
// Rewarded EVENT
|
296
|
-
|
297
|
-
/*
|
298
|
-
on.RewardedAdFailedToLoad
|
299
|
-
on.RewardedAdLoaded
|
300
|
-
on.rewardedAdClicked
|
301
|
-
on.rewardedAdDismissedFullScreenContent
|
302
|
-
on.rewardedAdFailedToShowFullScreenContent
|
303
|
-
on.rewardedAdImpression
|
304
|
-
on.rewardedAdShowedFullScreenContent
|
305
|
-
on.rewarded.rewarded
|
306
|
-
*/
|
307
|
-
|
308
|
-
document.addEventListener('on.RewardedAdLoaded', () => {
|
309
|
-
|
310
|
-
alert("on Rewarded Ad Loaded");
|
311
|
-
|
312
|
-
});
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
}, false);
|
317
|
-
|
318
|
-
</script>
|
319
|
-
|
320
|
-
<p> <button onclick="loadAppOpenAd();">load App Open Ad</button></p>
|
321
|
-
<p> <button onclick="showAppOpenAd();">Show App Open Ad</button></p>
|
322
|
-
|
323
|
-
<p> <button onclick="showBannerAdaptive();">Show Banner adaptive</button></p>
|
324
|
-
<p> <button onclick="showBannerNotAdaptive();">show Banner No Adaptive</button></p>
|
325
|
-
<p> <button onclick="removeBannerAd();">remove Banner Ad</button></p>
|
326
|
-
|
327
|
-
<p> <button onclick="loadInterstitialAd();">Load Interstitial Ad</button></p>
|
328
|
-
<p> <button onclick="showInterstitialAd();">Show Interstitial Ad</button></p>
|
329
|
-
|
330
|
-
<p> <button onclick="loadRewardedInterstitialAd();">Load Rewarded Interstitial</button></p>
|
331
|
-
<p> <button onclick="showRewardedInterstitialAd();">Show Rewarded Interstitial</button></p>
|
332
|
-
|
333
|
-
<p> <button onclick="loadRewardedAd();">Load Rewarded Ad</button></p>
|
334
|
-
<p> <button onclick="showRewardedAd();">Show Rewarded Ad</button></p>
|
335
|
-
|
336
|
-
|
337
|
-
</body>
|
338
|
-
</html>
|