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.
@@ -1,248 +1,248 @@
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
- >>>>>>>>>> Banner position <<<<<<<<<<<<<<
20
-
21
- top-right
22
- top-center
23
- left
24
- center
25
- right
26
- bottom-center
27
- bottom-right
28
-
29
- >>>>>>>>>>> Banner size <<<<<<<<<<<<
30
- ( Ad Size Adaptive )
31
-
32
- Anchored_adaptive
33
- Inline_adaptive
34
- default: Adaptive_FULL_WIDTH
35
- adaptiveWidth = number/default = 320
36
-
37
- ( Ad Size not Adaptive )
38
-
39
- BANNER
40
- FLUID
41
- LARGE_BANNER
42
- MEDIUM_RECTANGLE
43
- FULL_BANNER
44
- LEADERBOARD
45
-
46
- Smart Banners = DEPRECATED ( Replaced by Adaptive_FULL_WIDTH )
47
-
48
- */
49
-
50
- // // Note adaptiveWidth = 320, // This is special size = "Inline_adaptive" or "Anchored_adaptive" if else this field will be ignored
51
-
52
- // Adaptive banner
53
-
54
- let loadBannerAdaptive = () => {
55
-
56
- cordova.plugins.emiAdmobPlugin.loadBannerAd(
57
- AdUnitId = "ca-app-pub-3940256099942544/6300978111",
58
- npa = "1", // String | 0 | 1
59
- position = "bottom-center",
60
- size = "default", // Inline_adaptive | Anchored_adaptive | default = Adaptive_FULL_WIDTH
61
- adaptiveWidth = 320,
62
- responseInfo = debug, // boolean
63
-
64
- (info) => {
65
-
66
- if (debug === true) {
67
-
68
- event.value += "\n ResponseInfo: " + info; // responseInfo = true
69
-
70
- }
71
-
72
- },
73
- (error) => {
74
-
75
- event.value += "\n Error: " + error
76
-
77
- });
78
- }
79
-
80
-
81
-
82
- // not Adaptive banner
83
-
84
- let loadBannerNotAdaptive = () => {
85
- cordova.plugins.emiAdmobPlugin.loadBannerAd(
86
- AdUnitId = "ca-app-pub-3940256099942544/6300978111",
87
- npa = "1", // String | 0 | 1
88
- position = "bottom-center",
89
- size = "BANNER",
90
- adaptiveWidth = 320, // Ignored
91
- responseInfo = false, // boolean
92
-
93
-
94
- (info) => {
95
-
96
- if (debug === true) {
97
-
98
- event.value += "\n ResponseInfo: " + info; // responseInfo = true
99
-
100
- }
101
-
102
- },
103
- (error) => {
104
-
105
- event.value += "\n Error: " + error
106
-
107
- });
108
- }
109
-
110
-
111
-
112
- // show Banner Ad
113
-
114
- let showBannerAd = () => {
115
-
116
- cordova.plugins.emiAdmobPlugin.showBannerAd(
117
-
118
- (info) => {
119
- // event name: on.banner.revenue
120
- event.value += "\n Micros: " + info.micros;
121
- event.value += "\n Currency: " + info.currency;
122
- event.value += "\n Precision: " + info.precision;
123
- event.value += "\n AdUnitId: " + info.adUnitId;
124
-
125
- },
126
- (error) => {
127
-
128
- event.value += "\n Error: " + error
129
-
130
- });
131
-
132
- }
133
-
134
-
135
- // Remove Banner
136
-
137
- let removeBannerAd = () => {
138
- cordova.plugins.emiAdmobPlugin.removeBannerAd();
139
- }
140
-
141
-
142
- ///// >>>>>> Device Ready <<<<<<
143
-
144
-
145
- document.addEventListener("deviceready", function(){
146
-
147
- // Before loading ads, have your app initialize the Google Mobile Ads SDK by calling
148
- // This needs to be done only once, ideally at app launch.
149
-
150
- cordova.plugins.emiAdmobPlugin.initialize(
151
- // Optional
152
- (info) => {
153
- event.value += (info)
154
- },
155
- (error) => {
156
-
157
- event.value += (error)
158
-
159
- });
160
-
161
- // SDK EVENT Initialization
162
-
163
- document.addEventListener('on.sdkInitialization', () => {
164
-
165
- event.value += ("\n On Sdk Initialization");
166
-
167
-
168
- });
169
-
170
-
171
- // Banner Ad EVENT
172
-
173
- /*
174
- on.banner.load
175
- on.banner.failed.load
176
- on.banner.click
177
- on.banner.close
178
- on.banner.impression
179
- on.banner.open
180
- on.banner.revenue
181
- on.banner.remove
182
- */
183
-
184
-
185
- document.addEventListener('on.banner.load', () => {
186
-
187
- event.value += ("\n on.banner.load");
188
-
189
- });
190
-
191
- document.addEventListener('on.banner.failed.load', () => {
192
-
193
- event.value += ("\n on.banner.failed.load");
194
-
195
- });
196
-
197
- document.addEventListener('on.banner.click', () => {
198
-
199
- event.value += ("\n on.banner.click");
200
-
201
- });
202
-
203
- document.addEventListener('on.banner.close', () => {
204
-
205
- event.value += ("\n on.banner.close");
206
-
207
- });
208
-
209
- document.addEventListener('on.banner.impression', () => {
210
-
211
- event.value += ("\n on.banner.impression");
212
-
213
- });
214
-
215
- document.addEventListener('on.banner.open', () => {
216
-
217
- event.value += ("\n on.banner.open");
218
-
219
- });
220
-
221
- document.addEventListener('on.banner.revenue', () => {
222
-
223
- event.value += ("\n on.banner.revenue");
224
-
225
- });
226
-
227
- document.addEventListener('on.banner.remove', () => {
228
-
229
- event.value += ("\n on.banner.remove");
230
-
231
- });
232
-
233
-
234
- }, false);
235
-
236
- </script>
237
-
238
- <p> <button onclick="loadBannerAdaptive();">load Banner adaptive</button></p>
239
- <p> <button onclick="loadBannerNotAdaptive();">load Banner No Adaptive</button></p>
240
- <p> <button onclick="showBannerAd();">show Banner Ad</button></p>
241
- <p> <button onclick="removeBannerAd();">remove Banner Ad</button></p>
242
-
243
-
244
- <p> <button onclick="cleanText();">Clean response Text</button></p>
245
-
246
-
247
- </body>
248
- </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
+ >>>>>>>>>> Banner position <<<<<<<<<<<<<<
20
+
21
+ top-right
22
+ top-center
23
+ left
24
+ center
25
+ right
26
+ bottom-center
27
+ bottom-right
28
+
29
+ >>>>>>>>>>> Banner size <<<<<<<<<<<<
30
+ ( Ad Size Adaptive )
31
+
32
+ Anchored_adaptive
33
+ Inline_adaptive
34
+ default: Adaptive_FULL_WIDTH
35
+ adaptiveWidth = number/default = 320
36
+
37
+ ( Ad Size not Adaptive )
38
+
39
+ BANNER
40
+ FLUID
41
+ LARGE_BANNER
42
+ MEDIUM_RECTANGLE
43
+ FULL_BANNER
44
+ LEADERBOARD
45
+
46
+ Smart Banners = DEPRECATED ( Replaced by Adaptive_FULL_WIDTH )
47
+
48
+ */
49
+
50
+ // // Note adaptiveWidth = 320, // This is special size = "Inline_adaptive" or "Anchored_adaptive" if else this field will be ignored
51
+
52
+ // Adaptive banner
53
+
54
+ let loadBannerAdaptive = () => {
55
+
56
+ cordova.plugins.emiAdmobPlugin.loadBannerAd(
57
+ AdUnitId = "ca-app-pub-3940256099942544/6300978111",
58
+ npa = "1", // String | 0 | 1
59
+ position = "bottom-center",
60
+ size = "default", // Inline_adaptive | Anchored_adaptive | default = Adaptive_FULL_WIDTH
61
+ adaptiveWidth = 320,
62
+ responseInfo = debug, // boolean
63
+
64
+ (info) => {
65
+
66
+ if (debug === true) {
67
+
68
+ event.value += "\n ResponseInfo: " + info; // responseInfo = true
69
+
70
+ }
71
+
72
+ },
73
+ (error) => {
74
+
75
+ event.value += "\n Error: " + error
76
+
77
+ });
78
+ }
79
+
80
+
81
+
82
+ // not Adaptive banner
83
+
84
+ let loadBannerNotAdaptive = () => {
85
+ cordova.plugins.emiAdmobPlugin.loadBannerAd(
86
+ AdUnitId = "ca-app-pub-3940256099942544/6300978111",
87
+ npa = "1", // String | 0 | 1
88
+ position = "bottom-center",
89
+ size = "BANNER",
90
+ adaptiveWidth = 320, // Ignored
91
+ responseInfo = false, // boolean
92
+
93
+
94
+ (info) => {
95
+
96
+ if (debug === true) {
97
+
98
+ event.value += "\n ResponseInfo: " + info; // responseInfo = true
99
+
100
+ }
101
+
102
+ },
103
+ (error) => {
104
+
105
+ event.value += "\n Error: " + error
106
+
107
+ });
108
+ }
109
+
110
+
111
+
112
+ // show Banner Ad
113
+
114
+ let showBannerAd = () => {
115
+
116
+ cordova.plugins.emiAdmobPlugin.showBannerAd(
117
+
118
+ (info) => {
119
+ // event name: on.banner.revenue
120
+ event.value += "\n Micros: " + info.micros;
121
+ event.value += "\n Currency: " + info.currency;
122
+ event.value += "\n Precision: " + info.precision;
123
+ event.value += "\n AdUnitId: " + info.adUnitId;
124
+
125
+ },
126
+ (error) => {
127
+
128
+ event.value += "\n Error: " + error
129
+
130
+ });
131
+
132
+ }
133
+
134
+
135
+ // Remove Banner
136
+
137
+ let removeBannerAd = () => {
138
+ cordova.plugins.emiAdmobPlugin.removeBannerAd();
139
+ }
140
+
141
+
142
+ ///// >>>>>> Device Ready <<<<<<
143
+
144
+
145
+ document.addEventListener("deviceready", function(){
146
+
147
+ // Before loading ads, have your app initialize the Google Mobile Ads SDK by calling
148
+ // This needs to be done only once, ideally at app launch.
149
+
150
+ cordova.plugins.emiAdmobPlugin.initialize(
151
+ // Optional
152
+ (info) => {
153
+ event.value += (info)
154
+ },
155
+ (error) => {
156
+
157
+ event.value += (error)
158
+
159
+ });
160
+
161
+ // SDK EVENT Initialization
162
+
163
+ document.addEventListener('on.sdkInitialization', () => {
164
+
165
+ event.value += ("\n On Sdk Initialization");
166
+
167
+
168
+ });
169
+
170
+
171
+ // Banner Ad EVENT
172
+
173
+ /*
174
+ on.banner.load
175
+ on.banner.failed.load
176
+ on.banner.click
177
+ on.banner.close
178
+ on.banner.impression
179
+ on.banner.open
180
+ on.banner.revenue
181
+ on.banner.remove
182
+ */
183
+
184
+
185
+ document.addEventListener('on.banner.load', () => {
186
+
187
+ event.value += ("\n on.banner.load");
188
+
189
+ });
190
+
191
+ document.addEventListener('on.banner.failed.load', () => {
192
+
193
+ event.value += ("\n on.banner.failed.load");
194
+
195
+ });
196
+
197
+ document.addEventListener('on.banner.click', () => {
198
+
199
+ event.value += ("\n on.banner.click");
200
+
201
+ });
202
+
203
+ document.addEventListener('on.banner.close', () => {
204
+
205
+ event.value += ("\n on.banner.close");
206
+
207
+ });
208
+
209
+ document.addEventListener('on.banner.impression', () => {
210
+
211
+ event.value += ("\n on.banner.impression");
212
+
213
+ });
214
+
215
+ document.addEventListener('on.banner.open', () => {
216
+
217
+ event.value += ("\n on.banner.open");
218
+
219
+ });
220
+
221
+ document.addEventListener('on.banner.revenue', () => {
222
+
223
+ event.value += ("\n on.banner.revenue");
224
+
225
+ });
226
+
227
+ document.addEventListener('on.banner.remove', () => {
228
+
229
+ event.value += ("\n on.banner.remove");
230
+
231
+ });
232
+
233
+
234
+ }, false);
235
+
236
+ </script>
237
+
238
+ <p> <button onclick="loadBannerAdaptive();">load Banner adaptive</button></p>
239
+ <p> <button onclick="loadBannerNotAdaptive();">load Banner No Adaptive</button></p>
240
+ <p> <button onclick="showBannerAd();">show Banner Ad</button></p>
241
+ <p> <button onclick="removeBannerAd();">remove Banner Ad</button></p>
242
+
243
+
244
+ <p> <button onclick="cleanText();">Clean response Text</button></p>
245
+
246
+
247
+ </body>
248
+ </html>