react-native-google-mobile-ads 15.8.0 → 15.8.2

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.
@@ -84,6 +84,11 @@ RCT_EXPORT_METHOD(
84
84
  }
85
85
 
86
86
  NSString *responseId = nativeAd.responseInfo.responseIdentifier;
87
+ if (responseId == nil) {
88
+ reject(@"ERROR_LOAD", @"Failed to get a valid response ID from the loaded ad.", nil);
89
+ return;
90
+ }
91
+
87
92
  [_adHolders setValue:adHolder forKey:responseId];
88
93
 
89
94
  resolve(@{
@@ -95,7 +100,7 @@ RCT_EXPORT_METHOD(
95
100
  @"price" : nativeAd.price ?: [NSNull null],
96
101
  @"store" : nativeAd.store ?: [NSNull null],
97
102
  @"starRating" : nativeAd.starRating ?: [NSNull null],
98
- @"icon" : nativeAd.icon != nil
103
+ @"icon" : (nativeAd.icon && nativeAd.icon.imageURL != nil)
99
104
  ? @{@"scale" : @(nativeAd.icon.scale), @"url" : nativeAd.icon.imageURL.absoluteString}
100
105
  : [NSNull null],
101
106
  @"mediaContent" : @{
@@ -109,8 +114,10 @@ RCT_EXPORT_METHOD(
109
114
 
110
115
  RCT_EXPORT_METHOD(destroy
111
116
  : (NSString *)responseId {
112
- [[_adHolders valueForKey:responseId] dispose];
113
- [_adHolders removeObjectForKey:responseId];
117
+ if (responseId) {
118
+ [[_adHolders valueForKey:responseId] dispose];
119
+ [_adHolders removeObjectForKey:responseId];
120
+ }
114
121
  });
115
122
 
116
123
  - (GADNativeAd *)nativeAdForResponseId:(NSString *)responseId {
@@ -280,7 +287,7 @@ RCT_EXPORT_METHOD(destroy
280
287
  [self emitAdEvent:@"video_unmuted"];
281
288
  }
282
289
 
283
- - (void)emitAdEvent:(NSString *)type withData:(NSDictionary *)data {
290
+ - (void)emitAdEvent:(nonnull NSString *)type withData:(NSDictionary *)data {
284
291
  if (_nativeModule == nil || _nativeAd == nil) {
285
292
  return;
286
293
  }
@@ -290,7 +297,8 @@ RCT_EXPORT_METHOD(destroy
290
297
  [payload addEntriesFromDictionary:data];
291
298
  }
292
299
 
293
- payload[@"responseId"] = _nativeAd.responseInfo.responseIdentifier;
300
+ NSString *responseId = _nativeAd.responseInfo.responseIdentifier;
301
+ payload[@"responseId"] = responseId ?: [NSNull null];
294
302
  payload[@"type"] = type;
295
303
 
296
304
  #ifdef RCT_NEW_ARCH_ENABLED
@@ -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 = '15.8.0';
8
+ const version = exports.version = '15.8.2';
9
9
  //# sourceMappingURL=version.js.map
@@ -1,3 +1,3 @@
1
1
  // Generated by genversion.
2
- export const version = '15.8.0';
2
+ export const version = '15.8.2';
3
3
  //# sourceMappingURL=version.js.map
@@ -1,4 +1,4 @@
1
- export declare const SDK_VERSION = "15.8.0";
1
+ export declare const SDK_VERSION = "15.8.2";
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 = "15.8.0";
1
+ export declare const version = "15.8.2";
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": "15.8.0",
3
+ "version": "15.8.2",
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 = '15.8.0';
2
+ export const version = '15.8.2';