react-native-google-mobile-ads 9.1.2 → 10.0.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.
@@ -56,7 +56,6 @@ class ReactNativeGoogleMobileAdsAppOpenModule(reactContext: ReactApplicationCont
56
56
  activity,
57
57
  adUnitId,
58
58
  adRequest,
59
- AppOpenAd.APP_OPEN_AD_ORIENTATION_PORTRAIT,
60
59
  object :
61
60
  AppOpenAd.AppOpenAdLoadCallback() {
62
61
  override fun onAdLoaded(ad: AppOpenAd) {
@@ -267,7 +267,8 @@ public class ReactNativeGoogleMobileAdsBannerAdViewManager
267
267
  event.merge(payload);
268
268
  }
269
269
 
270
- ((ThemedReactContext) reactViewGroup.getContext())
270
+ reactViewGroup
271
+ .getReactContext()
271
272
  .getJSModule(RCTEventEmitter.class)
272
273
  .receiveEvent(reactViewGroup.getId(), "onNativeEvent", event);
273
274
  }
@@ -1,6 +1,6 @@
1
1
  package io.invertase.googlemobileads.common;
2
2
 
3
- import android.content.Context;
3
+ import com.facebook.react.uimanager.ThemedReactContext;
4
4
  import com.facebook.react.views.view.ReactViewGroup;
5
5
  import com.google.android.gms.ads.AdRequest;
6
6
  import com.google.android.gms.ads.AdSize;
@@ -13,9 +13,11 @@ public class ReactNativeAdView extends ReactViewGroup {
13
13
  private boolean manualImpressionsEnabled;
14
14
  private boolean propsChanged;
15
15
  private boolean isFluid;
16
+ private ThemedReactContext reactContext;
16
17
 
17
- public ReactNativeAdView(final Context context) {
18
- super(context);
18
+ public ReactNativeAdView(final ThemedReactContext context) {
19
+ super(context.getCurrentActivity());
20
+ setReactContext(context);
19
21
  }
20
22
 
21
23
  public void setRequest(AdRequest request) {
@@ -65,4 +67,12 @@ public class ReactNativeAdView extends ReactViewGroup {
65
67
  public boolean getIsFluid() {
66
68
  return this.isFluid;
67
69
  }
70
+
71
+ public ThemedReactContext getReactContext() {
72
+ return reactContext;
73
+ }
74
+
75
+ public void setReactContext(ThemedReactContext reactContext) {
76
+ this.reactContext = reactContext;
77
+ }
68
78
  }
@@ -28,6 +28,7 @@ To setup and configure ads consent collection, first of all:
28
28
  -keep class com.google.android.gms.internal.consent_sdk.** { *; }
29
29
  ```
30
30
  - For Expo users, add extraProguardRules property to `app.json` file following this guide [Expo](https://docs.expo.dev/versions/latest/sdk/build-properties/#pluginconfigtypeandroid):
31
+
31
32
  ```json
32
33
  {
33
34
  "expo": {
@@ -37,15 +38,15 @@ To setup and configure ads consent collection, first of all:
37
38
  {
38
39
  "android": {
39
40
  "extraProguardRules": "-keep class com.google.android.gms.internal.consent_sdk.** { *; }"
40
- },
41
+ }
41
42
  }
42
43
  ]
43
44
  ]
44
45
  }
45
46
  }
46
47
  ```
47
- You'll need to generate a new development build before using it.
48
48
 
49
+ You'll need to generate a new development build before using it.
49
50
 
50
51
  ### Delaying app measurement
51
52
 
package/docs/index.mdx CHANGED
@@ -169,6 +169,37 @@ mobileAds()
169
169
 
170
170
  If you are using mediation, you may wish to wait until the promise is settled before loading ads, as this will ensure that all mediation adapters are initialized.
171
171
 
172
+ ### App Tracking Transparency (iOS)
173
+
174
+ Apple requires apps to display the App Tracking Transparency authorization request for accessing the IDFA (leaving the choice to the user, whether to use personalized or non-personalized ads).
175
+ Within your projects `app.json` file, you have to use the `user_tracking_usage_description` to describe your usage:
176
+
177
+ ```json
178
+ {
179
+ "react-native-google-mobile-ads": {
180
+ "android_app_id": "ca-app-pub-xxxxxxxx~xxxxxxxx",
181
+ "ios_app_id": "ca-app-pub-xxxxxxxx~xxxxxxxx",
182
+ "user_tracking_usage_description": "This identifier will be used to deliver personalized ads to you."
183
+ }
184
+ }
185
+ ```
186
+
187
+ To request the App Tracking Transparency authorization we recommend using the [react-native-permissions](https://github.com/zoontek/react-native-permissions) library or making it part of the UMP consent flow [European User Consent page](/european-user-consent).
188
+
189
+ ```js
190
+ import { check, request, PERMISSIONS, RESULTS } from 'react-native-permissions';
191
+
192
+ const result = await check(PERMISSIONS.IOS.APP_TRACKING_TRANSPARENCY);
193
+ if (result === RESULTS.DENIED) {
194
+ // The permission has not been requested, so request it.
195
+ await request(PERMISSIONS.IOS.APP_TRACKING_TRANSPARENCY);
196
+ }
197
+
198
+ const adapterStatuses = await mobileAds().initialize();
199
+
200
+ // Now ads can be loaded.
201
+ ```
202
+
172
203
  ### European User Consent
173
204
 
174
205
  Out of the box, AdMob does not handle any related regulations which you may need to enforce on your application.
@@ -5,6 +5,6 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.version = void 0;
7
7
  // Generated by genversion.
8
- const version = '9.1.2';
8
+ const version = '10.0.1';
9
9
  exports.version = version;
10
10
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["version"],"sourceRoot":"../../src","sources":["version.ts"],"mappings":";;;;;;AAAA;AACO,MAAMA,OAAO,GAAG,OAAO;AAAC"}
1
+ {"version":3,"names":["version"],"sourceRoot":"../../src","sources":["version.ts"],"mappings":";;;;;;AAAA;AACO,MAAMA,OAAO,GAAG,QAAQ;AAAC"}
@@ -1,3 +1,3 @@
1
1
  // Generated by genversion.
2
- export const version = '9.1.2';
2
+ export const version = '10.0.1';
3
3
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["version"],"sourceRoot":"../../src","sources":["version.ts"],"mappings":"AAAA;AACA,OAAO,MAAMA,OAAO,GAAG,OAAO"}
1
+ {"version":3,"names":["version"],"sourceRoot":"../../src","sources":["version.ts"],"mappings":"AAAA;AACA,OAAO,MAAMA,OAAO,GAAG,QAAQ"}
@@ -1,4 +1,4 @@
1
- export declare const SDK_VERSION = "9.1.2";
1
+ export declare const SDK_VERSION = "10.0.1";
2
2
  export { default, MobileAds } from './MobileAds';
3
3
  export { AdsConsentDebugGeography } from './AdsConsentDebugGeography';
4
4
  export { AdsConsentPurposes } from './AdsConsentPurposes';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings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A2B,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAC;AAC9E,cAAc,SAAS,CAAC"}
@@ -1,2 +1,2 @@
1
- export declare const version = "9.1.2";
1
+ export declare const version = "10.0.1";
2
2
  //# sourceMappingURL=version.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,OAAO,UAAU,CAAC"}
1
+ {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,OAAO,WAAW,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-google-mobile-ads",
3
- "version": "9.1.2",
3
+ "version": "10.0.1",
4
4
  "author": "Invertase <oss@invertase.io> (http://invertase.io)",
5
5
  "description": "React Native Google Mobile Ads is an easy way to monetize mobile apps with targeted, in-app advertising.",
6
6
  "main": "lib/commonjs/index.js",
@@ -41,15 +41,15 @@
41
41
  ],
42
42
  "sdkVersions": {
43
43
  "ios": {
44
- "googleMobileAds": "9.14.0",
45
- "googleUmp": "2.0.0"
44
+ "googleMobileAds": "10.2.0",
45
+ "googleUmp": "2.0.1"
46
46
  },
47
47
  "android": {
48
48
  "minSdk": 19,
49
49
  "targetSdk": 30,
50
50
  "compileSdk": 31,
51
51
  "buildTools": "31.0.0",
52
- "googleMobileAds": "21.4.0",
52
+ "googleMobileAds": "21.5.0",
53
53
  "googleUmp": "2.0.0"
54
54
  }
55
55
  },
package/src/version.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  // Generated by genversion.
2
- export const version = '9.1.2';
2
+ export const version = '10.0.1';