react-native-google-mobile-ads 16.3.3 → 16.4.0

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.
Files changed (38) hide show
  1. package/README.md +1 -1
  2. package/__tests__/googleMobileAds.test.ts +13 -1
  3. package/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsModule.kt +11 -0
  4. package/ios/RNGoogleMobileAds/RNGoogleMobileAdsMediaView.mm +8 -14
  5. package/ios/RNGoogleMobileAds/RNGoogleMobileAdsModule.mm +14 -0
  6. package/ios/RNGoogleMobileAds/RNGoogleMobileAdsNativeAdRegistry.h +31 -0
  7. package/ios/RNGoogleMobileAds/RNGoogleMobileAdsNativeAdRegistry.mm +60 -0
  8. package/ios/RNGoogleMobileAds/RNGoogleMobileAdsNativeModule.mm +9 -3
  9. package/ios/RNGoogleMobileAds/RNGoogleMobileAdsNativeView.mm +5 -11
  10. package/lib/commonjs/types/AgeRestrictedTreatment.js +38 -0
  11. package/lib/commonjs/types/AgeRestrictedTreatment.js.map +1 -0
  12. package/lib/commonjs/types/index.js +11 -0
  13. package/lib/commonjs/types/index.js.map +1 -1
  14. package/lib/commonjs/validateAdRequestConfiguration.js +17 -2
  15. package/lib/commonjs/validateAdRequestConfiguration.js.map +1 -1
  16. package/lib/commonjs/version.js +1 -1
  17. package/lib/module/types/AgeRestrictedTreatment.js +35 -0
  18. package/lib/module/types/AgeRestrictedTreatment.js.map +1 -0
  19. package/lib/module/types/index.js +1 -0
  20. package/lib/module/types/index.js.map +1 -1
  21. package/lib/module/validateAdRequestConfiguration.js +17 -2
  22. package/lib/module/validateAdRequestConfiguration.js.map +1 -1
  23. package/lib/module/version.js +1 -1
  24. package/lib/typescript/index.d.ts +1 -1
  25. package/lib/typescript/types/AgeRestrictedTreatment.d.ts +15 -0
  26. package/lib/typescript/types/AgeRestrictedTreatment.d.ts.map +1 -0
  27. package/lib/typescript/types/RequestConfiguration.d.ts +12 -0
  28. package/lib/typescript/types/RequestConfiguration.d.ts.map +1 -1
  29. package/lib/typescript/types/index.d.ts +1 -0
  30. package/lib/typescript/types/index.d.ts.map +1 -1
  31. package/lib/typescript/validateAdRequestConfiguration.d.ts.map +1 -1
  32. package/lib/typescript/version.d.ts +1 -1
  33. package/package.json +3 -3
  34. package/src/types/AgeRestrictedTreatment.ts +33 -0
  35. package/src/types/RequestConfiguration.ts +13 -0
  36. package/src/types/index.ts +1 -0
  37. package/src/validateAdRequestConfiguration.ts +23 -2
  38. package/src/version.ts +1 -1
package/README.md CHANGED
@@ -145,7 +145,7 @@ When using The New Architecture, some legacy code will still be used though. See
145
145
  - [Issues](https://github.com/invertase/react-native-google-mobile-ads/issues)
146
146
  - [PRs](https://github.com/invertase/react-native-google-mobile-ads/pulls)
147
147
  - [Guidelines](https://github.com/invertase/react-native-google-mobile-ads/blob/main/CONTRIBUTING.md)
148
- - [Code of Conduct](https://github.com/invertase/meta/blob/main/CODE_OF_CONDUCT.md)
148
+ - [Code of Conduct](https://github.com/invertase/.github/blob/main/CODE_OF_CONDUCT.md)
149
149
 
150
150
  ## License
151
151
 
@@ -1,4 +1,4 @@
1
- import admob, { MaxAdContentRating } from '../src';
1
+ import admob, { AgeRestrictedTreatment, MaxAdContentRating } from '../src';
2
2
  import RNGoogleMobileAdsModule from '../src/specs/modules/NativeGoogleMobileAdsModule';
3
3
 
4
4
  describe('Admob', function () {
@@ -22,6 +22,18 @@ describe('Admob', function () {
22
22
  });
23
23
  });
24
24
 
25
+ describe('ageRestrictedTreatment', function () {
26
+ it('throws if ageRestrictedTreatment is invalid', function () {
27
+ expect(() =>
28
+ admob().setRequestConfiguration({
29
+ ageRestrictedTreatment: 'adult' as AgeRestrictedTreatment,
30
+ }),
31
+ ).toThrow(
32
+ "setRequestConfiguration(*) 'requestConfiguration.ageRestrictedTreatment' expected one of child, teen, unspecified",
33
+ );
34
+ });
35
+ });
36
+
25
37
  describe('tagForChildDirectedTreatment', function () {
26
38
  it('throws if tagForChildDirectedTreatment not a boolean', function () {
27
39
  expect(() =>
@@ -25,6 +25,7 @@ import com.google.android.gms.ads.AdInspectorError
25
25
  import com.google.android.gms.ads.AdRequest
26
26
  import com.google.android.gms.ads.AdValue;
27
27
  import com.google.android.gms.ads.OnAdInspectorClosedListener
28
+ import com.google.android.gms.ads.AgeRestrictedTreatment
28
29
 
29
30
  class ReactNativeGoogleMobileAdsModule(
30
31
  reactContext: ReactApplicationContext
@@ -62,6 +63,16 @@ class ReactNativeGoogleMobileAdsModule(
62
63
  }
63
64
  }
64
65
 
66
+ if (requestConfiguration.hasKey("ageRestrictedTreatment")) {
67
+ val ageRestrictedTreatment = requestConfiguration.getString("ageRestrictedTreatment")
68
+
69
+ when (ageRestrictedTreatment) {
70
+ "CHILD" -> builder.setAgeRestrictedTreatment(AgeRestrictedTreatment.CHILD)
71
+ "TEEN" -> builder.setAgeRestrictedTreatment(AgeRestrictedTreatment.TEEN)
72
+ "UNSPECIFIED" -> builder.setAgeRestrictedTreatment(AgeRestrictedTreatment.UNSPECIFIED)
73
+ }
74
+ }
75
+
65
76
  if (requestConfiguration.hasKey("tagForChildDirectedTreatment")) {
66
77
  val tagForChildDirectedTreatment = requestConfiguration.getBoolean("tagForChildDirectedTreatment")
67
78
  builder.setTagForChildDirectedTreatment(
@@ -16,7 +16,7 @@
16
16
  */
17
17
 
18
18
  #import "RNGoogleMobileAdsMediaView.h"
19
- #import "RNGoogleMobileAdsNativeModule.h"
19
+ #import "RNGoogleMobileAdsNativeAdRegistry.h"
20
20
 
21
21
  #ifdef RCT_NEW_ARCH_ENABLED
22
22
  #import <react/renderer/components/RNGoogleMobileAdsSpec/ComponentDescriptors.h>
@@ -27,10 +27,6 @@
27
27
  #import "RCTFabricComponentsPlugins.h"
28
28
  #endif
29
29
 
30
- @interface RCTBridge (Private)
31
- + (RCTBridge *)currentBridge;
32
- @end
33
-
34
30
  #ifdef RCT_NEW_ARCH_ENABLED
35
31
  using namespace facebook::react;
36
32
 
@@ -39,8 +35,6 @@ using namespace facebook::react;
39
35
  #endif
40
36
 
41
37
  @implementation RNGoogleMobileAdsMediaView {
42
- __weak RCTBridge *_bridge;
43
- __weak RNGoogleMobileAdsNativeModule *_nativeModule;
44
38
  GADMediaView *_mediaView;
45
39
  UIViewContentMode _contentMode;
46
40
  }
@@ -52,11 +46,9 @@ using namespace facebook::react;
52
46
 
53
47
  - (instancetype)initWithFrame:(CGRect)frame {
54
48
  if (self = [super initWithFrame:frame]) {
55
- static const auto defaultProps = std::make_shared<const RNGoogleMobileAdsBannerViewProps>();
49
+ static const auto defaultProps = std::make_shared<const RNGoogleMobileAdsMediaViewProps>();
56
50
  _props = defaultProps;
57
51
 
58
- _bridge = [RCTBridge currentBridge];
59
- _nativeModule = [_bridge moduleForClass:RNGoogleMobileAdsNativeModule.class];
60
52
  _mediaView = [[GADMediaView alloc] init];
61
53
  _contentMode = UIViewContentModeScaleAspectFill;
62
54
  self.contentView = _mediaView;
@@ -99,9 +91,8 @@ using namespace facebook::react;
99
91
 
100
92
  - (instancetype)initWithBridge:(RCTBridge *)bridge {
101
93
  if (self = [super init]) {
102
- _bridge = bridge;
103
- _nativeModule = [_bridge moduleForClass:RNGoogleMobileAdsNativeModule.class];
104
94
  _mediaView = self;
95
+ _contentMode = UIViewContentModeScaleAspectFill;
105
96
  }
106
97
  return self;
107
98
  }
@@ -111,8 +102,11 @@ using namespace facebook::react;
111
102
  #pragma mark - Common logics
112
103
 
113
104
  - (void)setResponseId:(NSString *)responseId {
114
- _responseId = responseId;
115
- GADNativeAd *nativeAd = [_nativeModule nativeAdForResponseId:responseId];
105
+ _responseId = [responseId copy];
106
+ GADNativeAd *nativeAd = [RNGoogleMobileAdsNativeAdRegistry nativeAdForResponseId:responseId];
107
+ if (nativeAd == nil) {
108
+ return;
109
+ }
116
110
  _mediaView.mediaContent = nativeAd.mediaContent;
117
111
  _mediaView.contentMode = _contentMode;
118
112
  }
@@ -131,6 +131,20 @@ RCT_EXPORT_METHOD(setAppMuted : (BOOL)muted) {
131
131
  }
132
132
  }
133
133
 
134
+ if (requestConfiguration[@"ageRestrictedTreatment"]) {
135
+ NSString *ageRestrictedTreatment = requestConfiguration[@"ageRestrictedTreatment"];
136
+ if ([ageRestrictedTreatment isEqualToString:@"child"]) {
137
+ GADMobileAds.sharedInstance.requestConfiguration.ageRestrictedTreatment =
138
+ GADAgeRestrictedTreatmentChild;
139
+ } else if ([ageRestrictedTreatment isEqualToString:@"teen"]) {
140
+ GADMobileAds.sharedInstance.requestConfiguration.ageRestrictedTreatment =
141
+ GADAgeRestrictedTreatmentTeen;
142
+ } else if ([ageRestrictedTreatment isEqualToString:@"unspecified"]) {
143
+ GADMobileAds.sharedInstance.requestConfiguration.ageRestrictedTreatment =
144
+ GADAgeRestrictedTreatmentUnspecified;
145
+ }
146
+ }
147
+
134
148
  if (requestConfiguration[@"tagForChildDirectedTreatment"]) {
135
149
  BOOL tag = [requestConfiguration[@"tagForChildDirectedTreatment"] boolValue];
136
150
  GADMobileAds.sharedInstance.requestConfiguration.tagForChildDirectedTreatment =
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Copyright (c) 2016-present Invertase Limited & Contributors
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this library except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ *
16
+ */
17
+
18
+ #import <Foundation/Foundation.h>
19
+ #import <GoogleMobileAds/GADNativeAd.h>
20
+
21
+ NS_ASSUME_NONNULL_BEGIN
22
+
23
+ @interface RNGoogleMobileAdsNativeAdRegistry : NSObject
24
+
25
+ + (void)setNativeAd:(GADNativeAd *)nativeAd forResponseId:(NSString *)responseId;
26
+ + (nullable GADNativeAd *)nativeAdForResponseId:(NSString *)responseId;
27
+ + (void)removeNativeAdForResponseId:(NSString *)responseId;
28
+
29
+ @end
30
+
31
+ NS_ASSUME_NONNULL_END
@@ -0,0 +1,60 @@
1
+ /**
2
+ * Copyright (c) 2016-present Invertase Limited & Contributors
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this library except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ *
16
+ */
17
+
18
+ #import "RNGoogleMobileAdsNativeAdRegistry.h"
19
+
20
+ @implementation RNGoogleMobileAdsNativeAdRegistry
21
+
22
+ static NSMapTable<NSString *, GADNativeAd *> *_nativeAds;
23
+
24
+ + (void)initialize {
25
+ if (self == [RNGoogleMobileAdsNativeAdRegistry class]) {
26
+ _nativeAds = [NSMapTable strongToStrongObjectsMapTable];
27
+ }
28
+ }
29
+
30
+ + (void)setNativeAd:(GADNativeAd *)nativeAd forResponseId:(NSString *)responseId {
31
+ if (responseId.length == 0 || nativeAd == nil) {
32
+ return;
33
+ }
34
+
35
+ @synchronized(self) {
36
+ [_nativeAds setObject:nativeAd forKey:responseId];
37
+ }
38
+ }
39
+
40
+ + (nullable GADNativeAd *)nativeAdForResponseId:(NSString *)responseId {
41
+ if (responseId.length == 0) {
42
+ return nil;
43
+ }
44
+
45
+ @synchronized(self) {
46
+ return [_nativeAds objectForKey:responseId];
47
+ }
48
+ }
49
+
50
+ + (void)removeNativeAdForResponseId:(NSString *)responseId {
51
+ if (responseId.length == 0) {
52
+ return;
53
+ }
54
+
55
+ @synchronized(self) {
56
+ [_nativeAds removeObjectForKey:responseId];
57
+ }
58
+ }
59
+
60
+ @end
@@ -19,6 +19,7 @@
19
19
 
20
20
  #import "RNGoogleMobileAdsNativeModule.h"
21
21
  #import "RNGoogleMobileAdsCommon.h"
22
+ #import "RNGoogleMobileAdsNativeAdRegistry.h"
22
23
 
23
24
  typedef void (^RNGMANativeAdLoadCompletionHandler)(GADNativeAd *_Nullable nativeAd,
24
25
  NSError *_Nullable error);
@@ -94,6 +95,7 @@ RCT_EXPORT_METHOD(
94
95
  }
95
96
 
96
97
  [_adHolders setValue:adHolder forKey:responseId];
98
+ [RNGoogleMobileAdsNativeAdRegistry setNativeAd:nativeAd forResponseId:responseId];
97
99
 
98
100
  resolve(@{
99
101
  @"responseId" : responseId,
@@ -118,14 +120,15 @@ RCT_EXPORT_METHOD(
118
120
 
119
121
  RCT_EXPORT_METHOD(destroy
120
122
  : (NSString *)responseId {
121
- if (responseId) {
122
- [[_adHolders valueForKey:responseId] dispose];
123
+ if (responseId.length > 0) {
124
+ [[_adHolders objectForKey:responseId] dispose];
123
125
  [_adHolders removeObjectForKey:responseId];
126
+ [RNGoogleMobileAdsNativeAdRegistry removeNativeAdForResponseId:responseId];
124
127
  }
125
128
  });
126
129
 
127
130
  - (GADNativeAd *)nativeAdForResponseId:(NSString *)responseId {
128
- return [_adHolders valueForKey:responseId].nativeAd;
131
+ return [RNGoogleMobileAdsNativeAdRegistry nativeAdForResponseId:responseId];
129
132
  }
130
133
 
131
134
  - (void)dealloc {
@@ -133,6 +136,9 @@ RCT_EXPORT_METHOD(destroy
133
136
  for (RNGMANativeAdHolder *adHolder in adHolders) {
134
137
  [adHolder dispose];
135
138
  }
139
+ for (NSString *responseId in [_adHolders allKeys]) {
140
+ [RNGoogleMobileAdsNativeAdRegistry removeNativeAdForResponseId:responseId];
141
+ }
136
142
  [_adHolders removeAllObjects];
137
143
  }
138
144
 
@@ -17,7 +17,7 @@
17
17
 
18
18
  #import "RNGoogleMobileAdsNativeView.h"
19
19
  #import "RNGoogleMobileAdsMediaView.h"
20
- #import "RNGoogleMobileAdsNativeModule.h"
20
+ #import "RNGoogleMobileAdsNativeAdRegistry.h"
21
21
 
22
22
  #ifdef RCT_NEW_ARCH_ENABLED
23
23
  #import <react/renderer/components/RNGoogleMobileAdsSpec/ComponentDescriptors.h>
@@ -28,10 +28,6 @@
28
28
  #import "RCTFabricComponentsPlugins.h"
29
29
  #endif
30
30
 
31
- @interface RCTBridge (Private)
32
- + (RCTBridge *)currentBridge;
33
- @end
34
-
35
31
  #ifdef RCT_NEW_ARCH_ENABLED
36
32
  using namespace facebook::react;
37
33
 
@@ -40,8 +36,9 @@ using namespace facebook::react;
40
36
  #endif
41
37
 
42
38
  @implementation RNGoogleMobileAdsNativeView {
39
+ #ifndef RCT_NEW_ARCH_ENABLED
43
40
  __weak RCTBridge *_bridge;
44
- __weak RNGoogleMobileAdsNativeModule *_nativeModule;
41
+ #endif
45
42
  __weak GADNativeAd *_nativeAd;
46
43
  GADNativeAdView *_nativeAdView;
47
44
  dispatch_block_t _debouncedReload;
@@ -57,8 +54,6 @@ using namespace facebook::react;
57
54
  static const auto defaultProps = std::make_shared<const RNGoogleMobileAdsNativeViewProps>();
58
55
  _props = defaultProps;
59
56
 
60
- _bridge = [RCTBridge currentBridge];
61
- _nativeModule = [_bridge moduleForClass:RNGoogleMobileAdsNativeModule.class];
62
57
  _nativeAdView = [[GADNativeAdView alloc] init];
63
58
  self.contentView = _nativeAdView;
64
59
  }
@@ -127,7 +122,6 @@ using namespace facebook::react;
127
122
  - (instancetype)initWithBridge:(RCTBridge *)bridge {
128
123
  if (self = [super init]) {
129
124
  _bridge = bridge;
130
- _nativeModule = [_bridge moduleForClass:RNGoogleMobileAdsNativeModule.class];
131
125
  _nativeAdView = self;
132
126
  }
133
127
  return self;
@@ -138,8 +132,8 @@ using namespace facebook::react;
138
132
  #pragma mark - Common logics
139
133
 
140
134
  - (void)setResponseId:(NSString *)responseId {
141
- _responseId = responseId;
142
- _nativeAd = [_nativeModule nativeAdForResponseId:responseId];
135
+ _responseId = [responseId copy];
136
+ _nativeAd = [RNGoogleMobileAdsNativeAdRegistry nativeAdForResponseId:responseId];
143
137
  [self reloadAd];
144
138
  }
145
139
 
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.AgeRestrictedTreatment = void 0;
7
+ /*
8
+ * Copyright (c) 2016-present Invertase Limited & Contributors
9
+ *
10
+ * Licensed under the Apache License, Version 2.0 (the "License");
11
+ * you may not use this library except in compliance with the License.
12
+ * You may obtain a copy of the License at
13
+ *
14
+ * http://www.apache.org/licenses/LICENSE-2.0
15
+ *
16
+ * Unless required by applicable law or agreed to in writing, software
17
+ * distributed under the License is distributed on an "AS IS" BASIS,
18
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
+ * See the License for the specific language governing permissions and
20
+ * limitations under the License.
21
+ *
22
+ */
23
+ let AgeRestrictedTreatment = exports.AgeRestrictedTreatment = /*#__PURE__*/function (AgeRestrictedTreatment) {
24
+ /**
25
+ * Indicates that ad requests should receive child age treatment.
26
+ */
27
+ AgeRestrictedTreatment["CHILD"] = "child";
28
+ /**
29
+ * Indicates that ad requests should receive teenage treatment.
30
+ */
31
+ AgeRestrictedTreatment["TEEN"] = "teen";
32
+ /**
33
+ * Indicates that no specific age treatment signal applies to ad requests.
34
+ */
35
+ AgeRestrictedTreatment["UNSPECIFIED"] = "unspecified";
36
+ return AgeRestrictedTreatment;
37
+ }({});
38
+ //# sourceMappingURL=AgeRestrictedTreatment.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["AgeRestrictedTreatment","exports"],"sourceRoot":"../../../src","sources":["types/AgeRestrictedTreatment.ts"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAfA,IAiBYA,sBAAsB,GAAAC,OAAA,CAAAD,sBAAA,0BAAtBA,sBAAsB;EAChC;AACF;AACA;EAHYA,sBAAsB;EAMhC;AACF;AACA;EARYA,sBAAsB;EAWhC;AACF;AACA;EAbYA,sBAAsB;EAAA,OAAtBA,sBAAsB;AAAA","ignoreList":[]}
@@ -36,6 +36,17 @@ Object.keys(_AdEventsListener).forEach(function (key) {
36
36
  }
37
37
  });
38
38
  });
39
+ var _AgeRestrictedTreatment = require("./AgeRestrictedTreatment");
40
+ Object.keys(_AgeRestrictedTreatment).forEach(function (key) {
41
+ if (key === "default" || key === "__esModule") return;
42
+ if (key in exports && exports[key] === _AgeRestrictedTreatment[key]) return;
43
+ Object.defineProperty(exports, key, {
44
+ enumerable: true,
45
+ get: function () {
46
+ return _AgeRestrictedTreatment[key];
47
+ }
48
+ });
49
+ });
39
50
  var _AdShowOptions = require("./AdShowOptions");
40
51
  Object.keys(_AdShowOptions).forEach(function (key) {
41
52
  if (key === "default" || key === "__esModule") return;
@@ -1 +1 @@
1
- {"version":3,"names":["_AdapterStatus","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_AdEventListener","_AdEventsListener","_AdShowOptions","_AdStates","_BannerAdProps","_PaidEventListener","_RequestConfiguration","_RequestOptions","_RewardedAdReward","_AppEvent","_NativeAdRequestOptions"],"sourceRoot":"../../../src","sources":["types/index.ts"],"mappings":";;;;;AAiBA,IAAAA,cAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,cAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,cAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,cAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,gBAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,gBAAA,EAAAN,OAA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AAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAe,uBAAA,CAAAf,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAW,uBAAA,CAAAf,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
1
+ {"version":3,"names":["_AdapterStatus","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_AdEventListener","_AdEventsListener","_AgeRestrictedTreatment","_AdShowOptions","_AdStates","_BannerAdProps","_PaidEventListener","_RequestConfiguration","_RequestOptions","_RewardedAdReward","_AppEvent","_NativeAdRequestOptions"],"sourceRoot":"../../../src","sources":["types/index.ts"],"mappings":";;;;;AAiBA,IAAAA,cAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,cAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,cAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,cAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,gBAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,gBAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,gBAAA,CAAAL,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAC,gBAAA,CAAAL,GAAA;IAAA;EAAA;AAAA;AACA,IAAAM,iBAAA,GAAAV,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,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAgB,uBAAA,CAAAhB,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAY,uBAAA,CAAAhB,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.validateAdRequestConfiguration = validateAdRequestConfiguration;
7
7
  var _common = require("./common");
8
8
  var _MaxAdContentRating = require("./MaxAdContentRating");
9
+ var _AgeRestrictedTreatment = require("./types/AgeRestrictedTreatment");
9
10
  /*
10
11
  * Copyright (c) 2016-present Invertase Limited & Contributors
11
12
  *
@@ -34,16 +35,30 @@ function validateAdRequestConfiguration(requestConfiguration) {
34
35
  }
35
36
  out.maxAdContentRating = requestConfiguration.maxAdContentRating;
36
37
  }
38
+ if (requestConfiguration.ageRestrictedTreatment) {
39
+ if (!Object.values(_AgeRestrictedTreatment.AgeRestrictedTreatment).includes(requestConfiguration.ageRestrictedTreatment)) {
40
+ throw new Error(`'requestConfiguration.ageRestrictedTreatment' expected one of ${Object.values(_AgeRestrictedTreatment.AgeRestrictedTreatment).join(', ')}`);
41
+ }
42
+ out.ageRestrictedTreatment = requestConfiguration.ageRestrictedTreatment;
43
+ }
37
44
  if ((0, _common.isPropertySet)(requestConfiguration, 'tagForChildDirectedTreatment')) {
38
- if (!(0, _common.isBoolean)(requestConfiguration.tagForChildDirectedTreatment)) {
45
+ // eslint-disable-next-line @typescript-eslint/no-deprecated
46
+ const tagForChildDirectedTreatment = requestConfiguration.tagForChildDirectedTreatment;
47
+ if (!(0, _common.isBoolean)(tagForChildDirectedTreatment)) {
39
48
  throw new Error("'requestConfiguration.tagForChildDirectedTreatment' expected a boolean value");
40
49
  }
50
+
51
+ // eslint-disable-next-line @typescript-eslint/no-deprecated
41
52
  out.tagForChildDirectedTreatment = requestConfiguration.tagForChildDirectedTreatment;
42
53
  }
43
54
  if ((0, _common.isPropertySet)(requestConfiguration, 'tagForUnderAgeOfConsent')) {
44
- if (!(0, _common.isBoolean)(requestConfiguration.tagForUnderAgeOfConsent)) {
55
+ // eslint-disable-next-line @typescript-eslint/no-deprecated
56
+ const tagForUnderAgeOfConsent = requestConfiguration.tagForUnderAgeOfConsent;
57
+ if (!(0, _common.isBoolean)(tagForUnderAgeOfConsent)) {
45
58
  throw new Error("'requestConfiguration.tagForUnderAgeOfConsent' expected a boolean value");
46
59
  }
60
+
61
+ // eslint-disable-next-line @typescript-eslint/no-deprecated
47
62
  out.tagForUnderAgeOfConsent = requestConfiguration.tagForUnderAgeOfConsent;
48
63
  }
49
64
  if ((0, _common.isPropertySet)(requestConfiguration, 'testDeviceIdentifiers')) {
@@ -1 +1 @@
1
- {"version":3,"names":["_common","require","_MaxAdContentRating","validateAdRequestConfiguration","requestConfiguration","out","isObject","Error","maxAdContentRating","Object","values","MaxAdContentRating","includes","join","isPropertySet","isBoolean","tagForChildDirectedTreatment","tagForUnderAgeOfConsent","isArray","testDeviceIdentifiers"],"sourceRoot":"../../src","sources":["validateAdRequestConfiguration.ts"],"mappings":";;;;;;AAiBA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,mBAAA,GAAAD,OAAA;AAlBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAMO,SAASE,8BAA8BA,CAACC,oBAA0C,EAAE;EACzF,MAAMC,GAAyB,GAAG,CAAC,CAAC;EAEpC,IAAI,CAAC,IAAAC,gBAAQ,EAACF,oBAAoB,CAAC,EAAE;IACnC,MAAM,IAAIG,KAAK,CAAC,iDAAiD,CAAC;EACpE;EAEA,IAAIH,oBAAoB,CAACI,kBAAkB,EAAE;IAC3C,IAAI,CAACC,MAAM,CAACC,MAAM,CAACC,sCAAkB,CAAC,CAACC,QAAQ,CAACR,oBAAoB,CAACI,kBAAkB,CAAC,EAAE;MACxF,MAAM,IAAID,KAAK,CACb,6DAA6DE,MAAM,CAACC,MAAM,CAACC,sCAAkB,CAAC,CAACE,IAAI,CAAC,IAAI,CAAC,EAC3G,CAAC;IACH;IAEAR,GAAG,CAACG,kBAAkB,GAAGJ,oBAAoB,CAACI,kBAAkB;EAClE;EAEA,IAAI,IAAAM,qBAAa,EAACV,oBAAoB,EAAE,8BAA8B,CAAC,EAAE;IACvE,IAAI,CAAC,IAAAW,iBAAS,EAACX,oBAAoB,CAACY,4BAA4B,CAAC,EAAE;MACjE,MAAM,IAAIT,KAAK,CACb,8EACF,CAAC;IACH;IAEAF,GAAG,CAACW,4BAA4B,GAAGZ,oBAAoB,CAACY,4BAA4B;EACtF;EAEA,IAAI,IAAAF,qBAAa,EAACV,oBAAoB,EAAE,yBAAyB,CAAC,EAAE;IAClE,IAAI,CAAC,IAAAW,iBAAS,EAACX,oBAAoB,CAACa,uBAAuB,CAAC,EAAE;MAC5D,MAAM,IAAIV,KAAK,CAAC,yEAAyE,CAAC;IAC5F;IAEAF,GAAG,CAACY,uBAAuB,GAAGb,oBAAoB,CAACa,uBAAuB;EAC5E;EAEA,IAAI,IAAAH,qBAAa,EAACV,oBAAoB,EAAE,uBAAuB,CAAC,EAAE;IAChE,IAAI,CAAC,IAAAc,eAAO,EAACd,oBAAoB,CAACe,qBAAqB,CAAC,EAAE;MACxD,MAAM,IAAIZ,KAAK,CAAC,sEAAsE,CAAC;IACzF;IAEAF,GAAG,CAACc,qBAAqB,GAAGf,oBAAoB,CAACe,qBAAqB;EACxE;EAEA,OAAOd,GAAG;AACZ","ignoreList":[]}
1
+ {"version":3,"names":["_common","require","_MaxAdContentRating","_AgeRestrictedTreatment","validateAdRequestConfiguration","requestConfiguration","out","isObject","Error","maxAdContentRating","Object","values","MaxAdContentRating","includes","join","ageRestrictedTreatment","AgeRestrictedTreatment","isPropertySet","tagForChildDirectedTreatment","isBoolean","tagForUnderAgeOfConsent","isArray","testDeviceIdentifiers"],"sourceRoot":"../../src","sources":["validateAdRequestConfiguration.ts"],"mappings":";;;;;;AAiBA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,mBAAA,GAAAD,OAAA;AACA,IAAAE,uBAAA,GAAAF,OAAA;AAnBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAOO,SAASG,8BAA8BA,CAACC,oBAA0C,EAAE;EACzF,MAAMC,GAAyB,GAAG,CAAC,CAAC;EAEpC,IAAI,CAAC,IAAAC,gBAAQ,EAACF,oBAAoB,CAAC,EAAE;IACnC,MAAM,IAAIG,KAAK,CAAC,iDAAiD,CAAC;EACpE;EAEA,IAAIH,oBAAoB,CAACI,kBAAkB,EAAE;IAC3C,IAAI,CAACC,MAAM,CAACC,MAAM,CAACC,sCAAkB,CAAC,CAACC,QAAQ,CAACR,oBAAoB,CAACI,kBAAkB,CAAC,EAAE;MACxF,MAAM,IAAID,KAAK,CACb,6DAA6DE,MAAM,CAACC,MAAM,CAACC,sCAAkB,CAAC,CAACE,IAAI,CAAC,IAAI,CAAC,EAC3G,CAAC;IACH;IAEAR,GAAG,CAACG,kBAAkB,GAAGJ,oBAAoB,CAACI,kBAAkB;EAClE;EAEA,IAAIJ,oBAAoB,CAACU,sBAAsB,EAAE;IAC/C,IACE,CAACL,MAAM,CAACC,MAAM,CAACK,8CAAsB,CAAC,CAACH,QAAQ,CAACR,oBAAoB,CAACU,sBAAsB,CAAC,EAC5F;MACA,MAAM,IAAIP,KAAK,CACb,iEAAiEE,MAAM,CAACC,MAAM,CAACK,8CAAsB,CAAC,CAACF,IAAI,CAAC,IAAI,CAAC,EACnH,CAAC;IACH;IAEAR,GAAG,CAACS,sBAAsB,GAAGV,oBAAoB,CAACU,sBAAsB;EAC1E;EAEA,IAAI,IAAAE,qBAAa,EAACZ,oBAAoB,EAAE,8BAA8B,CAAC,EAAE;IACvE;IACA,MAAMa,4BAA4B,GAAGb,oBAAoB,CAACa,4BAA4B;IAEtF,IAAI,CAAC,IAAAC,iBAAS,EAACD,4BAA4B,CAAC,EAAE;MAC5C,MAAM,IAAIV,KAAK,CACb,8EACF,CAAC;IACH;;IAEA;IACAF,GAAG,CAACY,4BAA4B,GAAGb,oBAAoB,CAACa,4BAA4B;EACtF;EAEA,IAAI,IAAAD,qBAAa,EAACZ,oBAAoB,EAAE,yBAAyB,CAAC,EAAE;IAClE;IACA,MAAMe,uBAAuB,GAAGf,oBAAoB,CAACe,uBAAuB;IAE5E,IAAI,CAAC,IAAAD,iBAAS,EAACC,uBAAuB,CAAC,EAAE;MACvC,MAAM,IAAIZ,KAAK,CAAC,yEAAyE,CAAC;IAC5F;;IAEA;IACAF,GAAG,CAACc,uBAAuB,GAAGf,oBAAoB,CAACe,uBAAuB;EAC5E;EAEA,IAAI,IAAAH,qBAAa,EAACZ,oBAAoB,EAAE,uBAAuB,CAAC,EAAE;IAChE,IAAI,CAAC,IAAAgB,eAAO,EAAChB,oBAAoB,CAACiB,qBAAqB,CAAC,EAAE;MACxD,MAAM,IAAId,KAAK,CAAC,sEAAsE,CAAC;IACzF;IAEAF,GAAG,CAACgB,qBAAqB,GAAGjB,oBAAoB,CAACiB,qBAAqB;EACxE;EAEA,OAAOhB,GAAG;AACZ","ignoreList":[]}
@@ -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 = '16.3.3';
8
+ const version = exports.version = '16.4.0';
9
9
  //# sourceMappingURL=version.js.map
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+
3
+ /*
4
+ * Copyright (c) 2016-present Invertase Limited & Contributors
5
+ *
6
+ * Licensed under the Apache License, Version 2.0 (the "License");
7
+ * you may not use this library except in compliance with the License.
8
+ * You may obtain a copy of the License at
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing, software
13
+ * distributed under the License is distributed on an "AS IS" BASIS,
14
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ * See the License for the specific language governing permissions and
16
+ * limitations under the License.
17
+ *
18
+ */
19
+
20
+ export let AgeRestrictedTreatment = /*#__PURE__*/function (AgeRestrictedTreatment) {
21
+ /**
22
+ * Indicates that ad requests should receive child age treatment.
23
+ */
24
+ AgeRestrictedTreatment["CHILD"] = "child";
25
+ /**
26
+ * Indicates that ad requests should receive teenage treatment.
27
+ */
28
+ AgeRestrictedTreatment["TEEN"] = "teen";
29
+ /**
30
+ * Indicates that no specific age treatment signal applies to ad requests.
31
+ */
32
+ AgeRestrictedTreatment["UNSPECIFIED"] = "unspecified";
33
+ return AgeRestrictedTreatment;
34
+ }({});
35
+ //# sourceMappingURL=AgeRestrictedTreatment.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["AgeRestrictedTreatment"],"sourceRoot":"../../../src","sources":["types/AgeRestrictedTreatment.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,WAAYA,sBAAsB,0BAAtBA,sBAAsB;EAChC;AACF;AACA;EAHYA,sBAAsB;EAMhC;AACF;AACA;EARYA,sBAAsB;EAWhC;AACF;AACA;EAbYA,sBAAsB;EAAA,OAAtBA,sBAAsB;AAAA","ignoreList":[]}
@@ -20,6 +20,7 @@
20
20
  export * from './AdapterStatus';
21
21
  export * from './AdEventListener';
22
22
  export * from './AdEventsListener';
23
+ export * from './AgeRestrictedTreatment';
23
24
  export * from './AdShowOptions';
24
25
  export * from './AdStates';
25
26
  export * from './BannerAdProps';
@@ -1 +1 @@
1
- {"version":3,"names":[],"sourceRoot":"../../../src","sources":["types/index.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,cAAc,iBAAiB;AAC/B,cAAc,mBAAmB;AACjC,cAAc,oBAAoB;AAClC,cAAc,iBAAiB;AAC/B,cAAc,YAAY;AAC1B,cAAc,iBAAiB;AAC/B,cAAc,qBAAqB;AACnC,cAAc,wBAAwB;AACtC,cAAc,kBAAkB;AAChC,cAAc,oBAAoB;AAClC,cAAc,YAAY;AAC1B,cAAc,0BAA0B","ignoreList":[]}
1
+ {"version":3,"names":[],"sourceRoot":"../../../src","sources":["types/index.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,cAAc,iBAAiB;AAC/B,cAAc,mBAAmB;AACjC,cAAc,oBAAoB;AAClC,cAAc,0BAA0B;AACxC,cAAc,iBAAiB;AAC/B,cAAc,YAAY;AAC1B,cAAc,iBAAiB;AAC/B,cAAc,qBAAqB;AACnC,cAAc,wBAAwB;AACtC,cAAc,kBAAkB;AAChC,cAAc,oBAAoB;AAClC,cAAc,YAAY;AAC1B,cAAc,0BAA0B","ignoreList":[]}
@@ -19,6 +19,7 @@
19
19
 
20
20
  import { isPropertySet, isArray, isBoolean, isObject } from './common';
21
21
  import { MaxAdContentRating } from './MaxAdContentRating';
22
+ import { AgeRestrictedTreatment } from './types/AgeRestrictedTreatment';
22
23
  export function validateAdRequestConfiguration(requestConfiguration) {
23
24
  const out = {};
24
25
  if (!isObject(requestConfiguration)) {
@@ -30,16 +31,30 @@ export function validateAdRequestConfiguration(requestConfiguration) {
30
31
  }
31
32
  out.maxAdContentRating = requestConfiguration.maxAdContentRating;
32
33
  }
34
+ if (requestConfiguration.ageRestrictedTreatment) {
35
+ if (!Object.values(AgeRestrictedTreatment).includes(requestConfiguration.ageRestrictedTreatment)) {
36
+ throw new Error(`'requestConfiguration.ageRestrictedTreatment' expected one of ${Object.values(AgeRestrictedTreatment).join(', ')}`);
37
+ }
38
+ out.ageRestrictedTreatment = requestConfiguration.ageRestrictedTreatment;
39
+ }
33
40
  if (isPropertySet(requestConfiguration, 'tagForChildDirectedTreatment')) {
34
- if (!isBoolean(requestConfiguration.tagForChildDirectedTreatment)) {
41
+ // eslint-disable-next-line @typescript-eslint/no-deprecated
42
+ const tagForChildDirectedTreatment = requestConfiguration.tagForChildDirectedTreatment;
43
+ if (!isBoolean(tagForChildDirectedTreatment)) {
35
44
  throw new Error("'requestConfiguration.tagForChildDirectedTreatment' expected a boolean value");
36
45
  }
46
+
47
+ // eslint-disable-next-line @typescript-eslint/no-deprecated
37
48
  out.tagForChildDirectedTreatment = requestConfiguration.tagForChildDirectedTreatment;
38
49
  }
39
50
  if (isPropertySet(requestConfiguration, 'tagForUnderAgeOfConsent')) {
40
- if (!isBoolean(requestConfiguration.tagForUnderAgeOfConsent)) {
51
+ // eslint-disable-next-line @typescript-eslint/no-deprecated
52
+ const tagForUnderAgeOfConsent = requestConfiguration.tagForUnderAgeOfConsent;
53
+ if (!isBoolean(tagForUnderAgeOfConsent)) {
41
54
  throw new Error("'requestConfiguration.tagForUnderAgeOfConsent' expected a boolean value");
42
55
  }
56
+
57
+ // eslint-disable-next-line @typescript-eslint/no-deprecated
43
58
  out.tagForUnderAgeOfConsent = requestConfiguration.tagForUnderAgeOfConsent;
44
59
  }
45
60
  if (isPropertySet(requestConfiguration, 'testDeviceIdentifiers')) {
@@ -1 +1 @@
1
- {"version":3,"names":["isPropertySet","isArray","isBoolean","isObject","MaxAdContentRating","validateAdRequestConfiguration","requestConfiguration","out","Error","maxAdContentRating","Object","values","includes","join","tagForChildDirectedTreatment","tagForUnderAgeOfConsent","testDeviceIdentifiers"],"sourceRoot":"../../src","sources":["validateAdRequestConfiguration.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,aAAa,EAAEC,OAAO,EAAEC,SAAS,EAAEC,QAAQ,QAAQ,UAAU;AACtE,SAASC,kBAAkB,QAAQ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AAqB,GAAGV,oBAAoB,CAACU,qBAAqB;EACxE;EAEA,OAAOT,GAAG;AACZ","ignoreList":[]}
1
+ {"version":3,"names":["isPropertySet","isArray","isBoolean","isObject","MaxAdContentRating","AgeRestrictedTreatment","validateAdRequestConfiguration","requestConfiguration","out","Error","maxAdContentRating","Object","values","includes","join","ageRestrictedTreatment","tagForChildDirectedTreatment","tagForUnderAgeOfConsent","testDeviceIdentifiers"],"sourceRoot":"../../src","sources":["validateAdRequestConfiguration.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,aAAa,EAAEC,OAAO,EAAEC,SAAS,EAAEC,QAAQ,QAAQ,UAAU;AACtE,SAASC,kBAAkB,QAAQ,sBAAsB;AACzD,SAASC,sBAAsB,QAAQ,gCAAgC;AAGvE,OAAO,SAASC,8BAA8BA,CAACC,oBAA0C,EAAE;EACzF,MAAMC,GAAyB,GAAG,CAAC,CAAC;EAEpC,IAAI,CAACL,QAAQ,CAACI,oBAAoB,CAAC,EAAE;IACnC,MAAM,IAAIE,KAAK,CAAC,iDAAiD,CAAC;EACpE;EAEA,IAAIF,oBAAoB,CAACG,kBAAkB,EAAE;IAC3C,IAAI,CAACC,MAAM,CAACC,MAAM,CAACR,kBAAkB,CAAC,CAACS,QAAQ,CAACN,oBAAoB,CAACG,kBAAkB,CAAC,EAAE;MACxF,MAAM,IAAID,KAAK,CACb,6DAA6DE,MAAM,CAACC,MAAM,CAACR,kBAAkB,CAAC,CAACU,IAAI,CAAC,IAAI,CAAC,EAC3G,CAAC;IACH;IAEAN,GAAG,CAACE,kBAAkB,GAAGH,oBAAoB,CAACG,kBAAkB;EAClE;EAEA,IAAIH,oBAAoB,CAACQ,sBAAsB,EAAE;IAC/C,IACE,CAACJ,MAAM,CAACC,MAAM,CAACP,sBAAsB,CAAC,CAACQ,QAAQ,CAACN,oBAAoB,CAACQ,sBAAsB,CAAC,EAC5F;MACA,MAAM,IAAIN,KAAK,CACb,iEAAiEE,MAAM,CAACC,MAAM,CAACP,sBAAsB,CAAC,CAACS,IAAI,CAAC,IAAI,CAAC,EACnH,CAAC;IACH;IAEAN,GAAG,CAACO,sBAAsB,GAAGR,oBAAoB,CAACQ,sBAAsB;EAC1E;EAEA,IAAIf,aAAa,CAACO,oBAAoB,EAAE,8BAA8B,CAAC,EAAE;IACvE;IACA,MAAMS,4BAA4B,GAAGT,oBAAoB,CAACS,4BAA4B;IAEtF,IAAI,CAACd,SAAS,CAACc,4BAA4B,CAAC,EAAE;MAC5C,MAAM,IAAIP,KAAK,CACb,8EACF,CAAC;IACH;;IAEA;IACAD,GAAG,CAACQ,4BAA4B,GAAGT,oBAAoB,CAACS,4BAA4B;EACtF;EAEA,IAAIhB,aAAa,CAACO,oBAAoB,EAAE,yBAAyB,CAAC,EAAE;IAClE;IACA,MAAMU,uBAAuB,GAAGV,oBAAoB,CAACU,uBAAuB;IAE5E,IAAI,CAACf,SAAS,CAACe,uBAAuB,CAAC,EAAE;MACvC,MAAM,IAAIR,KAAK,CAAC,yEAAyE,CAAC;IAC5F;;IAEA;IACAD,GAAG,CAACS,uBAAuB,GAAGV,oBAAoB,CAACU,uBAAuB;EAC5E;EAEA,IAAIjB,aAAa,CAACO,oBAAoB,EAAE,uBAAuB,CAAC,EAAE;IAChE,IAAI,CAACN,OAAO,CAACM,oBAAoB,CAACW,qBAAqB,CAAC,EAAE;MACxD,MAAM,IAAIT,KAAK,CAAC,sEAAsE,CAAC;IACzF;IAEAD,GAAG,CAACU,qBAAqB,GAAGX,oBAAoB,CAACW,qBAAqB;EACxE;EAEA,OAAOV,GAAG;AACZ","ignoreList":[]}
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
 
3
3
  // Generated by genversion.
4
- export const version = '16.3.3';
4
+ export const version = '16.4.0';
5
5
  //# sourceMappingURL=version.js.map
@@ -1,4 +1,4 @@
1
- export declare const SDK_VERSION = "16.3.3";
1
+ export declare const SDK_VERSION = "16.4.0";
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';
@@ -0,0 +1,15 @@
1
+ export declare enum AgeRestrictedTreatment {
2
+ /**
3
+ * Indicates that ad requests should receive child age treatment.
4
+ */
5
+ CHILD = "child",
6
+ /**
7
+ * Indicates that ad requests should receive teenage treatment.
8
+ */
9
+ TEEN = "teen",
10
+ /**
11
+ * Indicates that no specific age treatment signal applies to ad requests.
12
+ */
13
+ UNSPECIFIED = "unspecified"
14
+ }
15
+ //# sourceMappingURL=AgeRestrictedTreatment.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AgeRestrictedTreatment.d.ts","sourceRoot":"","sources":["../../../src/types/AgeRestrictedTreatment.ts"],"names":[],"mappings":"AAiBA,oBAAY,sBAAsB;IAChC;;OAEG;IACH,KAAK,UAAU;IAEf;;OAEG;IACH,IAAI,SAAS;IAEb;;OAEG;IACH,WAAW,gBAAgB;CAC5B"}
@@ -1,4 +1,5 @@
1
1
  import { MaxAdContentRating } from '../MaxAdContentRating';
2
+ import { AgeRestrictedTreatment } from './AgeRestrictedTreatment';
2
3
  /**
3
4
  * The `RequestConfiguration` used when setting global ad settings via `setRequestConfiguration`.
4
5
  */
@@ -10,6 +11,16 @@ export interface RequestConfiguration {
10
11
  */
11
12
  maxAdContentRating?: MaxAdContentRating;
12
13
  /**
14
+ * The age treatment to apply to ad requests.
15
+ * Consult your own legal counsel to determine the age treatment settings for your users based on your legal and regulatory requirements.
16
+ * For more information on this setting, review https://developers.google.com/admob/ios/targeting#set_the_age_treatment
17
+ *
18
+ * By setting this property, you certify that this notification is accurate and you are authorized to act on behalf of the owner of the app.
19
+ * You understand that abuse of this setting may result in termination of your Google account.
20
+ */
21
+ ageRestrictedTreatment?: AgeRestrictedTreatment;
22
+ /**
23
+ * @deprecated Use `ageRestrictedTreatment` instead.
13
24
  * If `true`, indicates that you want your content treated as child-directed for purposes of COPPA.
14
25
  *
15
26
  * For purposes of the [Children's Online Privacy Protection Act (COPPA)](http://business.ftc.gov/privacy-and-security/children%27s-privacy),
@@ -19,6 +30,7 @@ export interface RequestConfiguration {
19
30
  */
20
31
  tagForChildDirectedTreatment?: boolean;
21
32
  /**
33
+ * @deprecated Use `ageRestrictedTreatment` instead.
22
34
  * If `true`, indicates that you want the ad request to be handled in a manner suitable for users under the age of consent.
23
35
  *
24
36
  * You can mark your ad requests to receive treatment for users in the European Economic Area (EEA) under the age of consent.
@@ -1 +1 @@
1
- {"version":3,"file":"RequestConfiguration.d.ts","sourceRoot":"","sources":["../../../src/types/RequestConfiguration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAE3D;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;IAExC;;;;;;;OAOG;IACH,4BAA4B,CAAC,EAAE,OAAO,CAAC;IAEvC;;;;;;;OAOG;IACH,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAElC;;;;OAIG;IACH,qBAAqB,CAAC,EAAE,MAAM,EAAE,CAAC;CAClC"}
1
+ {"version":3,"file":"RequestConfiguration.d.ts","sourceRoot":"","sources":["../../../src/types/RequestConfiguration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAElE;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;IAExC;;;;;;;OAOG;IACH,sBAAsB,CAAC,EAAE,sBAAsB,CAAC;IAEhD;;;;;;;;OAQG;IACH,4BAA4B,CAAC,EAAE,OAAO,CAAC;IAEvC;;;;;;;;OAQG;IACH,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAElC;;;;OAIG;IACH,qBAAqB,CAAC,EAAE,MAAM,EAAE,CAAC;CAClC"}
@@ -1,6 +1,7 @@
1
1
  export * from './AdapterStatus';
2
2
  export * from './AdEventListener';
3
3
  export * from './AdEventsListener';
4
+ export * from './AgeRestrictedTreatment';
4
5
  export * from './AdShowOptions';
5
6
  export * from './AdStates';
6
7
  export * from './BannerAdProps';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AAiBA,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,YAAY,CAAC;AAC3B,cAAc,0BAA0B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AAiBA,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,0BAA0B,CAAC;AACzC,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,YAAY,CAAC;AAC3B,cAAc,0BAA0B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"validateAdRequestConfiguration.d.ts","sourceRoot":"","sources":["../../src/validateAdRequestConfiguration.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAEpE,wBAAgB,8BAA8B,CAAC,oBAAoB,EAAE,oBAAoB,wBA4CxF"}
1
+ {"version":3,"file":"validateAdRequestConfiguration.d.ts","sourceRoot":"","sources":["../../src/validateAdRequestConfiguration.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAEpE,wBAAgB,8BAA8B,CAAC,oBAAoB,EAAE,oBAAoB,wBAgExF"}
@@ -1,2 +1,2 @@
1
- export declare const version = "16.3.3";
1
+ export declare const version = "16.4.0";
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": "16.3.3",
3
+ "version": "16.4.0",
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",
@@ -43,7 +43,7 @@
43
43
  ],
44
44
  "sdkVersions": {
45
45
  "ios": {
46
- "googleMobileAds": "13.1.0",
46
+ "googleMobileAds": "13.5.0",
47
47
  "googleUmp": "3.1.0"
48
48
  },
49
49
  "android": {
@@ -51,7 +51,7 @@
51
51
  "targetSdk": 34,
52
52
  "compileSdk": 34,
53
53
  "buildTools": "34.0.0",
54
- "googleMobileAds": "25.0.0",
54
+ "googleMobileAds": "25.4.0",
55
55
  "googleUmp": "4.0.0"
56
56
  }
57
57
  },
@@ -0,0 +1,33 @@
1
+ /*
2
+ * Copyright (c) 2016-present Invertase Limited & Contributors
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this library except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ *
16
+ */
17
+
18
+ export enum AgeRestrictedTreatment {
19
+ /**
20
+ * Indicates that ad requests should receive child age treatment.
21
+ */
22
+ CHILD = 'child',
23
+
24
+ /**
25
+ * Indicates that ad requests should receive teenage treatment.
26
+ */
27
+ TEEN = 'teen',
28
+
29
+ /**
30
+ * Indicates that no specific age treatment signal applies to ad requests.
31
+ */
32
+ UNSPECIFIED = 'unspecified',
33
+ }
@@ -1,4 +1,5 @@
1
1
  import { MaxAdContentRating } from '../MaxAdContentRating';
2
+ import { AgeRestrictedTreatment } from './AgeRestrictedTreatment';
2
3
 
3
4
  /**
4
5
  * The `RequestConfiguration` used when setting global ad settings via `setRequestConfiguration`.
@@ -12,6 +13,17 @@ export interface RequestConfiguration {
12
13
  maxAdContentRating?: MaxAdContentRating;
13
14
 
14
15
  /**
16
+ * The age treatment to apply to ad requests.
17
+ * Consult your own legal counsel to determine the age treatment settings for your users based on your legal and regulatory requirements.
18
+ * For more information on this setting, review https://developers.google.com/admob/ios/targeting#set_the_age_treatment
19
+ *
20
+ * By setting this property, you certify that this notification is accurate and you are authorized to act on behalf of the owner of the app.
21
+ * You understand that abuse of this setting may result in termination of your Google account.
22
+ */
23
+ ageRestrictedTreatment?: AgeRestrictedTreatment;
24
+
25
+ /**
26
+ * @deprecated Use `ageRestrictedTreatment` instead.
15
27
  * If `true`, indicates that you want your content treated as child-directed for purposes of COPPA.
16
28
  *
17
29
  * For purposes of the [Children's Online Privacy Protection Act (COPPA)](http://business.ftc.gov/privacy-and-security/children%27s-privacy),
@@ -22,6 +34,7 @@ export interface RequestConfiguration {
22
34
  tagForChildDirectedTreatment?: boolean;
23
35
 
24
36
  /**
37
+ * @deprecated Use `ageRestrictedTreatment` instead.
25
38
  * If `true`, indicates that you want the ad request to be handled in a manner suitable for users under the age of consent.
26
39
  *
27
40
  * You can mark your ad requests to receive treatment for users in the European Economic Area (EEA) under the age of consent.
@@ -18,6 +18,7 @@
18
18
  export * from './AdapterStatus';
19
19
  export * from './AdEventListener';
20
20
  export * from './AdEventsListener';
21
+ export * from './AgeRestrictedTreatment';
21
22
  export * from './AdShowOptions';
22
23
  export * from './AdStates';
23
24
  export * from './BannerAdProps';
@@ -17,6 +17,7 @@
17
17
 
18
18
  import { isPropertySet, isArray, isBoolean, isObject } from './common';
19
19
  import { MaxAdContentRating } from './MaxAdContentRating';
20
+ import { AgeRestrictedTreatment } from './types/AgeRestrictedTreatment';
20
21
  import { RequestConfiguration } from './types/RequestConfiguration';
21
22
 
22
23
  export function validateAdRequestConfiguration(requestConfiguration: RequestConfiguration) {
@@ -36,21 +37,41 @@ export function validateAdRequestConfiguration(requestConfiguration: RequestConf
36
37
  out.maxAdContentRating = requestConfiguration.maxAdContentRating;
37
38
  }
38
39
 
40
+ if (requestConfiguration.ageRestrictedTreatment) {
41
+ if (
42
+ !Object.values(AgeRestrictedTreatment).includes(requestConfiguration.ageRestrictedTreatment)
43
+ ) {
44
+ throw new Error(
45
+ `'requestConfiguration.ageRestrictedTreatment' expected one of ${Object.values(AgeRestrictedTreatment).join(', ')}`,
46
+ );
47
+ }
48
+
49
+ out.ageRestrictedTreatment = requestConfiguration.ageRestrictedTreatment;
50
+ }
51
+
39
52
  if (isPropertySet(requestConfiguration, 'tagForChildDirectedTreatment')) {
40
- if (!isBoolean(requestConfiguration.tagForChildDirectedTreatment)) {
53
+ // eslint-disable-next-line @typescript-eslint/no-deprecated
54
+ const tagForChildDirectedTreatment = requestConfiguration.tagForChildDirectedTreatment;
55
+
56
+ if (!isBoolean(tagForChildDirectedTreatment)) {
41
57
  throw new Error(
42
58
  "'requestConfiguration.tagForChildDirectedTreatment' expected a boolean value",
43
59
  );
44
60
  }
45
61
 
62
+ // eslint-disable-next-line @typescript-eslint/no-deprecated
46
63
  out.tagForChildDirectedTreatment = requestConfiguration.tagForChildDirectedTreatment;
47
64
  }
48
65
 
49
66
  if (isPropertySet(requestConfiguration, 'tagForUnderAgeOfConsent')) {
50
- if (!isBoolean(requestConfiguration.tagForUnderAgeOfConsent)) {
67
+ // eslint-disable-next-line @typescript-eslint/no-deprecated
68
+ const tagForUnderAgeOfConsent = requestConfiguration.tagForUnderAgeOfConsent;
69
+
70
+ if (!isBoolean(tagForUnderAgeOfConsent)) {
51
71
  throw new Error("'requestConfiguration.tagForUnderAgeOfConsent' expected a boolean value");
52
72
  }
53
73
 
74
+ // eslint-disable-next-line @typescript-eslint/no-deprecated
54
75
  out.tagForUnderAgeOfConsent = requestConfiguration.tagForUnderAgeOfConsent;
55
76
  }
56
77
 
package/src/version.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  // Generated by genversion.
2
- export const version = '16.3.3';
2
+ export const version = '16.4.0';