emi-indo-cordova-plugin-admob 1.4.8 → 1.5.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/ISSUE_TEMPLATE/bug_report.md +3 -0
- package/README.md +525 -82
- package/package.json +2 -1
- package/plugin.xml +302 -309
- package/src/android/emiAdmobPlugin.kt +1843 -0
- package/src/ios/emiAdmobPlugin.h +6 -2
- package/src/ios/emiAdmobPlugin.m +1646 -2560
- package/www/emiAdmobPlugin.js +42 -17
- package/example/Advanced topics/IABTFC.html +0 -187
- package/example/Advanced topics/consent.html +0 -156
- package/example/Advanced topics/globalSettings.html +0 -49
- package/example/Advanced topics/requestIDFA.html +0 -59
- package/example/Advanced topics/targeting.html +0 -64
- package/example/app_open_ads.html +0 -128
- package/example/banner_ads.html +0 -213
- package/example/interstitial_ads.html +0 -150
- package/example/rewarded_ads.html +0 -169
- package/example/rewarded_interstitial_ads.html +0 -167
- package/example/wewrtr.html +0 -0
- package/src/android/emiAdmobPlugin.java +0 -1
package/www/emiAdmobPlugin.js
CHANGED
@@ -1,16 +1,19 @@
|
|
1
1
|
var exec = require('cordova/exec');
|
2
2
|
|
3
|
-
exports.initialize = function (success, error) {
|
4
|
-
exec(success, error, 'emiAdmobPlugin', 'initialize', []);
|
3
|
+
exports.initialize = function (options, success, error) {
|
4
|
+
exec(success, error, 'emiAdmobPlugin', 'initialize', [options]);
|
5
5
|
};
|
6
|
-
exports.loadAppOpenAd = function (
|
7
|
-
exec(success, error, 'emiAdmobPlugin', 'loadAppOpenAd',
|
6
|
+
exports.loadAppOpenAd = function (options, success, error) {
|
7
|
+
exec(success, error, 'emiAdmobPlugin', 'loadAppOpenAd', [options]);
|
8
8
|
};
|
9
9
|
exports.showAppOpenAd = function (success, error) {
|
10
10
|
exec(success, error, 'emiAdmobPlugin', 'showAppOpenAd', []);
|
11
11
|
};
|
12
|
-
exports.
|
13
|
-
exec(success, error, 'emiAdmobPlugin', '
|
12
|
+
exports.styleBannerAd = function (options, success, error) {
|
13
|
+
exec(success, error, 'emiAdmobPlugin', 'styleBannerAd', [options]); // v1.4.9 ( only Android )
|
14
|
+
};
|
15
|
+
exports.loadBannerAd = function (options, success, error) {
|
16
|
+
exec(success, error, 'emiAdmobPlugin', 'loadBannerAd', [options]);
|
14
17
|
};
|
15
18
|
exports.showBannerAd = function (success, error) {
|
16
19
|
exec(success, error, 'emiAdmobPlugin', 'showBannerAd', []);
|
@@ -21,20 +24,20 @@ exports.hideBannerAd = function (success, error) {
|
|
21
24
|
exports.removeBannerAd = function (arg0, success, error) {
|
22
25
|
exec(success, error, 'emiAdmobPlugin', 'removeBannerAd', [arg0]);
|
23
26
|
};
|
24
|
-
exports.loadInterstitialAd = function (
|
25
|
-
exec(success, error, 'emiAdmobPlugin', 'loadInterstitialAd',
|
27
|
+
exports.loadInterstitialAd = function (options, success, error) {
|
28
|
+
exec(success, error, 'emiAdmobPlugin', 'loadInterstitialAd', [options]);
|
26
29
|
};
|
27
30
|
exports.showInterstitialAd = function (success, error) {
|
28
31
|
exec(success, error, 'emiAdmobPlugin', 'showInterstitialAd', []);
|
29
32
|
};
|
30
|
-
exports.loadRewardedAd = function (
|
31
|
-
exec(success, error, 'emiAdmobPlugin', 'loadRewardedAd',
|
33
|
+
exports.loadRewardedAd = function (options, success, error) {
|
34
|
+
exec(success, error, 'emiAdmobPlugin', 'loadRewardedAd', [options]);
|
32
35
|
};
|
33
36
|
exports.showRewardedAd = function (success, error) {
|
34
37
|
exec(success, error, 'emiAdmobPlugin', 'showRewardedAd', []);
|
35
38
|
};
|
36
|
-
exports.loadRewardedInterstitialAd = function (
|
37
|
-
exec(success, error, 'emiAdmobPlugin', 'loadRewardedInterstitialAd',
|
39
|
+
exports.loadRewardedInterstitialAd = function (options, success, error) {
|
40
|
+
exec(success, error, 'emiAdmobPlugin', 'loadRewardedInterstitialAd', [options]);
|
38
41
|
};
|
39
42
|
exports.showRewardedInterstitialAd = function (success, error) {
|
40
43
|
exec(success, error, 'emiAdmobPlugin', 'showRewardedInterstitialAd', []);
|
@@ -48,8 +51,8 @@ exports.getConsentRequest = function (success, error) {
|
|
48
51
|
exports.consentReset = function (success, error) {
|
49
52
|
exec(success, error, 'emiAdmobPlugin', 'consentReset', []);
|
50
53
|
};
|
51
|
-
exports.targeting = function (
|
52
|
-
exec(success, error, 'emiAdmobPlugin', 'targeting',
|
54
|
+
exports.targeting = function (options, success, error) {
|
55
|
+
exec(success, error, 'emiAdmobPlugin', 'targeting', [options]);
|
53
56
|
};
|
54
57
|
exports.getIabTfc = function (success, error) {
|
55
58
|
exec(success, error, 'emiAdmobPlugin', 'getIabTfc', []);
|
@@ -57,6 +60,28 @@ exports.getIabTfc = function (success, error) {
|
|
57
60
|
exports.showPrivacyOptionsForm = function (success, error) {
|
58
61
|
exec(success, error, 'emiAdmobPlugin', 'showPrivacyOptionsForm', []);
|
59
62
|
};
|
60
|
-
exports.globalSettings = function (
|
61
|
-
exec(success, error, 'emiAdmobPlugin', 'globalSettings',
|
62
|
-
};
|
63
|
+
exports.globalSettings = function (options, success, error) {
|
64
|
+
exec(success, error, 'emiAdmobPlugin', 'globalSettings', [options]);
|
65
|
+
};
|
66
|
+
exports.forceDisplayPrivacyForm = function (success, error) {
|
67
|
+
exec(success, error, 'emiAdmobPlugin', 'forceDisplayPrivacyForm', []); // only IOS
|
68
|
+
};
|
69
|
+
|
70
|
+
|
71
|
+
// v1.4.9 ( only Android )
|
72
|
+
// only isUsingAdManagerRequest: true
|
73
|
+
// AdManagerAdRequest.Builder
|
74
|
+
exports.targetingAdRequest = function (options, success, error) {
|
75
|
+
exec(success, error, 'emiAdmobPlugin', 'targetingAdRequest', [options]);
|
76
|
+
};
|
77
|
+
exports.setPersonalizationState = function (options, success, error) {
|
78
|
+
exec(success, error, 'emiAdmobPlugin', 'setPersonalizationState', [options]);
|
79
|
+
};
|
80
|
+
exports.setPPS = function (options, success, error) {
|
81
|
+
exec(success, error, 'emiAdmobPlugin', 'setPPS', [options]);
|
82
|
+
};
|
83
|
+
|
84
|
+
|
85
|
+
|
86
|
+
|
87
|
+
|
@@ -1,187 +0,0 @@
|
|
1
|
-
<html>
|
2
|
-
|
3
|
-
<head>
|
4
|
-
<script type="text/javascript" src="cordova.js"></script>
|
5
|
-
</head>
|
6
|
-
|
7
|
-
<body>
|
8
|
-
|
9
|
-
<label for="event">Debug Event All response :</label>
|
10
|
-
<textarea id="event" name="event" rows="15" cols="40"></textarea>
|
11
|
-
|
12
|
-
<script>
|
13
|
-
|
14
|
-
let event = document.getElementById('event');
|
15
|
-
|
16
|
-
let cleanText = () => { event.value = '' };
|
17
|
-
|
18
|
-
// Load Rewarded Ad
|
19
|
-
let loadRewardedAd = () => {
|
20
|
-
cordova.plugins.emiAdmobPlugin.loadRewardedAd([adUnitId = "ca-app-pub-3940256099942544/5224354917", autoShow = true ]);
|
21
|
-
// call loadRewardedAd();
|
22
|
-
}
|
23
|
-
|
24
|
-
// Show Rewarded Ad
|
25
|
-
let showRewardedAd = () => {
|
26
|
-
cordova.plugins.emiAdmobPlugin.showRewardedAd();
|
27
|
-
// call showRewardedAd();
|
28
|
-
}
|
29
|
-
|
30
|
-
// >>>>>>>> User Messaging Platform (UMP) SDK 2.1.0
|
31
|
-
|
32
|
-
let getConsentRequest = () => {
|
33
|
-
// https://developers.google.com/admob/android/privacy
|
34
|
-
cordova.plugins.emiAdmobPlugin.getConsentRequest(
|
35
|
-
|
36
|
-
(ststus) => {
|
37
|
-
|
38
|
-
event.value += "\n Consent Status: " + ststus;
|
39
|
-
|
40
|
-
},
|
41
|
-
(error) => {
|
42
|
-
|
43
|
-
event.value += "\n Error: " + error
|
44
|
-
|
45
|
-
});
|
46
|
-
|
47
|
-
}
|
48
|
-
|
49
|
-
|
50
|
-
let consentReset = () => {
|
51
|
-
cordova.plugins.emiAdmobPlugin.consentReset();
|
52
|
-
}
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
// >>>>>>>> New features (UMP) SDK v2.1.0
|
57
|
-
let showPrivacyOptionsForm = () => {
|
58
|
-
|
59
|
-
cordova.plugins.emiAdmobPlugin.showPrivacyOptionsForm(
|
60
|
-
|
61
|
-
(info) => {
|
62
|
-
|
63
|
-
event.value += "\n Show Privacy Option Form: " + info;
|
64
|
-
|
65
|
-
},
|
66
|
-
(error) => {
|
67
|
-
|
68
|
-
event.value += "\n Error: " + error
|
69
|
-
|
70
|
-
});
|
71
|
-
|
72
|
-
}
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
/*
|
77
|
-
IAB Europe Transparency & Consent Framework
|
78
|
-
Final v.2.2 May 2023
|
79
|
-
*/
|
80
|
-
// >>>>>>>> New features (UMP) SDK v2.1.0
|
81
|
-
// https://developers.google.com/admob/android/privacy/gdpr
|
82
|
-
let getIabTfc = () => {
|
83
|
-
|
84
|
-
cordova.plugins.emiAdmobPlugin.getIabTfc(
|
85
|
-
/*
|
86
|
-
If the user chooses not to display ads,
|
87
|
-
you can restrict access to the app, or ban it,
|
88
|
-
until they change their decision back,
|
89
|
-
Just call showPrivacyOptionsForm();
|
90
|
-
*/
|
91
|
-
(info) => {
|
92
|
-
// How to read consent choices
|
93
|
-
event.value += "\n IABTCF_gdprApplies: " + info.IABTCF_gdprApplies;
|
94
|
-
event.value += "\n IABTCF_PurposeConsents: " + info.IABTCF_PurposeConsents; // In order for the ad to be displayed this must be filled in
|
95
|
-
event.value += "\n IABTCF_TCString: " + info.IABTCF_TCString; // In order for the ad to be displayed this must be filled in
|
96
|
-
/*
|
97
|
-
// A small example
|
98
|
-
var fundingChoices;
|
99
|
-
|
100
|
-
fundingChoices = info.IABTCF_PurposeConsents;
|
101
|
-
if (fundingChoices === "1111111111"){
|
102
|
-
|
103
|
-
// Enable app features.
|
104
|
-
loadRewardedAd();
|
105
|
-
|
106
|
-
} else if (fundingChoices === "") {
|
107
|
-
|
108
|
-
// disable app features.
|
109
|
-
|
110
|
-
} else {
|
111
|
-
|
112
|
-
// You have to test everything yourself.
|
113
|
-
|
114
|
-
}
|
115
|
-
*/
|
116
|
-
},
|
117
|
-
(error) => {
|
118
|
-
|
119
|
-
event.value += "\n Error: " + error
|
120
|
-
|
121
|
-
});
|
122
|
-
|
123
|
-
}
|
124
|
-
|
125
|
-
|
126
|
-
///// >>>>>> Device Ready <<<<<<
|
127
|
-
|
128
|
-
|
129
|
-
document.addEventListener("deviceready", function () {
|
130
|
-
|
131
|
-
|
132
|
-
const config_Targeting = [
|
133
|
-
|
134
|
-
childDirectedTreatment = 0, // value: 0 | -1 | 1
|
135
|
-
underAgeOfConsent = false, // default: false
|
136
|
-
contentRating = "G" // value: G | MA | PG | T | ""
|
137
|
-
|
138
|
-
]
|
139
|
-
|
140
|
-
|
141
|
-
cordova.plugins.emiAdmobPlugin.targeting(config_Targeting);
|
142
|
-
cordova.plugins.emiAdmobPlugin.initialize();
|
143
|
-
|
144
|
-
|
145
|
-
// Rewarded Ad EVENT
|
146
|
-
|
147
|
-
/*
|
148
|
-
on.rewarded.loaded
|
149
|
-
on.rewarded.failed.load
|
150
|
-
on.rewarded.click
|
151
|
-
on.rewarded.dismissed
|
152
|
-
on.rewarded.failed.show
|
153
|
-
on.rewarded.impression
|
154
|
-
on.rewarded.show
|
155
|
-
on.rewarded.revenue
|
156
|
-
on.rewarded.ad.skip
|
157
|
-
on.reward.userEarnedReward
|
158
|
-
*/
|
159
|
-
|
160
|
-
|
161
|
-
document.addEventListener('on.rewarded.loaded', () => {
|
162
|
-
|
163
|
-
event.value += ("\n on.rewarded.loaded");
|
164
|
-
|
165
|
-
});
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
}, false);
|
170
|
-
|
171
|
-
</script>
|
172
|
-
|
173
|
-
<p> <button onclick="getConsentRequest();">Get Consent Status</button></p>
|
174
|
-
<p> <button onclick="showPrivacyOptionsForm();">Show Privacy Options Form</button></p>
|
175
|
-
<p> <button onclick="getIabTfc();">Get IAB TFC Status</button></p>
|
176
|
-
<p> <button onclick="consentReset();">Consent Reset</button></p>
|
177
|
-
|
178
|
-
<p> <button onclick="loadRewardedAd();">Load Rewarded Ad</button></p>
|
179
|
-
<p> <button onclick="showRewardedAd();">Show Rewarded Ad</button></p>
|
180
|
-
|
181
|
-
|
182
|
-
<p> <button onclick="cleanText();">Clean response Text</button></p>
|
183
|
-
|
184
|
-
|
185
|
-
</body>
|
186
|
-
|
187
|
-
</html>
|
@@ -1,156 +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
|
-
// >>>>>>>> User Messaging Platform (UMP) SDK 2.1.0
|
11
|
-
|
12
|
-
let getConsentStatus = () => {
|
13
|
-
// https://developers.google.com/admob/android/privacy
|
14
|
-
cordova.plugins.emiAdmobPlugin.getConsentRequest(
|
15
|
-
|
16
|
-
(ststus) => {
|
17
|
-
|
18
|
-
event.value += "\n Consent Status: " + ststus;
|
19
|
-
|
20
|
-
},
|
21
|
-
(error) => {
|
22
|
-
|
23
|
-
event.value += "\n Error: " + error
|
24
|
-
|
25
|
-
});
|
26
|
-
|
27
|
-
}
|
28
|
-
|
29
|
-
|
30
|
-
let consentReset = () => {
|
31
|
-
cordova.plugins.emiAdmobPlugin.consentReset();
|
32
|
-
}
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
// >>>>>>>> New features (UMP) SDK v2.1.0
|
37
|
-
let showPrivacyOptionsForm = () => {
|
38
|
-
|
39
|
-
cordova.plugins.emiAdmobPlugin.showPrivacyOptionsForm(
|
40
|
-
|
41
|
-
(info) => {
|
42
|
-
|
43
|
-
event.value += "\n Show Privacy Option Form: " + info;
|
44
|
-
|
45
|
-
},
|
46
|
-
(error) => {
|
47
|
-
|
48
|
-
event.value += "\n Error: " + error
|
49
|
-
|
50
|
-
});
|
51
|
-
|
52
|
-
}
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
///// >>>>>> Device Ready <<<<<<
|
57
|
-
|
58
|
-
document.addEventListener("deviceready", function(){
|
59
|
-
|
60
|
-
// WARNING config must be an array[] not an object{}
|
61
|
-
const config_Targeting = [
|
62
|
-
|
63
|
-
childDirectedTreatment = 0, // value: 0 | -1 | 1
|
64
|
-
underAgeOfConsent = false, // default: false
|
65
|
-
contentRating = "G" // value: G | MA | PG | T | ""
|
66
|
-
|
67
|
-
]
|
68
|
-
|
69
|
-
|
70
|
-
cordova.plugins.emiAdmobPlugin.targeting(config_Targeting);
|
71
|
-
|
72
|
-
// Must be under globalSetting and targeting
|
73
|
-
cordova.plugins.emiAdmobPlugin.initialize();
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
// Optional Consent Event
|
84
|
-
|
85
|
-
/*
|
86
|
-
|
87
|
-
|
88
|
-
on.consent.info.update
|
89
|
-
on.consent.info.update.failed
|
90
|
-
|
91
|
-
on.consent.status.not_required
|
92
|
-
on.consent.status.obtained
|
93
|
-
on.consent.status.required
|
94
|
-
on.consent.status.unknown
|
95
|
-
|
96
|
-
on.consent.failed.show
|
97
|
-
on.consent.failed.load.from
|
98
|
-
on.consent.form.not.available
|
99
|
-
*/
|
100
|
-
|
101
|
-
|
102
|
-
document.addEventListener('on.consent.info.update', () => {
|
103
|
-
|
104
|
-
alert("on.consent.info.update");
|
105
|
-
|
106
|
-
});
|
107
|
-
|
108
|
-
document.addEventListener('on.consent.info.update.failed', () => {
|
109
|
-
|
110
|
-
alert("on.consent.info.update.failed");
|
111
|
-
|
112
|
-
});
|
113
|
-
|
114
|
-
////////////////////////////////////////////////
|
115
|
-
|
116
|
-
// https://developers.google.com/admob/android/privacy/api/reference/com/google/android/ump/ConsentInformation.ConsentStatus
|
117
|
-
|
118
|
-
document.addEventListener('on.consent.status.not_required', () => {
|
119
|
-
// Constant Value: 1
|
120
|
-
alert("User consent not required.");
|
121
|
-
|
122
|
-
});
|
123
|
-
|
124
|
-
document.addEventListener('on.consent.status.obtained', () => {
|
125
|
-
// Constant Value: 3
|
126
|
-
alert("User consent obtained. Personalized vs non-personalized undefined.");
|
127
|
-
|
128
|
-
});
|
129
|
-
|
130
|
-
document.addEventListener('on.consent.status.required', () => {
|
131
|
-
// Constant Value: 2
|
132
|
-
// is Consent Form Available = the code auto, load Consent Form and consent Form show.
|
133
|
-
alert("User consent required but not yet obtained.");
|
134
|
-
|
135
|
-
});
|
136
|
-
|
137
|
-
document.addEventListener('on.consent.status.unknown', () => {
|
138
|
-
//Constant Value: 0
|
139
|
-
alert("Consent status is unknown.");
|
140
|
-
|
141
|
-
});
|
142
|
-
|
143
|
-
}, false);
|
144
|
-
</script>
|
145
|
-
|
146
|
-
<p> <button onclick="getConsentStatus();">Get Consent Status</button></p>
|
147
|
-
<p> <button onclick="showPrivacyOptionsForm();">Show Privacy Options Form</button></p>
|
148
|
-
<p> <button onclick="consentReset();">Consent Reset</button></p>
|
149
|
-
|
150
|
-
<p> <button onclick="_consentReset();">Consent reset</button></p>
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
</body>
|
156
|
-
</html>
|
@@ -1,49 +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
|
-
// ### As suggested by Google, when the SDK initializes this plugin automatically takes the Global Settings and Targeting values.
|
11
|
-
|
12
|
-
// ### Global Settings
|
13
|
-
|
14
|
-
///// >>>>>> Device Ready <<<<<<
|
15
|
-
|
16
|
-
document.addEventListener("deviceready", function(){
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
// Instruction: https://developers.google.com/admob/android/global-settings
|
21
|
-
|
22
|
-
// WARNING config must be an array[] not an object{}
|
23
|
-
const config_globalSettings = [
|
24
|
-
|
25
|
-
// DEPRECATED enableSameAppKey
|
26
|
-
setAppMuted = false, // Type Boolean default: false
|
27
|
-
setAppVolume = 1.0, // Type float default: 1
|
28
|
-
publisherFirstPartyIdEnabled = true, // Type Boolean default: true // enableSameAppKey
|
29
|
-
npa = "1", // string "0" | "1" // DEPRECATED Beginning January 16, 2024
|
30
|
-
enableCollapsible = true, // (BETA) activate the collapsible banner ads
|
31
|
-
responseInfo = false, // For debugging and logging purposes
|
32
|
-
setDebugGeography = false // default: false
|
33
|
-
|
34
|
-
]
|
35
|
-
|
36
|
-
cordova.plugins.emiAdmobPlugin.globalSettings(config_globalSettings);
|
37
|
-
|
38
|
-
// Before loading ads, have your app initialize the Google Mobile Ads SDK by calling
|
39
|
-
// This needs to be done only once, ideally at app launch.
|
40
|
-
|
41
|
-
// Must be under globalSetting and targeting
|
42
|
-
cordova.plugins.emiAdmobPlugin.initialize();
|
43
|
-
|
44
|
-
}, false);
|
45
|
-
</script>
|
46
|
-
|
47
|
-
|
48
|
-
</body>
|
49
|
-
</html>
|
@@ -1,59 +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
|
-
|
11
|
-
///// >>>>>> Device Ready <<<<<<
|
12
|
-
|
13
|
-
document.addEventListener("deviceready", function(){
|
14
|
-
|
15
|
-
// WARNING config must be an array[] not an object{}
|
16
|
-
const config_Targeting = [
|
17
|
-
|
18
|
-
childDirectedTreatment = 0, // value: 0 | -1 | 1
|
19
|
-
underAgeOfConsent = false, // default: false
|
20
|
-
contentRating = "G" // value: G | MA | PG | T | ""
|
21
|
-
|
22
|
-
]
|
23
|
-
|
24
|
-
|
25
|
-
cordova.plugins.emiAdmobPlugin.targeting(config_Targeting);
|
26
|
-
|
27
|
-
// Must be under globalSetting and targeting
|
28
|
-
cordova.plugins.emiAdmobPlugin.initialize();
|
29
|
-
|
30
|
-
|
31
|
-
// event
|
32
|
-
document.addEventListener('on.sdkInitialization', () => {
|
33
|
-
|
34
|
-
cordova.plugins.emiAdmobPlugin.requestIDFA(
|
35
|
-
|
36
|
-
(ststus) => {
|
37
|
-
|
38
|
-
event.value += "\n IDFA Status: " + ststus;
|
39
|
-
|
40
|
-
},
|
41
|
-
(error) => {
|
42
|
-
|
43
|
-
event.value += "\n Error: " + error
|
44
|
-
|
45
|
-
});
|
46
|
-
|
47
|
-
|
48
|
-
});
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
}, false);
|
54
|
-
</script>
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
</body>
|
59
|
-
</html>
|
@@ -1,64 +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
|
-
// ### Targeting
|
11
|
-
|
12
|
-
///// >>>>>> Device Ready <<<<<<
|
13
|
-
|
14
|
-
document.addEventListener("deviceready", function(){
|
15
|
-
|
16
|
-
|
17
|
-
// Instruction: https://developers.google.com/admob/android/targeting
|
18
|
-
// Overview: https://developers.google.com/android/reference/com/google/android/gms/ads/RequestConfiguration
|
19
|
-
|
20
|
-
// WARNING config must be an array[] not an object{}
|
21
|
-
const config_Targeting = [
|
22
|
-
|
23
|
-
childDirectedTreatment = 0, // value: 0 | -1 | 1
|
24
|
-
underAgeOfConsent = false, // default: false
|
25
|
-
contentRating = "G" // value: G | MA | PG | T | ""
|
26
|
-
|
27
|
-
]
|
28
|
-
|
29
|
-
|
30
|
-
cordova.plugins.emiAdmobPlugin.targeting(config_Targeting);
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
// Must be under globalSetting and targeting
|
35
|
-
cordova.plugins.emiAdmobPlugin.initialize();
|
36
|
-
|
37
|
-
// >>>>>>>>>>> Description <<<<<<<<<<<<<<<
|
38
|
-
|
39
|
-
// (TagForChildDirectedTreatment)
|
40
|
-
// Type number:
|
41
|
-
// value: 0 | -1 | 1
|
42
|
-
// (value description)
|
43
|
-
// 0 = FALSE
|
44
|
-
// 1 = TRUE
|
45
|
-
// -1 = UNSPECIFIED
|
46
|
-
// (if else/undefined = false/0)
|
47
|
-
|
48
|
-
|
49
|
-
//////////////////////////////
|
50
|
-
|
51
|
-
// (MaxAdContentRating)
|
52
|
-
// Type String:
|
53
|
-
// value: G | MA | PG | T | ""
|
54
|
-
// (value description)
|
55
|
-
// https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/max-ad-content-rating
|
56
|
-
// (if else/undefined/"" = NULL)
|
57
|
-
|
58
|
-
|
59
|
-
}, false);
|
60
|
-
</script>
|
61
|
-
|
62
|
-
|
63
|
-
</body>
|
64
|
-
</html>
|