emi-indo-cordova-plugin-admob 1.5.5 → 1.5.6
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 +23 -109
- package/example/www/index.html +2 -1
- package/example/www/js/appOpenAd.js +0 -1
- package/example/www/js/bannerAd.js +0 -1
- package/example/www/js/deviceready.js +1 -0
- package/example/www/js/interstitialAd.js +0 -1
- package/example/www/js/rewardedAd.js +1 -0
- package/package.json +1 -1
- package/plugin.xml +1 -1
- package/src/ios/emiAdmobPlugin.m +10 -10
package/README.md
CHANGED
@@ -12,7 +12,8 @@
|
|
12
12
|
### IAB Europe Transparency & Consent Framework (CPM: 2.2.0)
|
13
13
|
|
14
14
|
|
15
|
-
## New example
|
15
|
+
## New example
|
16
|
+
- https://github.com/EMI-INDO/emi-indo-cordova-plugin-admob/tree/main/example/www
|
16
17
|
|
17
18
|
|
18
19
|
## Minimum Cordova Engines
|
@@ -142,7 +143,8 @@ cordova plugin rm emi-indo-cordova-plugin-admob
|
|
142
143
|
|
143
144
|
## Import the Mobile Ads SDK IOS
|
144
145
|
### Then from the command line run:
|
145
|
-
- cd platforms/ios
|
146
|
+
- cd platforms/ios
|
147
|
+
- Then run cordova prepare
|
146
148
|
### Then from the command line run:
|
147
149
|
- pod install --repo-update
|
148
150
|
|
@@ -284,103 +286,6 @@ document.addEventListener('on.TCString.expired', () => {
|
|
284
286
|
|
285
287
|
|
286
288
|
|
287
|
-
## Global Variable adunitId
|
288
|
-
|
289
|
-
```
|
290
|
-
<script>
|
291
|
-
Ad format Demo ad unit ID
|
292
|
-
// https://developers.google.com/admob/android/test-ads
|
293
|
-
// https://developers.google.com/admob/ios/test-ads
|
294
|
-
|
295
|
-
var App_Open_ID;
|
296
|
-
var Banner_ID;
|
297
|
-
var Interstitial_ID;
|
298
|
-
var Rewarded_ID;
|
299
|
-
var Rewarded_Interstitial_ID;
|
300
|
-
|
301
|
-
/* https://support.google.com/admob/answer/9493252?hl=en
|
302
|
-
Best practice when using ad original ID unit,
|
303
|
-
the app must be uploaded to the play store or app store,
|
304
|
-
and you must upload it from there,
|
305
|
-
otherwise you may be subject to ad serving restrictions,
|
306
|
-
if it happens often, it is possible that your admob account will be permanently disabled.
|
307
|
-
*/
|
308
|
-
|
309
|
-
if (window.cordova.platformId === 'ios') {
|
310
|
-
|
311
|
-
App_Open_ID = 'ca-app-pub-3940256099942544/5575463023';
|
312
|
-
Banner_ID = 'ca-app-pub-3940256099942544/2934735716';
|
313
|
-
Interstitial_ID = 'ca-app-pub-3940256099942544/4411468910';
|
314
|
-
Rewarded_ID = 'ca-app-pub-3940256099942544/1712485313';
|
315
|
-
Rewarded_Interstitial_ID = 'ca-app-pub-3940256099942544/6978759866';
|
316
|
-
|
317
|
-
} else {
|
318
|
-
// Assume Android
|
319
|
-
App_Open_ID = 'ca-app-pub-3940256099942544/9257395921';
|
320
|
-
Banner_ID = 'ca-app-pub-3940256099942544/6300978111';
|
321
|
-
Interstitial_ID = 'ca-app-pub-3940256099942544/1033173712';
|
322
|
-
Rewarded_ID = 'ca-app-pub-3940256099942544/5224354917';
|
323
|
-
Rewarded_Interstitial_ID = 'ca-app-pub-3940256099942544/5354046379';
|
324
|
-
}
|
325
|
-
|
326
|
-
|
327
|
-
cordova.plugins.emiAdmobPlugin.initialize({
|
328
|
-
isUsingAdManagerRequest: true, // true = AdManagerAdRequest.Builder | false = AdRequest.Builder (Default true)
|
329
|
-
isResponseInfo: true, // Default false
|
330
|
-
isConsentDebug: true, // Default false
|
331
|
-
});
|
332
|
-
|
333
|
-
|
334
|
-
document.addEventListener('on.sdkInitialization', (data) => {
|
335
|
-
// JSON.stringify(data)
|
336
|
-
const sdkVersion = data.version;
|
337
|
-
// const adAdapter = data.adapters;
|
338
|
-
// const conStatus = data.consentStatus;
|
339
|
-
// const gdprApplie = data.gdprApplies;
|
340
|
-
// const purposeConsent = data.purposeConsents;
|
341
|
-
// const vendorConsents = data.vendorConsents;
|
342
|
-
// const conTCString = data.consentTCString;
|
343
|
-
// const additionalConsent = data.additionalConsent;
|
344
|
-
console.log("On Sdk Initialization version: " + sdkVersion);
|
345
|
-
|
346
|
-
|
347
|
-
cordova.plugins.emiAdmobPlugin.loadInterstitialAd({
|
348
|
-
adUnitId: "ca-app-pub-3940256099942544/1033173712",
|
349
|
-
autoShow: true
|
350
|
-
});
|
351
|
-
|
352
|
-
});
|
353
|
-
|
354
|
-
|
355
|
-
document.addEventListener('on.interstitial.loaded', () => {
|
356
|
-
|
357
|
-
console.log("on interstitial Ad loaded");
|
358
|
-
|
359
|
-
});
|
360
|
-
|
361
|
-
// all events that contain the keyword dismissed there is a block to load the ad after it is closed by the user.
|
362
|
-
// 'on.interstitial.dismissed' | 'on.rewardedInt.dismissed' | 'on.rewarded.dismissed'
|
363
|
-
document.addEventListener('on.interstitial.dismissed', () => {
|
364
|
-
|
365
|
-
console.log("on interstitial Ad dismissed");
|
366
|
-
console.log("you can load ads automatically after the ads are closed by users");
|
367
|
-
// loadInterstitialAd();
|
368
|
-
|
369
|
-
});
|
370
|
-
|
371
|
-
function loadInterstitialAd(){
|
372
|
-
|
373
|
-
cordova.plugins.emiAdmobPlugin.loadInterstitialAd({
|
374
|
-
adUnitId: "ca-app-pub-3940256099942544/1033173712",
|
375
|
-
autoShow: false
|
376
|
-
});
|
377
|
-
|
378
|
-
}
|
379
|
-
|
380
|
-
|
381
|
-
</script>
|
382
|
-
```
|
383
|
-
|
384
289
|
|
385
290
|
## AppOpenAd ADS
|
386
291
|
|
@@ -1005,7 +910,7 @@ on.orientation.landscape
|
|
1005
910
|
|
1006
911
|
|
1007
912
|
|
1008
|
-
# Admob Mediation
|
913
|
+
# Admob Mediation (supports both platforms)
|
1009
914
|
|
1010
915
|
<details>
|
1011
916
|
<summary>Mediation #9</summary>
|
@@ -1017,7 +922,7 @@ on.orientation.landscape
|
|
1017
922
|
|
1018
923
|
## get Mediation Adapter Name
|
1019
924
|
|
1020
|
-
|
925
|
+
isResponseInfo: true, // debug Default false // (debugging)
|
1021
926
|
|
1022
927
|
<img src="https://user-images.githubusercontent.com/78555833/230655800-0dbc3f12-72fb-4cf3-b4e6-801704fade28.png" width="250">
|
1023
928
|
|
@@ -1101,24 +1006,25 @@ cordova plugin add emi-indo-cordova-plugin-mediation-ironsource
|
|
1101
1006
|
|
1102
1007
|
- Cordova CLI Update Adapter version with Variables
|
1103
1008
|
```sh
|
1104
|
-
cordova plugin add emi-indo-cordova-plugin-mediation-meta --variable META_ADAPTER_VERSION="xxxxx"
|
1009
|
+
cordova plugin add emi-indo-cordova-plugin-mediation-meta --save --variable META_ADAPTER_VERSION="xxxxx" --variable IOS_META_ADAPTER_VERSION="xxxxx"
|
1105
1010
|
```
|
1106
1011
|
- Update Adapter version with config.xml
|
1107
1012
|
```sh
|
1108
1013
|
<preference name="META_ADAPTER_VERSION" value="xxxxx" />
|
1014
|
+
<preference name="IOS_META_ADAPTER_VERSION" value="xxxxx" />
|
1109
1015
|
```
|
1110
1016
|
|
1111
1017
|
### Variables Name
|
1112
1018
|
|
1113
|
-
- --variable META_ADAPTER_VERSION="xxxxx"
|
1114
|
-
- --variable UNITY_ADAPTER_VERSION="xxxxx"
|
1115
|
-
- --variable APPLOVIN_ADAPTER_VERSION="xxxxx"
|
1116
|
-
- --variable ADCOLONY_ADAPTER_VERSION="xxxxx"
|
1117
|
-
- --variable CHARTBOOST_ADAPTER_VERSION="xxxxx"
|
1118
|
-
- --variable IRONSOURCE_ADAPTER_VERSION="xxxxx"
|
1019
|
+
- --variable META_ADAPTER_VERSION="xxxxx" --variable IOS_META_ADAPTER_VERSION="xxxxx"
|
1020
|
+
- --variable UNITY_ADAPTER_VERSION="xxxxx" --variable IOS_UNITY_ADAPTER_VERSION="xxxxx"
|
1021
|
+
- --variable APPLOVIN_ADAPTER_VERSION="xxxxx" --variable IOS_APPLOVIN_ADAPTER_VERSION="xxxxx"
|
1022
|
+
- --variable ADCOLONY_ADAPTER_VERSION="xxxxx" --variable IOS_ADCOLONY_ADAPTER_VERSION="xxxxx"
|
1023
|
+
- --variable CHARTBOOST_ADAPTER_VERSION="xxxxx" --variable IOS_CHARTBOOST_ADAPTER_VERSION="xxxxx"
|
1024
|
+
- --variable IRONSOURCE_ADAPTER_VERSION="xxxxx" --variable IOS_IRONSOURCE_ADAPTER_VERSION="xxxxx"
|
1119
1025
|
|
1120
1026
|
### preference name
|
1121
|
-
|
1027
|
+
## (ANDROID)
|
1122
1028
|
- META_ADAPTER_VERSION
|
1123
1029
|
- UNITY_ADAPTER_VERSION
|
1124
1030
|
- APPLOVIN_ADAPTER_VERSION
|
@@ -1126,6 +1032,14 @@ cordova plugin add emi-indo-cordova-plugin-mediation-meta --variable META_ADAPTE
|
|
1126
1032
|
- CHARTBOOST_ADAPTER_VERSION
|
1127
1033
|
- IRONSOURCE_ADAPTER_VERSION
|
1128
1034
|
|
1035
|
+
## (IOS)
|
1036
|
+
- IOS_META_ADAPTER_VERSION
|
1037
|
+
- IOS_UNITY_ADAPTER_VERSION
|
1038
|
+
- IOS_APPLOVIN_ADAPTER_VERSION
|
1039
|
+
- IOS_ADCOLONY_ADAPTER_VERSION
|
1040
|
+
- IOS_CHARTBOOST_ADAPTER_VERSION
|
1041
|
+
- IOS_IRONSOURCE_ADAPTER_VERSION
|
1042
|
+
|
1129
1043
|
- ================================
|
1130
1044
|
</details>
|
1131
1045
|
|
package/example/www/index.html
CHANGED
@@ -1,14 +1,15 @@
|
|
1
1
|
<html>
|
2
2
|
<head>
|
3
3
|
<script type="text/javascript" src="cordova.js"></script>
|
4
|
+
<script src="js/deviceready.js" defer></script>
|
4
5
|
<script src="js/appOpenAd.js" defer></script>
|
5
6
|
<script src="js/bannerAd.js" defer></script>
|
6
7
|
<script src="js/interstitialAd.js" defer></script>
|
7
8
|
<script src="js/rewardedAd.js" defer></script>
|
8
|
-
<script src="js/deviceready.js" defer></script>
|
9
9
|
</head>
|
10
10
|
<body>
|
11
11
|
|
12
|
+
|
12
13
|
<label for="event">Debug Event All response :</label>
|
13
14
|
<textarea id="log" name="log" rows="5" cols="40"></textarea>
|
14
15
|
|
package/package.json
CHANGED
package/plugin.xml
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
|
2
2
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
3
|
-
id="emi-indo-cordova-plugin-admob" version="1.5.
|
3
|
+
id="emi-indo-cordova-plugin-admob" version="1.5.6">
|
4
4
|
|
5
5
|
<name>emiAdmobPlugin</name>
|
6
6
|
<description>Cordova Plugin Admob Android IOS</description>
|
package/src/ios/emiAdmobPlugin.m
CHANGED
@@ -17,10 +17,10 @@ int idfaStatus = 0;
|
|
17
17
|
// int fromStatus = 0; // Deprecated
|
18
18
|
int Consent_Status = 0;
|
19
19
|
int adFormat = 0;
|
20
|
-
int adWidth = 320; //
|
20
|
+
int adWidth = 320; // Deprecated
|
21
21
|
BOOL auto_Show = NO;
|
22
22
|
// NSString *Npa = @"1"; // Deprecated
|
23
|
-
NSString *Position = @"bottom"; // Default
|
23
|
+
NSString *Position = @"bottom-center"; // Default
|
24
24
|
NSString *bannerSaveAdUnitId = @""; // autoResize dependency = true
|
25
25
|
|
26
26
|
BOOL enableCollapsible = NO;
|
@@ -1163,8 +1163,8 @@ BOOL isUsingAdManagerRequest = YES;
|
|
1163
1163
|
|
1164
1164
|
// Prepare reward data as JSON
|
1165
1165
|
NSDictionary *rewardData = @{
|
1166
|
-
@"
|
1167
|
-
@"
|
1166
|
+
@"rewardType": reward.type,
|
1167
|
+
@"rewardAmount": [reward.amount stringValue]
|
1168
1168
|
};
|
1169
1169
|
NSData *rewardJsonData = [NSJSONSerialization dataWithJSONObject:rewardData options:0 error:nil];
|
1170
1170
|
NSString *rewardJsonString = [[NSString alloc] initWithData:rewardJsonData encoding:NSUTF8StringEncoding];
|
@@ -1241,8 +1241,8 @@ BOOL isUsingAdManagerRequest = YES;
|
|
1241
1241
|
|
1242
1242
|
// Prepare reward data as JSON
|
1243
1243
|
NSDictionary *rewardData = @{
|
1244
|
-
@"
|
1245
|
-
@"
|
1244
|
+
@"rewardType": reward.type,
|
1245
|
+
@"rewardAmount": [reward.amount stringValue]
|
1246
1246
|
};
|
1247
1247
|
NSData *rewardJsonData = [NSJSONSerialization dataWithJSONObject:rewardData options:0 error:nil];
|
1248
1248
|
NSString *rewardJsonString = [[NSString alloc] initWithData:rewardJsonData encoding:NSUTF8StringEncoding];
|
@@ -1329,8 +1329,8 @@ BOOL isUsingAdManagerRequest = YES;
|
|
1329
1329
|
GADAdReward *reward = self.rewardedAd.adReward;
|
1330
1330
|
|
1331
1331
|
NSDictionary *rewardData = @{
|
1332
|
-
@"
|
1333
|
-
@"
|
1332
|
+
@"rewardType": reward.type,
|
1333
|
+
@"rewardAmount": [reward.amount stringValue]
|
1334
1334
|
};
|
1335
1335
|
NSData *rewardJsonData = [NSJSONSerialization dataWithJSONObject:rewardData options:0 error:nil];
|
1336
1336
|
NSString *rewardJsonString = [[NSString alloc] initWithData:rewardJsonData encoding:NSUTF8StringEncoding];
|
@@ -1402,8 +1402,8 @@ BOOL isUsingAdManagerRequest = YES;
|
|
1402
1402
|
GADAdReward *reward = self.rewardedAd.adReward;
|
1403
1403
|
|
1404
1404
|
NSDictionary *rewardData = @{
|
1405
|
-
@"
|
1406
|
-
@"
|
1405
|
+
@"rewardType": reward.type,
|
1406
|
+
@"rewardAmount": [reward.amount stringValue]
|
1407
1407
|
};
|
1408
1408
|
NSError *jsonError;
|
1409
1409
|
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:rewardData options:0 error:&jsonError];
|