emi-indo-cordova-plugin-admob 1.4.2 → 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 -1
- package/plugin.xml +3 -3
- package/src/android/emiAdmobPlugin.java +1 -1
- package/src/ios/emiAdmobPlugin.h +3 -2
- package/src/ios/emiAdmobPlugin.m +371 -515
- package/www/emiAdmobPlugin.js +20 -18
- package/example/Advanced topics/auto_load_and_show.html +0 -94
package/www/emiAdmobPlugin.js
CHANGED
@@ -1,24 +1,16 @@
|
|
1
1
|
var exec = require('cordova/exec');
|
2
|
+
|
2
3
|
exports.initialize = function (success, error) {
|
3
4
|
exec(success, error, 'emiAdmobPlugin', 'initialize', []);
|
4
5
|
};
|
5
|
-
exports.getIabTfc = function (success, error) {
|
6
|
-
exec(success, error, 'emiAdmobPlugin', 'getIabTfc', []);
|
7
|
-
};
|
8
|
-
exports.showPrivacyOptionsForm = function (success, error) {
|
9
|
-
exec(success, error, 'emiAdmobPlugin', 'showPrivacyOptionsForm', []);
|
10
|
-
};
|
11
6
|
exports.loadAppOpenAd = function (arg0, arg1, success, error) {
|
12
|
-
exec(success, error, 'emiAdmobPlugin', 'loadAppOpenAd',
|
7
|
+
exec(success, error, 'emiAdmobPlugin', 'loadAppOpenAd', arg0, arg1);
|
13
8
|
};
|
14
9
|
exports.showAppOpenAd = function (success, error) {
|
15
10
|
exec(success, error, 'emiAdmobPlugin', 'showAppOpenAd', []);
|
16
11
|
};
|
17
12
|
exports.loadBannerAd = function (arg0, arg1, arg2, arg3, arg4, arg5, success, error) {
|
18
|
-
exec(success, error, 'emiAdmobPlugin', 'loadBannerAd',
|
19
|
-
};
|
20
|
-
exports.requestIDFA = function (success, error) {
|
21
|
-
exec(success, error, 'emiAdmobPlugin', 'requestIDFA', []);
|
13
|
+
exec(success, error, 'emiAdmobPlugin', 'loadBannerAd', arg0, arg1, arg2, arg3, arg4, arg5);
|
22
14
|
};
|
23
15
|
exports.showBannerAd = function (success, error) {
|
24
16
|
exec(success, error, 'emiAdmobPlugin', 'showBannerAd', []);
|
@@ -30,23 +22,26 @@ exports.removeBannerAd = function (arg0, success, error) {
|
|
30
22
|
exec(success, error, 'emiAdmobPlugin', 'removeBannerAd', [arg0]);
|
31
23
|
};
|
32
24
|
exports.loadInterstitialAd = function (arg0, arg1, success, error) {
|
33
|
-
exec(success, error, 'emiAdmobPlugin', 'loadInterstitialAd',
|
25
|
+
exec(success, error, 'emiAdmobPlugin', 'loadInterstitialAd', arg0, arg1);
|
34
26
|
};
|
35
27
|
exports.showInterstitialAd = function (success, error) {
|
36
28
|
exec(success, error, 'emiAdmobPlugin', 'showInterstitialAd', []);
|
37
29
|
};
|
38
30
|
exports.loadRewardedAd = function (arg0, arg1, success, error) {
|
39
|
-
exec(success, error, 'emiAdmobPlugin', 'loadRewardedAd',
|
31
|
+
exec(success, error, 'emiAdmobPlugin', 'loadRewardedAd', arg0, arg1);
|
40
32
|
};
|
41
33
|
exports.showRewardedAd = function (success, error) {
|
42
34
|
exec(success, error, 'emiAdmobPlugin', 'showRewardedAd', []);
|
43
35
|
};
|
44
36
|
exports.loadRewardedInterstitialAd = function (arg0, arg1, success, error) {
|
45
|
-
exec(success, error, 'emiAdmobPlugin', 'loadRewardedInterstitialAd',
|
37
|
+
exec(success, error, 'emiAdmobPlugin', 'loadRewardedInterstitialAd', arg0, arg1);
|
46
38
|
};
|
47
39
|
exports.showRewardedInterstitialAd = function (success, error) {
|
48
40
|
exec(success, error, 'emiAdmobPlugin', 'showRewardedInterstitialAd', []);
|
49
41
|
};
|
42
|
+
exports.requestIDFA = function (success, error) {
|
43
|
+
exec(success, error, 'emiAdmobPlugin', 'requestIDFA', []);
|
44
|
+
};
|
50
45
|
exports.getConsentRequest = function (success, error) {
|
51
46
|
exec(success, error, 'emiAdmobPlugin', 'getConsentRequest', []);
|
52
47
|
};
|
@@ -54,8 +49,15 @@ exports.consentReset = function (success, error) {
|
|
54
49
|
exec(success, error, 'emiAdmobPlugin', 'consentReset', []);
|
55
50
|
};
|
56
51
|
exports.targeting = function (arg0, arg1, arg2, success, error) {
|
57
|
-
exec(success, error, 'emiAdmobPlugin', 'targeting',
|
52
|
+
exec(success, error, 'emiAdmobPlugin', 'targeting', arg0, arg1, arg2);
|
53
|
+
};
|
54
|
+
exports.getIabTfc = function (success, error) {
|
55
|
+
exec(success, error, 'emiAdmobPlugin', 'getIabTfc', []);
|
56
|
+
};
|
57
|
+
exports.showPrivacyOptionsForm = function (success, error) {
|
58
|
+
exec(success, error, 'emiAdmobPlugin', 'showPrivacyOptionsForm', []);
|
59
|
+
};
|
60
|
+
exports.globalSettings = function (arg0, arg1, arg2, arg3, arg4, arg5, success, error) {
|
61
|
+
exec(success, error, 'emiAdmobPlugin', 'globalSettings', arg0, arg1, arg2, arg3, arg4, arg5);
|
58
62
|
};
|
59
|
-
|
60
|
-
exec(success, error, 'emiAdmobPlugin', 'globalSettings', [arg0, arg1, arg2, arg3, arg4]);
|
61
|
-
};
|
63
|
+
|
@@ -1,94 +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
|
-
// For example automatically load Interstitial Ad
|
11
|
-
|
12
|
-
// Load Interstitial Ad
|
13
|
-
|
14
|
-
let loadInterstitialAd = () => {
|
15
|
-
cordova.plugins.emiAdmobPlugin.loadInterstitialAd(
|
16
|
-
AdUnitId = "ca-app-pub-3940256099942544/1033173712",
|
17
|
-
npa = "1", // String | 0 | 1
|
18
|
-
responseInfo = true, // boolean
|
19
|
-
|
20
|
-
// Optional
|
21
|
-
(info) => { alert(info) },
|
22
|
-
(error) => { alert(error)
|
23
|
-
|
24
|
-
});
|
25
|
-
|
26
|
-
// call loadInterstitialAd();
|
27
|
-
}
|
28
|
-
|
29
|
-
// Show Interstitial Ad
|
30
|
-
|
31
|
-
let showInterstitialAd = () => {
|
32
|
-
cordova.plugins.emiAdmobPlugin.showInterstitialAd();
|
33
|
-
|
34
|
-
// call showInterstitialAd();
|
35
|
-
}
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
// deviceready
|
41
|
-
|
42
|
-
document.addEventListener("deviceready", function(){
|
43
|
-
|
44
|
-
// Before loading ads, have your app initialize the Google Mobile Ads SDK by calling
|
45
|
-
// This needs to be done only once, ideally at app launch.
|
46
|
-
|
47
|
-
cordova.plugins.emiAdmobPlugin.initialize();
|
48
|
-
|
49
|
-
|
50
|
-
// auto load call loadInterstitialAd();
|
51
|
-
|
52
|
-
loadInterstitialAd();
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
// Interstitial EVENT
|
58
|
-
|
59
|
-
/*
|
60
|
-
on.interstitial.loaded
|
61
|
-
on.interstitial.failed.load
|
62
|
-
on.interstitial.click
|
63
|
-
on.interstitial.dismissed
|
64
|
-
on.interstitial.failed.show
|
65
|
-
on.interstitial.impression
|
66
|
-
on.interstitial.show
|
67
|
-
on.interstitial.revenue
|
68
|
-
*/
|
69
|
-
|
70
|
-
document.addEventListener('on.interstitial.loaded', () => {
|
71
|
-
|
72
|
-
// auto show call showInterstitialAd();
|
73
|
-
|
74
|
-
showInterstitialAd();
|
75
|
-
|
76
|
-
console.log("on Interstitial Ad Loaded");
|
77
|
-
|
78
|
-
});
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
}, false);
|
84
|
-
|
85
|
-
</script>
|
86
|
-
|
87
|
-
|
88
|
-
<p> <button onclick="loadInterstitialAd();">Load Interstitial Ad</button></p>
|
89
|
-
<p> <button onclick="showInterstitialAd();">Show Interstitial Ad</button></p>
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
</body>
|
94
|
-
</html>
|