react-native-google-mobile-ads 14.8.0 → 14.8.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/docs/index.mdx CHANGED
@@ -5,13 +5,14 @@ a [Google AdMob account](https://apps.admob.com) is required.
5
5
 
6
6
  <YouTube id="9qCxo0D-Sak" />
7
7
 
8
- The module supports five types of Ads:
8
+ The module supports six types of Ads:
9
9
 
10
10
  1. Full screen [App Open Ads](/displaying-ads#app-open-ads).
11
11
  2. Component based [Banner Ads](/displaying-ads#banner-ads-component).
12
- 3. Full screen [Interstitial Ads](/displaying-ads#interstitial-ads).
13
- 4. Full screen [Rewarded Ads](/displaying-ads#rewarded-ads).
14
- 5. Full screen [Rewarded Interstitial Ads](/displaying-ads#rewarded-interstitial-ads).
12
+ 3. Component based [Native Ads](/native-ads).
13
+ 4. Full screen [Interstitial Ads](/displaying-ads#interstitial-ads).
14
+ 5. Full screen [Rewarded Ads](/displaying-ads#rewarded-ads).
15
+ 6. Full screen [Rewarded Interstitial Ads](/displaying-ads#rewarded-interstitial-ads).
15
16
 
16
17
  ## Installation
17
18
 
@@ -115,6 +115,10 @@ const NativeComponent = () => {
115
115
  .catch(console.error);
116
116
  }, []);
117
117
 
118
+ if (!nativeAd) {
119
+ return null;
120
+ }
121
+
118
122
  return (
119
123
  <NativeAdView nativeAd={nativeAd}>
120
124
  // Components to display assets must be placed here
@@ -145,6 +149,10 @@ const NativeComponent = () => {
145
149
  .catch(console.error);
146
150
  }, []);
147
151
 
152
+ if (!nativeAd) {
153
+ return null;
154
+ }
155
+
148
156
  return (
149
157
  <NativeAdView nativeAd={nativeAd}>
150
158
  <NativeAsset assetType={NativeAssetType.HEADLINE}>
@@ -230,6 +238,10 @@ const NativeComponent = () => {
230
238
  .catch(console.error);
231
239
  }, []);
232
240
 
241
+ if (!nativeAd) {
242
+ return null;
243
+ }
244
+
233
245
  return (
234
246
  // Wrap all the ad assets in the NativeAdView component, and register the view with the nativeAd prop
235
247
  <NativeAdView nativeAd={nativeAd}>
@@ -285,6 +297,10 @@ const NativeComponent = () => {
285
297
  };
286
298
  }, [nativeAd]);
287
299
 
300
+ if (!nativeAd) {
301
+ return null;
302
+ }
303
+
288
304
  return (
289
305
  <NativeAdView nativeAd={nativeAd}>
290
306
  // Components to display assets must be placed here
@@ -316,6 +332,10 @@ const NativeComponent = () => {
316
332
  };
317
333
  }, [nativeAd]);
318
334
 
335
+ if (!nativeAd) {
336
+ return null;
337
+ }
338
+
319
339
  return (
320
340
  <NativeAdView nativeAd={nativeAd}>
321
341
  // Components to display assets must be placed here
@@ -127,6 +127,11 @@ using namespace facebook::react;
127
127
  - (void)registerAsset:(NSString *)assetType reactTag:(NSInteger)reactTag {
128
128
  RCTExecuteOnMainQueue(^{
129
129
  UIView *view = [_bridge.uiManager viewForReactTag:@(reactTag)];
130
+ if (!view) {
131
+ RCTLogError(@"Cannot find NativeAssetView with tag #%zd while registering asset type %@",
132
+ reactTag, assetType);
133
+ return;
134
+ }
130
135
 
131
136
  if ([assetType isEqual:@"media"] && [view isKindOfClass:RNGoogleMobileAdsMediaView.class]) {
132
137
  #ifdef RCT_NEW_ARCH_ENABLED
@@ -194,9 +199,9 @@ RCT_EXPORT_VIEW_PROPERTY(responseId, NSString)
194
199
  }
195
200
 
196
201
  RCT_EXPORT_METHOD(registerAsset
197
- : (nonnull NSNumber *)reactTag commandID
198
- : (NSInteger)commandID commandArgs
199
- : (NSArray<id> *)commandArgs) {
202
+ : (nonnull NSNumber *)reactTag assetType
203
+ : (nonnull NSString *)assetType assetReactTag
204
+ : (nonnull NSNumber *)assetReactTag) {
200
205
  [self.bridge.uiManager
201
206
  addUIBlock:^(RCTUIManager *uiManager, NSDictionary<NSNumber *, UIView *> *viewRegistry) {
202
207
  RNGoogleMobileAdsNativeView *view = viewRegistry[reactTag];
@@ -204,7 +209,7 @@ RCT_EXPORT_METHOD(registerAsset
204
209
  RCTLogError(@"Cannot find NativeView with tag #%@", reactTag);
205
210
  return;
206
211
  }
207
- [view registerAsset:commandArgs[0] reactTag:((NSNumber *)commandArgs[1]).intValue];
212
+ [view registerAsset:assetType reactTag:assetReactTag.intValue];
208
213
  }];
209
214
  }
210
215
  #endif
@@ -5,5 +5,5 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.version = void 0;
7
7
  // Generated by genversion.
8
- const version = exports.version = '14.8.0';
8
+ const version = exports.version = '14.8.1';
9
9
  //# sourceMappingURL=version.js.map
@@ -1,3 +1,3 @@
1
1
  // Generated by genversion.
2
- export const version = '14.8.0';
2
+ export const version = '14.8.1';
3
3
  //# sourceMappingURL=version.js.map
@@ -1,4 +1,4 @@
1
- export declare const SDK_VERSION = "14.8.0";
1
+ export declare const SDK_VERSION = "14.8.1";
2
2
  export { default, MobileAds } from './MobileAds';
3
3
  export { AdsConsentDebugGeography, AdsConsentInfo, AdsConsentInfoOptions, AdsConsentInterface, AdsConsentPrivacyOptionsRequirementStatus, AdsConsentStatus, AdsConsentUserChoices, } from './specs/modules/NativeConsentModule';
4
4
  export { AdsConsentPurposes } from './AdsConsentPurposes';
@@ -1,2 +1,2 @@
1
- export declare const version = "14.8.0";
1
+ export declare const version = "14.8.1";
2
2
  //# sourceMappingURL=version.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-google-mobile-ads",
3
- "version": "14.8.0",
3
+ "version": "14.8.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",
package/src/version.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  // Generated by genversion.
2
- export const version = '14.8.0';
2
+ export const version = '14.8.1';