emi-indo-cordova-plugin-admob 1.6.7 → 1.6.8

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 CHANGED
@@ -8,7 +8,7 @@
8
8
  - AdSense New [example ](https://github.com/EMI-INDO/emi-indo-cordova-plugin-admob/blob/main/example/www/js/adSense.js)
9
9
 
10
10
 
11
- ### Mobile Ads SDK (Android: 23.5.0) [Release Notes:](https://developers.google.com/admob/android/rel-notes)
11
+ ### Mobile Ads SDK (Android: 23.6.0) [Release Notes:](https://developers.google.com/admob/android/rel-notes)
12
12
  ### User Messaging Platform (UMP Android: 3.1.0) [Release Notes:](https://developers.google.com/admob/android/privacy/release-notes)
13
13
 
14
14
  ### Mobile Ads SDK (IOS: 11.12.0) [Release Notes:](https://developers.google.com/admob/ios/rel-notes)
@@ -114,7 +114,8 @@ on.banner.hide
114
114
 
115
115
  // EVENT For example
116
116
 
117
- document.addEventListener('on.banner.load', () => {
117
+ document.addEventListener('on.banner.load', (arg) => {
118
+ let bannerAdHeight=arg.height;
118
119
  console.log("on banner load");
119
120
  });
120
121
 
@@ -80,8 +80,17 @@ document.addEventListener("deviceready", function () {
80
80
 
81
81
  cordova.plugins.emiAdmobPlugin.requestIDFA(); // requestTrackingAuthorization
82
82
 
83
- }
84
-
83
+ }
84
+
85
+
86
+ // deactivate Google's consent
87
+ /*
88
+ cordova.plugins.emiAdmobPlugin.metaData({
89
+
90
+ useCustomConsentManager: false // Default false only android
91
+
92
+ });
93
+ */
85
94
 
86
95
  // AdMob Sdk initialize
87
96
 
@@ -121,4 +130,4 @@ document.addEventListener("deviceready", function () {
121
130
 
122
131
 
123
132
 
124
- }, false);
133
+ }, false);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "emi-indo-cordova-plugin-admob",
3
- "version": "1.6.7",
3
+ "version": "1.6.8",
4
4
  "description": "Cordova Plugin Admob Android IOS Support Capacitor",
5
5
  "cordova": {
6
6
  "id": "emi-indo-cordova-plugin-admob",
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.6.7">
3
+ id="emi-indo-cordova-plugin-admob" version="1.6.8">
4
4
 
5
5
  <name>emiAdmobPlugin</name>
6
6
  <description>Cordova Plugin Admob Android IOS</description>
@@ -67,7 +67,7 @@
67
67
  <!-- Sample AdMob app ID: ca-app-pub-3940256099942544~3347511713 -->
68
68
 
69
69
  <preference name="APP_ID_ANDROID" default="ca-app-pub-3940256099942544~3347511713" />
70
- <preference name="PLAY_SERVICES_VERSION" default="23.5.0" />
70
+ <preference name="PLAY_SERVICES_VERSION" default="23.6.0" />
71
71
 
72
72
  <framework src="com.google.android.gms:play-services-ads:$PLAY_SERVICES_VERSION" />
73
73
 
@@ -309,4 +309,4 @@
309
309
  </podspec>
310
310
 
311
311
  </platform>
312
- </plugin>
312
+ </plugin>
@@ -1523,7 +1523,11 @@ class emiAdmobPlugin : CordovaPlugin() {
1523
1523
  bannerOverlapping()
1524
1524
  }
1525
1525
 
1526
- cWebView!!.loadUrl("javascript:cordova.fireDocumentEvent('on.banner.load');")
1526
+ val bannerHeight= adSize.height;
1527
+
1528
+ val bannerLoadEventData = String.format(Locale.US, "{\"height\": %d}", bannerHeight)
1529
+
1530
+ cWebView!!.loadUrl("javascript:cordova.fireDocumentEvent('on.banner.load', $bannerLoadEventData);")
1527
1531
 
1528
1532
  val eventData = String.format(
1529
1533
  "{\"collapsible\": \"%s\"}",
@@ -1787,7 +1791,7 @@ class emiAdmobPlugin : CordovaPlugin() {
1787
1791
  try {
1788
1792
  (brandSafetyUrls as ArrayList<String>).add(brandSafetyArr.getString(i))
1789
1793
  } catch (e: JSONException) {
1790
- e.printStackTrace();
1794
+ e.printStackTrace();
1791
1795
  }
1792
1796
  }
1793
1797
  }
@@ -1796,7 +1800,7 @@ class emiAdmobPlugin : CordovaPlugin() {
1796
1800
  this.ppIdVl = ppId
1797
1801
  this.cURLVl = ctURL
1798
1802
  } catch (e: JSONException) {
1799
- e.printStackTrace();
1803
+ e.printStackTrace();
1800
1804
  }
1801
1805
  }
1802
1806
 
@@ -1810,7 +1814,7 @@ class emiAdmobPlugin : CordovaPlugin() {
1810
1814
  }
1811
1815
  }
1812
1816
  } catch (e: JSONException) {
1813
- e.printStackTrace();
1817
+ e.printStackTrace();
1814
1818
  }
1815
1819
  }
1816
1820
 
@@ -1446,8 +1446,19 @@ BOOL isUsingAdManagerRequest = YES;
1446
1446
  NSString *jsonString = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
1447
1447
  [self fireEvent:@"" event:@"on.is.collapsible" withData:jsonString];
1448
1448
  }
1449
+
1450
+ // Get the banner height
1451
+ CGFloat bannerHeight = bannerView.bounds.size.height;
1452
+
1449
1453
 
1450
- [self fireEvent:@"" event:@"on.banner.load" withData:nil];
1454
+
1455
+ // Prepare height data for banner load event
1456
+ NSDictionary *bannerLoadData = @{@"height" : @(bannerHeight)};
1457
+ NSData *bannerLoadJsonData = [NSJSONSerialization dataWithJSONObject:bannerLoadData options:0 error:&error];
1458
+ NSString *bannerLoadJsonString = [[NSString alloc] initWithData:bannerLoadJsonData encoding:NSUTF8StringEncoding];
1459
+
1460
+ // Fire the banner load event with the height data
1461
+ [self fireEvent:@"" event:@"on.banner.load" withData:bannerLoadJsonString];
1451
1462
 
1452
1463
  if (auto_Show && self.bannerView) {
1453
1464
  [self addBannerViewToView:command];