emi-indo-cordova-plugin-admob 1.3.9 → 1.4.1
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 +36 -34
- package/plugin.xml +307 -284
- package/src/android/emiAdmobPlugin.java +1 -1
- package/src/ios/emiAdmobPlugin.h +33 -0
- package/src/ios/emiAdmobPlugin.m +554 -0
- package/www/emiAdmobPlugin.js +14 -10
- package/src/ios/emiAdmobPlugin.swift +0 -286
@@ -1,184 +1,184 @@
|
|
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 Rewarded Interstitial Ad
|
21
|
-
|
22
|
-
let loadRewardedInterstitialAd = () => {
|
23
|
-
cordova.plugins.emiAdmobPlugin.loadRewardedInterstitialAd(
|
24
|
-
AdUnitId = "ca-app-pub-3940256099942544/5354046379",
|
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.rewardedInt.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
|
-
|
56
|
-
|
57
|
-
// Show Rewarded Interstitial Ad
|
58
|
-
|
59
|
-
const showRewardedInterstitialAd = () => {
|
60
|
-
cordova.plugins.emiAdmobPlugin.showRewardedInterstitialAd();
|
61
|
-
}
|
62
|
-
|
63
|
-
|
64
|
-
///// >>>>>> Device Ready <<<<<<
|
65
|
-
|
66
|
-
|
67
|
-
document.addEventListener("deviceready", function(){
|
68
|
-
|
69
|
-
// Before loading ads, have your app initialize the Google Mobile Ads SDK by calling
|
70
|
-
// This needs to be done only once, ideally at app launch.
|
71
|
-
|
72
|
-
cordova.plugins.emiAdmobPlugin.initialize(
|
73
|
-
// Optional
|
74
|
-
(info) => {
|
75
|
-
event.value += (info)
|
76
|
-
},
|
77
|
-
(error) => {
|
78
|
-
|
79
|
-
event.value += (error)
|
80
|
-
|
81
|
-
});
|
82
|
-
|
83
|
-
// SDK EVENT Initialization
|
84
|
-
|
85
|
-
document.addEventListener('on.sdkInitialization', () => {
|
86
|
-
|
87
|
-
event.value += ("\n On Sdk Initialization");
|
88
|
-
|
89
|
-
|
90
|
-
});
|
91
|
-
|
92
|
-
|
93
|
-
// Rewarded Interstitial Ad EVENT
|
94
|
-
|
95
|
-
/*
|
96
|
-
on.rewardedInt.loaded
|
97
|
-
on.rewardedInt.failed.load
|
98
|
-
on.rewardedInt.click
|
99
|
-
on.rewardedInt.dismissed
|
100
|
-
on.rewardedInt.failed.show
|
101
|
-
on.rewardedInt.impression
|
102
|
-
on.rewardedInt.showed
|
103
|
-
on.rewardedInt.revenue
|
104
|
-
on.rewardedInt.ad.skip
|
105
|
-
on.rewardedInt.userEarnedReward
|
106
|
-
*/
|
107
|
-
|
108
|
-
|
109
|
-
document.addEventListener('on.rewardedInt.loaded', () => {
|
110
|
-
|
111
|
-
event.value += ("\n on.rewardedInt.loaded");
|
112
|
-
|
113
|
-
});
|
114
|
-
|
115
|
-
document.addEventListener('on.rewardedInt.failed.load', () => {
|
116
|
-
|
117
|
-
event.value += ("\n on.rewardedInt.failed.load");
|
118
|
-
|
119
|
-
});
|
120
|
-
|
121
|
-
document.addEventListener('on.rewardedInt.click', () => {
|
122
|
-
|
123
|
-
event.value += ("\n on.rewardedInt.click");
|
124
|
-
|
125
|
-
});
|
126
|
-
|
127
|
-
document.addEventListener('on.rewardedInt.dismissed', () => {
|
128
|
-
|
129
|
-
event.value += ("\n on.rewardedInt.dismissed");
|
130
|
-
|
131
|
-
});
|
132
|
-
|
133
|
-
document.addEventListener('on.rewardedInt.failed.show', () => {
|
134
|
-
|
135
|
-
event.value += ("\n on.rewardedInt.failed.show");
|
136
|
-
|
137
|
-
});
|
138
|
-
|
139
|
-
document.addEventListener('on.rewardedInt.impression', () => {
|
140
|
-
|
141
|
-
event.value += ("\n on.rewardedInt.impression");
|
142
|
-
|
143
|
-
});
|
144
|
-
|
145
|
-
document.addEventListener('on.rewardedInt.showed', () => {
|
146
|
-
|
147
|
-
event.value += ("\n on.rewardedInt.showed");
|
148
|
-
|
149
|
-
});
|
150
|
-
|
151
|
-
document.addEventListener('on.rewardedInt.revenue', () => {
|
152
|
-
|
153
|
-
event.value += ("\n on.rewardedInt.revenue");
|
154
|
-
|
155
|
-
});
|
156
|
-
|
157
|
-
document.addEventListener('on.rewardedInt.ad.skip', () => {
|
158
|
-
|
159
|
-
event.value += ("\n on.rewardedInt.ad.skip");
|
160
|
-
|
161
|
-
});
|
162
|
-
|
163
|
-
|
164
|
-
document.addEventListener('on.rewardedInt.userEarnedReward', () => {
|
165
|
-
|
166
|
-
event.value += ("\n on.rewardedInt.userEarnedReward");
|
167
|
-
|
168
|
-
});
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
}, false);
|
173
|
-
|
174
|
-
</script>
|
175
|
-
|
176
|
-
<p> <button onclick="loadRewardedInterstitialAd();">Load Rewarded Interstitial</button></p>
|
177
|
-
<p> <button onclick="showRewardedInterstitialAd();">Show Rewarded Interstitial</button></p>
|
178
|
-
|
179
|
-
|
180
|
-
<p> <button onclick="cleanText();">Clean response Text</button></p>
|
181
|
-
|
182
|
-
|
183
|
-
</body>
|
184
|
-
</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 Rewarded Interstitial Ad
|
21
|
+
|
22
|
+
let loadRewardedInterstitialAd = () => {
|
23
|
+
cordova.plugins.emiAdmobPlugin.loadRewardedInterstitialAd(
|
24
|
+
AdUnitId = "ca-app-pub-3940256099942544/5354046379",
|
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.rewardedInt.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
|
+
|
56
|
+
|
57
|
+
// Show Rewarded Interstitial Ad
|
58
|
+
|
59
|
+
const showRewardedInterstitialAd = () => {
|
60
|
+
cordova.plugins.emiAdmobPlugin.showRewardedInterstitialAd();
|
61
|
+
}
|
62
|
+
|
63
|
+
|
64
|
+
///// >>>>>> Device Ready <<<<<<
|
65
|
+
|
66
|
+
|
67
|
+
document.addEventListener("deviceready", function(){
|
68
|
+
|
69
|
+
// Before loading ads, have your app initialize the Google Mobile Ads SDK by calling
|
70
|
+
// This needs to be done only once, ideally at app launch.
|
71
|
+
|
72
|
+
cordova.plugins.emiAdmobPlugin.initialize(
|
73
|
+
// Optional
|
74
|
+
(info) => {
|
75
|
+
event.value += (info)
|
76
|
+
},
|
77
|
+
(error) => {
|
78
|
+
|
79
|
+
event.value += (error)
|
80
|
+
|
81
|
+
});
|
82
|
+
|
83
|
+
// SDK EVENT Initialization
|
84
|
+
|
85
|
+
document.addEventListener('on.sdkInitialization', () => {
|
86
|
+
|
87
|
+
event.value += ("\n On Sdk Initialization");
|
88
|
+
|
89
|
+
|
90
|
+
});
|
91
|
+
|
92
|
+
|
93
|
+
// Rewarded Interstitial Ad EVENT
|
94
|
+
|
95
|
+
/*
|
96
|
+
on.rewardedInt.loaded
|
97
|
+
on.rewardedInt.failed.load
|
98
|
+
on.rewardedInt.click
|
99
|
+
on.rewardedInt.dismissed
|
100
|
+
on.rewardedInt.failed.show
|
101
|
+
on.rewardedInt.impression
|
102
|
+
on.rewardedInt.showed
|
103
|
+
on.rewardedInt.revenue
|
104
|
+
on.rewardedInt.ad.skip
|
105
|
+
on.rewardedInt.userEarnedReward
|
106
|
+
*/
|
107
|
+
|
108
|
+
|
109
|
+
document.addEventListener('on.rewardedInt.loaded', () => {
|
110
|
+
|
111
|
+
event.value += ("\n on.rewardedInt.loaded");
|
112
|
+
|
113
|
+
});
|
114
|
+
|
115
|
+
document.addEventListener('on.rewardedInt.failed.load', () => {
|
116
|
+
|
117
|
+
event.value += ("\n on.rewardedInt.failed.load");
|
118
|
+
|
119
|
+
});
|
120
|
+
|
121
|
+
document.addEventListener('on.rewardedInt.click', () => {
|
122
|
+
|
123
|
+
event.value += ("\n on.rewardedInt.click");
|
124
|
+
|
125
|
+
});
|
126
|
+
|
127
|
+
document.addEventListener('on.rewardedInt.dismissed', () => {
|
128
|
+
|
129
|
+
event.value += ("\n on.rewardedInt.dismissed");
|
130
|
+
|
131
|
+
});
|
132
|
+
|
133
|
+
document.addEventListener('on.rewardedInt.failed.show', () => {
|
134
|
+
|
135
|
+
event.value += ("\n on.rewardedInt.failed.show");
|
136
|
+
|
137
|
+
});
|
138
|
+
|
139
|
+
document.addEventListener('on.rewardedInt.impression', () => {
|
140
|
+
|
141
|
+
event.value += ("\n on.rewardedInt.impression");
|
142
|
+
|
143
|
+
});
|
144
|
+
|
145
|
+
document.addEventListener('on.rewardedInt.showed', () => {
|
146
|
+
|
147
|
+
event.value += ("\n on.rewardedInt.showed");
|
148
|
+
|
149
|
+
});
|
150
|
+
|
151
|
+
document.addEventListener('on.rewardedInt.revenue', () => {
|
152
|
+
|
153
|
+
event.value += ("\n on.rewardedInt.revenue");
|
154
|
+
|
155
|
+
});
|
156
|
+
|
157
|
+
document.addEventListener('on.rewardedInt.ad.skip', () => {
|
158
|
+
|
159
|
+
event.value += ("\n on.rewardedInt.ad.skip");
|
160
|
+
|
161
|
+
});
|
162
|
+
|
163
|
+
|
164
|
+
document.addEventListener('on.rewardedInt.userEarnedReward', () => {
|
165
|
+
|
166
|
+
event.value += ("\n on.rewardedInt.userEarnedReward");
|
167
|
+
|
168
|
+
});
|
169
|
+
|
170
|
+
|
171
|
+
|
172
|
+
}, false);
|
173
|
+
|
174
|
+
</script>
|
175
|
+
|
176
|
+
<p> <button onclick="loadRewardedInterstitialAd();">Load Rewarded Interstitial</button></p>
|
177
|
+
<p> <button onclick="showRewardedInterstitialAd();">Show Rewarded Interstitial</button></p>
|
178
|
+
|
179
|
+
|
180
|
+
<p> <button onclick="cleanText();">Clean response Text</button></p>
|
181
|
+
|
182
|
+
|
183
|
+
</body>
|
184
|
+
</html>
|
package/package.json
CHANGED
@@ -1,34 +1,36 @@
|
|
1
|
-
{
|
2
|
-
"name": "emi-indo-cordova-plugin-admob",
|
3
|
-
"version": "1.
|
4
|
-
"description": "Cordova Plugin Admob Android",
|
5
|
-
"cordova": {
|
6
|
-
"id": "emi-indo-cordova-plugin-admob",
|
7
|
-
"platforms": [
|
8
|
-
"android",
|
9
|
-
"ios"
|
10
|
-
]
|
11
|
-
},
|
12
|
-
"keywords": [
|
13
|
-
"ecosystem:cordova",
|
14
|
-
"cordova-android",
|
15
|
-
"javascript",
|
16
|
-
"admob",
|
17
|
-
"cordova-plugin-admob",
|
18
|
-
"cordova-admob-free",
|
19
|
-
"cordova-admob-plus",
|
20
|
-
"cordova-admob-pro",
|
21
|
-
"
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
"
|
26
|
-
"
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
}
|
1
|
+
{
|
2
|
+
"name": "emi-indo-cordova-plugin-admob",
|
3
|
+
"version": "1.4.1",
|
4
|
+
"description": "Cordova Plugin Admob Android IOS",
|
5
|
+
"cordova": {
|
6
|
+
"id": "emi-indo-cordova-plugin-admob",
|
7
|
+
"platforms": [
|
8
|
+
"android",
|
9
|
+
"ios"
|
10
|
+
]
|
11
|
+
},
|
12
|
+
"keywords": [
|
13
|
+
"ecosystem:cordova",
|
14
|
+
"cordova-android",
|
15
|
+
"javascript",
|
16
|
+
"admob",
|
17
|
+
"cordova-plugin-admob",
|
18
|
+
"cordova-admob-free",
|
19
|
+
"cordova-admob-plus",
|
20
|
+
"cordova-admob-pro",
|
21
|
+
"cordova-admob-ios",
|
22
|
+
"cordova-admob-android"
|
23
|
+
|
24
|
+
],
|
25
|
+
"author": "EMI INDO",
|
26
|
+
"email": "cordova.c3addon@gmail.com",
|
27
|
+
"license": "ISC",
|
28
|
+
"repository": {
|
29
|
+
"type": "git",
|
30
|
+
"url": "git+https://github.com/EMI-INDO/emi-indo-cordova-plugin-admob.git"
|
31
|
+
},
|
32
|
+
"bugs": {
|
33
|
+
"url": "https://github.com/EMI-INDO/emi-indo-cordova-plugin-admob/issues"
|
34
|
+
},
|
35
|
+
"homepage": "https://github.com/EMI-INDO/emi-indo-cordova-plugin-admob#readme"
|
36
|
+
}
|