cordova-plugin-admob-nextgen 1.4.9 → 1.6.9

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
@@ -113,7 +113,7 @@ This plugin is regularly updated to support the latest standards.
113
113
 
114
114
  | Component | Platform | Version | Release Notes |
115
115
  | :--- | :--- | :--- | :--- |
116
- | **GMA Next-Gen SDK** | Android | **1.1.0** | [View Notes](https://developers.google.com/admob/android/next-gen/rel-notes) |
116
+ | **GMA Next-Gen SDK** | Android | **1.1.1** | [View Notes](https://developers.google.com/admob/android/next-gen/rel-notes) |
117
117
  | **UMP SDK** | Android | **4.0.0** | [View Notes](https://developers.google.com/admob/android/privacy/release-notes) |
118
118
  | **Mobile Ads SDK** | iOS | **13.3.0** | [View Notes](https://developers.google.com/admob/ios/rel-notes) |
119
119
  | **UMP SDK** | iOS | **3.1.0** | [View Notes](https://developers.google.com/ad-manager/mobile-ads-sdk/ios/privacy/download) |
@@ -158,7 +158,7 @@ function run() {
158
158
  admob = {
159
159
  APP_ID_ANDROID: appIdAndroid ? appIdAndroid[1] : "ca-app-pub-3940256099942544~3347511713",
160
160
  APP_ID_IOS: appIdIos ? appIdIos[1] : "ca-app-pub-3940256099942544~1458002511",
161
- NEXT_GEN_SDK_VERSION: sdk ? sdk[1] : "1.0.1",
161
+ NEXT_GEN_SDK_VERSION: sdk ? sdk[1] : "1.1.1",
162
162
  UMP_VERSION: ump ? ump[1] : "4.0.0"
163
163
  };
164
164
  }
@@ -167,7 +167,7 @@ function run() {
167
167
  injectExclusionRules();
168
168
  if (admob?.NEXT_GEN_SDK_VERSION || admob?.UMP_VERSION) {
169
169
  updateGradleDependencies(
170
- admob.NEXT_GEN_SDK_VERSION || "1.0.1",
170
+ admob.NEXT_GEN_SDK_VERSION || "1.1.1",
171
171
  admob.UMP_VERSION || "4.0.0"
172
172
  );
173
173
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cordova-plugin-admob-nextgen",
3
- "version": "1.4.9",
3
+ "version": "1.6.9",
4
4
  "description": "Google Mobile Ads Next Gen SDK for Cordova. High performance and modular architecture. ",
5
5
  "cordova": {
6
6
  "id": "cordova-plugin-admob-nextgen",
package/plugin.xml CHANGED
@@ -1,6 +1,6 @@
1
1
  <?xml version='1.0' encoding='utf-8'?>
2
2
  <plugin id="cordova-plugin-admob-nextgen"
3
- version="1.4.9"
3
+ version="1.6.9"
4
4
  xmlns="http://apache.org/cordova/ns/plugins/1.0"
5
5
  xmlns:android="http://schemas.android.com/apk/res/android">
6
6
 
@@ -53,7 +53,7 @@
53
53
 
54
54
  </platform>
55
55
 
56
- <preference name="NEXT_GEN_SDK_VERSION" default="1.1.0" />
56
+ <preference name="NEXT_GEN_SDK_VERSION" default="1.1.1" />
57
57
  <preference name="UMP_VERSION" default="4.0.0" />
58
58
  <!-- Sample AdMob app ID: ca-app-pub-3940256099942544~3347511713 -->
59
59
  <preference name="APP_ID_ANDROID" default="ca-app-pub-3940256099942544~3347511713" />
@@ -96,7 +96,9 @@ public class AdMobNextGen extends CordovaPlugin {
96
96
  }
97
97
 
98
98
  if ("requestConsentInfo".equals(action)) {
99
- consentExecutor.requestConsentInfo(args, callbackContext);
99
+ cordova.getThreadPool().execute(() -> {
100
+ consentExecutor.requestConsentInfo(args, callbackContext);
101
+ });
100
102
  return true;
101
103
  }
102
104
  if ("showPrivacyOptionsForm".equals(action)) {
@@ -113,7 +115,9 @@ public class AdMobNextGen extends CordovaPlugin {
113
115
  }
114
116
 
115
117
  if ("initialize".equals(action)) {
116
- this.initializeSDK(args, callbackContext);
118
+ cordova.getThreadPool().execute(() -> {
119
+ this.initializeSDK(args, callbackContext);
120
+ });
117
121
  return true;
118
122
  }
119
123
 
@@ -313,7 +317,6 @@ public class AdMobNextGen extends CordovaPlugin {
313
317
  return;
314
318
  }
315
319
 
316
- cordova.getThreadPool().execute(() -> {
317
320
  try {
318
321
  InitializationConfig.Builder initConfigBuilder = new InitializationConfig.Builder(appId);
319
322
 
@@ -345,7 +348,6 @@ public class AdMobNextGen extends CordovaPlugin {
345
348
  } catch (Exception e) {
346
349
  cordova.getActivity().runOnUiThread(() -> callbackContext.error(e.getMessage()));
347
350
  }
348
- });
349
351
  }
350
352
 
351
353
  private String getAppIdFromManifest() {
@@ -39,7 +39,6 @@ public class ConsentExecutor {
39
39
  }
40
40
 
41
41
  public void requestConsentInfo(JSONArray args, CallbackContext callbackContext) {
42
- cordova.getThreadPool().execute(() -> {
43
42
  try {
44
43
  JSONObject options = args.optJSONObject(0);
45
44
 
@@ -122,7 +121,6 @@ public class ConsentExecutor {
122
121
  } catch (Exception e) {
123
122
  callbackContext.error("Exception: " + e.getMessage());
124
123
  }
125
- });
126
124
  }
127
125
 
128
126
  public void getTCData(CallbackContext callbackContext) {
@@ -305,43 +305,59 @@ public class NativeExecutor {
305
305
 
306
306
  newNativeAdView.setLayoutParams(params);
307
307
 
308
+ newNativeAdView.setBackgroundColor(Color.WHITE);
309
+ newNativeAdView.setElevation(8f);
310
+
311
+ newNativeAdView.setPadding((int)(10*density), (int)(10*density), (int)(10*density), (int)(10*density));
312
+
308
313
  LinearLayout mainLayout = new LinearLayout(cordova.getActivity());
309
314
  mainLayout.setOrientation(LinearLayout.VERTICAL);
310
- mainLayout.setBackgroundColor(Color.WHITE);
311
- mainLayout.setElevation(8f);
312
- mainLayout.setPadding((int)(10*density), (int)(10*density), (int)(10*density), (int)(10*density));
313
315
 
314
316
  LinearLayout headerLayout = new LinearLayout(cordova.getActivity());
315
317
  headerLayout.setOrientation(LinearLayout.HORIZONTAL);
316
318
  headerLayout.setGravity(Gravity.CENTER_VERTICAL);
317
319
 
320
+ headerLayout.setLayoutParams(new LinearLayout.LayoutParams(
321
+ ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT));
322
+
318
323
  ImageView iconView = new ImageView(cordova.getActivity());
319
324
  if (nativeAd.getIcon() != null) {
320
325
  iconView.setImageDrawable(nativeAd.getIcon().getDrawable());
321
- headerLayout.addView(iconView, new LinearLayout.LayoutParams((int)(40*density), (int)(40*density)));
326
+
327
+ LinearLayout.LayoutParams iconParams = new LinearLayout.LayoutParams(
328
+ (int)(40*density), (int)(40*density));
329
+ iconParams.setMargins(0, 0, (int)(8*density), 0);
330
+ headerLayout.addView(iconView, iconParams);
322
331
  }
323
332
 
324
333
  LinearLayout textContainer = new LinearLayout(cordova.getActivity());
325
334
  textContainer.setOrientation(LinearLayout.VERTICAL);
326
- textContainer.setPadding((int)(10*density), 0, 0, 0);
335
+
336
+ LinearLayout.LayoutParams textContainerParams = new LinearLayout.LayoutParams(
337
+ 0, ViewGroup.LayoutParams.WRAP_CONTENT, 1.0f);
327
338
 
328
339
  TextView headlineView = new TextView(cordova.getActivity());
329
340
  headlineView.setText(nativeAd.getHeadline());
330
341
  headlineView.setTypeface(null, Typeface.BOLD);
331
342
  headlineView.setTextColor(Color.BLACK);
332
343
  headlineView.setMaxLines(1);
333
- headlineView.setEllipsize(TextUtils.TruncateAt.END);
344
+ headlineView.setEllipsize(TextUtils.TruncateAt.END);
334
345
  textContainer.addView(headlineView);
335
346
 
336
347
  TextView adBadge = new TextView(cordova.getActivity());
337
348
  adBadge.setText("Ad");
338
349
  adBadge.setTextSize(10);
339
350
  adBadge.setTextColor(Color.WHITE);
340
- adBadge.setBackgroundColor(0xFFFCC133);
351
+ adBadge.setBackgroundColor(0xFFFCC133);
341
352
  adBadge.setPadding(5, 0, 5, 0);
342
- textContainer.addView(adBadge, new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT));
343
353
 
344
- headerLayout.addView(textContainer);
354
+ LinearLayout.LayoutParams badgeParams = new LinearLayout.LayoutParams(
355
+ ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
356
+ badgeParams.topMargin = (int)(2*density);
357
+ textContainer.addView(adBadge, badgeParams);
358
+
359
+ headerLayout.addView(textContainer, textContainerParams);
360
+
345
361
  mainLayout.addView(headerLayout);
346
362
 
347
363
  MediaView mediaView = new MediaView(cordova.getActivity());