emi-indo-cordova-plugin-admob 1.3.9 → 1.4.0
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/FUNDING.yml +13 -13
- package/.github/ISSUE_TEMPLATE/bug_report.md +124 -124
- package/LICENSE +7 -7
- package/README.md +509 -446
- package/example/Advanced topics/auto_load_and_show.html +94 -94
- package/example/Advanced topics/consent_GDPR_IAB_TFCv2.2.html +279 -0
- package/example/Advanced topics/targeting.html +78 -78
- package/example/app_open_ads.html +151 -151
- package/example/banner_ads.html +248 -248
- package/example/interstitial_ads.html +166 -166
- package/example/rewarded_ads.html +185 -185
- package/example/rewarded_interstitial_ads.html +184 -184
- package/package.json +34 -34
- package/plugin.xml +292 -284
- package/src/android/emiAdmobPlugin.java +1 -1
- package/src/ios/emiAdmobPlugin.swift +286 -286
- package/www/emiAdmobPlugin.js +8 -0
@@ -1,166 +1,166 @@
|
|
1
|
-
<html>
|
2
|
-
<head>
|
3
|
-
<script type="text/javascript" src="cordova.js"></script>
|
4
|
-
</head>
|
5
|
-
<body>
|
6
|
-
|
7
|
-
<label for="event">Debug Event All response :</label>
|
8
|
-
<textarea id="event" name="event" rows="5" cols="40"></textarea>
|
9
|
-
|
10
|
-
<script>
|
11
|
-
|
12
|
-
let event = document.getElementById('event');
|
13
|
-
|
14
|
-
let cleanText = () => { event.value = '' };
|
15
|
-
|
16
|
-
let debug = false;
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
// Load Interstitial Ad
|
21
|
-
|
22
|
-
let loadInterstitialAd = () => {
|
23
|
-
cordova.plugins.emiAdmobPlugin.loadInterstitialAd(
|
24
|
-
AdUnitId = "ca-app-pub-3940256099942544/1033173712",
|
25
|
-
npa = "1", // String | 0 | 1
|
26
|
-
responseInfo = debug, // boolean
|
27
|
-
|
28
|
-
(info) => {
|
29
|
-
|
30
|
-
if (debug === true) {
|
31
|
-
|
32
|
-
event.value += "\n ResponseInfo: " + info; // responseInfo = true
|
33
|
-
|
34
|
-
} else
|
35
|
-
if (debug === false) {
|
36
|
-
|
37
|
-
// responseInfo = false
|
38
|
-
// event name: on.interstitial.revenue
|
39
|
-
|
40
|
-
event.value += "\n Micros: " + info.micros;
|
41
|
-
event.value += "\n Currency: " + info.currency;
|
42
|
-
event.value += "\n Precision: " + info.precision;
|
43
|
-
event.value += "\n AdUnitId: " + info.adUnitId;
|
44
|
-
|
45
|
-
}
|
46
|
-
|
47
|
-
},
|
48
|
-
(error) => {
|
49
|
-
|
50
|
-
event.value += "\n Error: " + error
|
51
|
-
|
52
|
-
});
|
53
|
-
}
|
54
|
-
|
55
|
-
// Show Interstitial Ad
|
56
|
-
|
57
|
-
let showInterstitialAd = () => {
|
58
|
-
cordova.plugins.emiAdmobPlugin.showInterstitialAd();
|
59
|
-
}
|
60
|
-
|
61
|
-
|
62
|
-
///// >>>>>> Device Ready <<<<<<
|
63
|
-
|
64
|
-
|
65
|
-
document.addEventListener("deviceready", function(){
|
66
|
-
|
67
|
-
// Before loading ads, have your app initialize the Google Mobile Ads SDK by calling
|
68
|
-
// This needs to be done only once, ideally at app launch.
|
69
|
-
|
70
|
-
cordova.plugins.emiAdmobPlugin.initialize(
|
71
|
-
// Optional
|
72
|
-
(info) => {
|
73
|
-
event.value += (info)
|
74
|
-
},
|
75
|
-
(error) => {
|
76
|
-
|
77
|
-
event.value += (error)
|
78
|
-
|
79
|
-
});
|
80
|
-
|
81
|
-
// SDK EVENT Initialization
|
82
|
-
|
83
|
-
document.addEventListener('on.sdkInitialization', () => {
|
84
|
-
|
85
|
-
event.value += ("\n On Sdk Initialization");
|
86
|
-
|
87
|
-
|
88
|
-
});
|
89
|
-
|
90
|
-
|
91
|
-
// interstitial Ad EVENT
|
92
|
-
|
93
|
-
/*
|
94
|
-
on.interstitial.loaded
|
95
|
-
on.interstitial.failed.load
|
96
|
-
on.interstitial.click
|
97
|
-
on.interstitial.dismissed
|
98
|
-
on.interstitial.failed.show
|
99
|
-
on.interstitial.impression
|
100
|
-
on.interstitial.show
|
101
|
-
on.interstitial.revenue
|
102
|
-
*/
|
103
|
-
|
104
|
-
|
105
|
-
document.addEventListener('on.interstitial.loaded', () => {
|
106
|
-
|
107
|
-
event.value += ("\n on.interstitial.loaded");
|
108
|
-
|
109
|
-
});
|
110
|
-
|
111
|
-
document.addEventListener('on.interstitial.failed.load', () => {
|
112
|
-
|
113
|
-
event.value += ("\n on.interstitial.failed.load");
|
114
|
-
|
115
|
-
});
|
116
|
-
|
117
|
-
document.addEventListener('on.interstitial.click', () => {
|
118
|
-
|
119
|
-
event.value += ("\n on.interstitial.click");
|
120
|
-
|
121
|
-
});
|
122
|
-
|
123
|
-
document.addEventListener('on.interstitial.dismissed', () => {
|
124
|
-
|
125
|
-
event.value += ("\n on.interstitial.dismissed");
|
126
|
-
|
127
|
-
});
|
128
|
-
|
129
|
-
document.addEventListener('on.interstitial.failed.show', () => {
|
130
|
-
|
131
|
-
event.value += ("\n on.interstitial.failed.show");
|
132
|
-
|
133
|
-
});
|
134
|
-
|
135
|
-
document.addEventListener('on.interstitial.impression', () => {
|
136
|
-
|
137
|
-
event.value += ("\n on.interstitial.impression");
|
138
|
-
|
139
|
-
});
|
140
|
-
|
141
|
-
document.addEventListener('on.interstitial.show', () => {
|
142
|
-
|
143
|
-
event.value += ("\n on.interstitial.show");
|
144
|
-
|
145
|
-
});
|
146
|
-
|
147
|
-
document.addEventListener('on.interstitial.revenue', () => {
|
148
|
-
|
149
|
-
event.value += ("\n on.interstitial.revenue");
|
150
|
-
|
151
|
-
});
|
152
|
-
|
153
|
-
|
154
|
-
}, false);
|
155
|
-
|
156
|
-
</script>
|
157
|
-
|
158
|
-
<p> <button onclick="loadInterstitialAd();">Load Interstitial Ad</button></p>
|
159
|
-
<p> <button onclick="showInterstitialAd();">Show Interstitial Ad</button></p>
|
160
|
-
|
161
|
-
|
162
|
-
<p> <button onclick="cleanText();">Clean response Text</button></p>
|
163
|
-
|
164
|
-
|
165
|
-
</body>
|
166
|
-
</html>
|
1
|
+
<html>
|
2
|
+
<head>
|
3
|
+
<script type="text/javascript" src="cordova.js"></script>
|
4
|
+
</head>
|
5
|
+
<body>
|
6
|
+
|
7
|
+
<label for="event">Debug Event All response :</label>
|
8
|
+
<textarea id="event" name="event" rows="5" cols="40"></textarea>
|
9
|
+
|
10
|
+
<script>
|
11
|
+
|
12
|
+
let event = document.getElementById('event');
|
13
|
+
|
14
|
+
let cleanText = () => { event.value = '' };
|
15
|
+
|
16
|
+
let debug = false;
|
17
|
+
|
18
|
+
|
19
|
+
|
20
|
+
// Load Interstitial Ad
|
21
|
+
|
22
|
+
let loadInterstitialAd = () => {
|
23
|
+
cordova.plugins.emiAdmobPlugin.loadInterstitialAd(
|
24
|
+
AdUnitId = "ca-app-pub-3940256099942544/1033173712",
|
25
|
+
npa = "1", // String | 0 | 1
|
26
|
+
responseInfo = debug, // boolean
|
27
|
+
|
28
|
+
(info) => {
|
29
|
+
|
30
|
+
if (debug === true) {
|
31
|
+
|
32
|
+
event.value += "\n ResponseInfo: " + info; // responseInfo = true
|
33
|
+
|
34
|
+
} else
|
35
|
+
if (debug === false) {
|
36
|
+
|
37
|
+
// responseInfo = false
|
38
|
+
// event name: on.interstitial.revenue
|
39
|
+
|
40
|
+
event.value += "\n Micros: " + info.micros;
|
41
|
+
event.value += "\n Currency: " + info.currency;
|
42
|
+
event.value += "\n Precision: " + info.precision;
|
43
|
+
event.value += "\n AdUnitId: " + info.adUnitId;
|
44
|
+
|
45
|
+
}
|
46
|
+
|
47
|
+
},
|
48
|
+
(error) => {
|
49
|
+
|
50
|
+
event.value += "\n Error: " + error
|
51
|
+
|
52
|
+
});
|
53
|
+
}
|
54
|
+
|
55
|
+
// Show Interstitial Ad
|
56
|
+
|
57
|
+
let showInterstitialAd = () => {
|
58
|
+
cordova.plugins.emiAdmobPlugin.showInterstitialAd();
|
59
|
+
}
|
60
|
+
|
61
|
+
|
62
|
+
///// >>>>>> Device Ready <<<<<<
|
63
|
+
|
64
|
+
|
65
|
+
document.addEventListener("deviceready", function(){
|
66
|
+
|
67
|
+
// Before loading ads, have your app initialize the Google Mobile Ads SDK by calling
|
68
|
+
// This needs to be done only once, ideally at app launch.
|
69
|
+
|
70
|
+
cordova.plugins.emiAdmobPlugin.initialize(
|
71
|
+
// Optional
|
72
|
+
(info) => {
|
73
|
+
event.value += (info)
|
74
|
+
},
|
75
|
+
(error) => {
|
76
|
+
|
77
|
+
event.value += (error)
|
78
|
+
|
79
|
+
});
|
80
|
+
|
81
|
+
// SDK EVENT Initialization
|
82
|
+
|
83
|
+
document.addEventListener('on.sdkInitialization', () => {
|
84
|
+
|
85
|
+
event.value += ("\n On Sdk Initialization");
|
86
|
+
|
87
|
+
|
88
|
+
});
|
89
|
+
|
90
|
+
|
91
|
+
// interstitial Ad EVENT
|
92
|
+
|
93
|
+
/*
|
94
|
+
on.interstitial.loaded
|
95
|
+
on.interstitial.failed.load
|
96
|
+
on.interstitial.click
|
97
|
+
on.interstitial.dismissed
|
98
|
+
on.interstitial.failed.show
|
99
|
+
on.interstitial.impression
|
100
|
+
on.interstitial.show
|
101
|
+
on.interstitial.revenue
|
102
|
+
*/
|
103
|
+
|
104
|
+
|
105
|
+
document.addEventListener('on.interstitial.loaded', () => {
|
106
|
+
|
107
|
+
event.value += ("\n on.interstitial.loaded");
|
108
|
+
|
109
|
+
});
|
110
|
+
|
111
|
+
document.addEventListener('on.interstitial.failed.load', () => {
|
112
|
+
|
113
|
+
event.value += ("\n on.interstitial.failed.load");
|
114
|
+
|
115
|
+
});
|
116
|
+
|
117
|
+
document.addEventListener('on.interstitial.click', () => {
|
118
|
+
|
119
|
+
event.value += ("\n on.interstitial.click");
|
120
|
+
|
121
|
+
});
|
122
|
+
|
123
|
+
document.addEventListener('on.interstitial.dismissed', () => {
|
124
|
+
|
125
|
+
event.value += ("\n on.interstitial.dismissed");
|
126
|
+
|
127
|
+
});
|
128
|
+
|
129
|
+
document.addEventListener('on.interstitial.failed.show', () => {
|
130
|
+
|
131
|
+
event.value += ("\n on.interstitial.failed.show");
|
132
|
+
|
133
|
+
});
|
134
|
+
|
135
|
+
document.addEventListener('on.interstitial.impression', () => {
|
136
|
+
|
137
|
+
event.value += ("\n on.interstitial.impression");
|
138
|
+
|
139
|
+
});
|
140
|
+
|
141
|
+
document.addEventListener('on.interstitial.show', () => {
|
142
|
+
|
143
|
+
event.value += ("\n on.interstitial.show");
|
144
|
+
|
145
|
+
});
|
146
|
+
|
147
|
+
document.addEventListener('on.interstitial.revenue', () => {
|
148
|
+
|
149
|
+
event.value += ("\n on.interstitial.revenue");
|
150
|
+
|
151
|
+
});
|
152
|
+
|
153
|
+
|
154
|
+
}, false);
|
155
|
+
|
156
|
+
</script>
|
157
|
+
|
158
|
+
<p> <button onclick="loadInterstitialAd();">Load Interstitial Ad</button></p>
|
159
|
+
<p> <button onclick="showInterstitialAd();">Show Interstitial Ad</button></p>
|
160
|
+
|
161
|
+
|
162
|
+
<p> <button onclick="cleanText();">Clean response Text</button></p>
|
163
|
+
|
164
|
+
|
165
|
+
</body>
|
166
|
+
</html>
|