react-native-google-mobile-ads 11.4.1 → 11.5.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.
@@ -56,6 +56,19 @@ public class ReactNativeGoogleMobileAdsConsentModule extends ReactNativeModule {
56
56
  }
57
57
  }
58
58
 
59
+ private String getPrivacyOptionsRequirementStatusString(
60
+ ConsentInformation.PrivacyOptionsRequirementStatus privacyOptionsRequirementStatus) {
61
+ switch (privacyOptionsRequirementStatus) {
62
+ case REQUIRED:
63
+ return "REQUIRED";
64
+ case NOT_REQUIRED:
65
+ return "NOT_REQUIRED";
66
+ case UNKNOWN:
67
+ default:
68
+ return "UNKNOWN";
69
+ }
70
+ }
71
+
59
72
  @ReactMethod
60
73
  public void requestInfoUpdate(@Nonnull final ReadableMap options, final Promise promise) {
61
74
  try {
@@ -98,6 +111,11 @@ public class ReactNativeGoogleMobileAdsConsentModule extends ReactNativeModule {
98
111
  WritableMap requestInfoMap = Arguments.createMap();
99
112
  requestInfoMap.putString(
100
113
  "status", getConsentStatusString(consentInformation.getConsentStatus()));
114
+ requestInfoMap.putBoolean("canRequestAds", consentInformation.canRequestAds());
115
+ requestInfoMap.putString(
116
+ "privacyOptionsRequirementStatus",
117
+ getPrivacyOptionsRequirementStatusString(
118
+ consentInformation.getPrivacyOptionsRequirementStatus()));
101
119
  requestInfoMap.putBoolean(
102
120
  "isConsentFormAvailable", consentInformation.isConsentFormAvailable());
103
121
  promise.resolve(requestInfoMap);
@@ -55,6 +55,21 @@ RCT_EXPORT_MODULE();
55
55
  }
56
56
  #endif
57
57
 
58
+ #if !TARGET_OS_MACCATALYST
59
+ - (NSString *)getPrivacyOptionsRequirementStatusString:
60
+ (UMPPrivacyOptionsRequirementStatus)privacyOptionsRequirementStatus {
61
+ switch (privacyOptionsRequirementStatus) {
62
+ case UMPPrivacyOptionsRequirementStatusRequired:
63
+ return @"REQUIRED";
64
+ case UMPPrivacyOptionsRequirementStatusNotRequired:
65
+ return @"NOT_REQUIRED";
66
+ case UMPPrivacyOptionsRequirementStatusUnknown:
67
+ default:
68
+ return @"UNKNOWN";
69
+ }
70
+ }
71
+ #endif
72
+
58
73
  RCT_EXPORT_METHOD(requestInfoUpdate
59
74
  : (NSDictionary *)options
60
75
  : (RCTPromiseResolveBlock)resolve
@@ -85,6 +100,12 @@ RCT_EXPORT_METHOD(requestInfoUpdate
85
100
  @"status" : [self
86
101
  getConsentStatusString:UMPConsentInformation.sharedInstance
87
102
  .consentStatus],
103
+ @"canRequestAds" :
104
+ @(UMPConsentInformation.sharedInstance.canRequestAds),
105
+ @"privacyOptionsRequirementStatus" :
106
+ [self getPrivacyOptionsRequirementStatusString:
107
+ UMPConsentInformation.sharedInstance
108
+ .privacyOptionsRequirementStatus],
88
109
  @"isConsentFormAvailable" :
89
110
  @(UMPConsentInformation.sharedInstance.formStatus ==
90
111
  UMPFormStatusAvailable)
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.AdsConsentPrivacyOptionsRequirementStatus = 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
+ /**
24
+ * AdsConsentPrivacyOptionsRequirementStatus enum.
25
+ */
26
+ let AdsConsentPrivacyOptionsRequirementStatus;
27
+ exports.AdsConsentPrivacyOptionsRequirementStatus = AdsConsentPrivacyOptionsRequirementStatus;
28
+ (function (AdsConsentPrivacyOptionsRequirementStatus) {
29
+ AdsConsentPrivacyOptionsRequirementStatus["UNKNOWN"] = "UNKNOWN";
30
+ AdsConsentPrivacyOptionsRequirementStatus["REQUIRED"] = "REQUIRED";
31
+ AdsConsentPrivacyOptionsRequirementStatus["NOT_REQUIRED"] = "NOT_REQUIRED";
32
+ })(AdsConsentPrivacyOptionsRequirementStatus || (exports.AdsConsentPrivacyOptionsRequirementStatus = AdsConsentPrivacyOptionsRequirementStatus = {}));
33
+ //# sourceMappingURL=AdsConsentPrivacyOptionsRequirementStatus.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["AdsConsentPrivacyOptionsRequirementStatus"],"sourceRoot":"../../src","sources":["AdsConsentPrivacyOptionsRequirementStatus.ts"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAFA,IAGYA,yCAAyC;AAAA;AAAA,WAAzCA,yCAAyC;EAAzCA,yCAAyC;EAAzCA,yCAAyC;EAAzCA,yCAAyC;AAAA,GAAzCA,yCAAyC,yDAAzCA,yCAAyC"}
@@ -5,6 +5,6 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.version = void 0;
7
7
  // Generated by genversion.
8
- const version = '11.4.1';
8
+ const version = '11.5.0';
9
9
  exports.version = version;
10
10
  //# sourceMappingURL=version.js.map
@@ -0,0 +1,27 @@
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
+ /**
19
+ * AdsConsentPrivacyOptionsRequirementStatus enum.
20
+ */
21
+ export let AdsConsentPrivacyOptionsRequirementStatus;
22
+ (function (AdsConsentPrivacyOptionsRequirementStatus) {
23
+ AdsConsentPrivacyOptionsRequirementStatus["UNKNOWN"] = "UNKNOWN";
24
+ AdsConsentPrivacyOptionsRequirementStatus["REQUIRED"] = "REQUIRED";
25
+ AdsConsentPrivacyOptionsRequirementStatus["NOT_REQUIRED"] = "NOT_REQUIRED";
26
+ })(AdsConsentPrivacyOptionsRequirementStatus || (AdsConsentPrivacyOptionsRequirementStatus = {}));
27
+ //# sourceMappingURL=AdsConsentPrivacyOptionsRequirementStatus.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["AdsConsentPrivacyOptionsRequirementStatus"],"sourceRoot":"../../src","sources":["AdsConsentPrivacyOptionsRequirementStatus.ts"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAYA,yCAAyC;AAepD,WAfWA,yCAAyC;EAAzCA,yCAAyC;EAAzCA,yCAAyC;EAAzCA,yCAAyC;AAAA,GAAzCA,yCAAyC,KAAzCA,yCAAyC"}
@@ -1,3 +1,3 @@
1
1
  // Generated by genversion.
2
- export const version = '11.4.1';
2
+ export const version = '11.5.0';
3
3
  //# sourceMappingURL=version.js.map
@@ -0,0 +1,18 @@
1
+ /**
2
+ * AdsConsentPrivacyOptionsRequirementStatus enum.
3
+ */
4
+ export declare enum AdsConsentPrivacyOptionsRequirementStatus {
5
+ /**
6
+ * Unknown consent status, AdsConsent.requestInfoUpdate needs to be called to update it.
7
+ */
8
+ UNKNOWN = "UNKNOWN",
9
+ /**
10
+ * User consent required but not yet obtained.
11
+ */
12
+ REQUIRED = "REQUIRED",
13
+ /**
14
+ * User consent not required.
15
+ */
16
+ NOT_REQUIRED = "NOT_REQUIRED"
17
+ }
18
+ //# sourceMappingURL=AdsConsentPrivacyOptionsRequirementStatus.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AdsConsentPrivacyOptionsRequirementStatus.d.ts","sourceRoot":"","sources":["../../src/AdsConsentPrivacyOptionsRequirementStatus.ts"],"names":[],"mappings":"AAiBA;;GAEG;AACH,oBAAY,yCAAyC;IACnD;;OAEG;IACH,OAAO,YAAY;IAEnB;;OAEG;IACH,QAAQ,aAAa;IAErB;;OAEG;IACH,YAAY,iBAAiB;CAC9B"}
@@ -1,4 +1,4 @@
1
- export declare const SDK_VERSION = "11.4.1";
1
+ export declare const SDK_VERSION = "11.5.0";
2
2
  export { default, MobileAds } from './MobileAds';
3
3
  export { AdsConsentDebugGeography } from './AdsConsentDebugGeography';
4
4
  export { AdsConsentPurposes } from './AdsConsentPurposes';
@@ -1,6 +1,7 @@
1
1
  import { TCModel } from '@iabtcf/core';
2
2
  import { AdsConsentDebugGeography } from '../AdsConsentDebugGeography';
3
3
  import { AdsConsentStatus } from '../AdsConsentStatus';
4
+ import { AdsConsentPrivacyOptionsRequirementStatus } from '../AdsConsentPrivacyOptionsRequirementStatus';
4
5
  /**
5
6
  * Under the Google [EU User Consent Policy](https://www.google.com/about/company/consentstaging.html), you must make certain disclosures to your users in the European Economic Area (EEA)
6
7
  * and obtain their consent to use cookies or other local storage, where legally required, and to use personal data
@@ -154,6 +155,14 @@ export interface AdsConsentInfo {
154
155
  * - `OBTAINED`: User consent already obtained.
155
156
  */
156
157
  status: AdsConsentStatus;
158
+ /**
159
+ * Indicates whether the app has completed the necessary steps for gathering updated user consent.
160
+ */
161
+ canRequestAds: boolean;
162
+ /**
163
+ * Privacy options requirement status.
164
+ */
165
+ privacyOptionsRequirementStatus: AdsConsentPrivacyOptionsRequirementStatus;
157
166
  /**
158
167
  * If `true` a consent form is available.
159
168
  */
@@ -1 +1 @@
1
- {"version":3,"file":"AdsConsent.interface.d.ts","sourceRoot":"","sources":["../../../src/types/AdsConsent.interface.ts"],"names":[],"mappings":"AAAA,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ACH,cAAc,EAAE,OAAO,CAAC;IACxB;;;;;;;OAOG;IACH,qBAAqB,EAAE,OAAO,CAAC;IAC/B;;;;;;;OAOG;IACH,yBAAyB,EAAE,OAAO,CAAC;IACnC;;;;;;;OAOG;IACH,iCAAiC,EAAE,OAAO,CAAC;IAC3C;;;;;;;;OAQG;IACH,yBAAyB,EAAE,OAAO,CAAC;CACpC"}
@@ -1,2 +1,2 @@
1
- export declare const version = "11.4.1";
1
+ export declare const version = "11.5.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": "11.4.1",
3
+ "version": "11.5.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",
@@ -42,7 +42,7 @@
42
42
  "sdkVersions": {
43
43
  "ios": {
44
44
  "googleMobileAds": "10.8.0",
45
- "googleUmp": "2.0.1"
45
+ "googleUmp": "2.1.0"
46
46
  },
47
47
  "android": {
48
48
  "minSdk": 19,
@@ -50,7 +50,7 @@
50
50
  "compileSdk": 31,
51
51
  "buildTools": "31.0.0",
52
52
  "googleMobileAds": "22.2.0",
53
- "googleUmp": "2.0.0"
53
+ "googleUmp": "2.1.0"
54
54
  }
55
55
  },
56
56
  "react-native-builder-bob": {
@@ -0,0 +1,36 @@
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
+ /**
19
+ * AdsConsentPrivacyOptionsRequirementStatus enum.
20
+ */
21
+ export enum AdsConsentPrivacyOptionsRequirementStatus {
22
+ /**
23
+ * Unknown consent status, AdsConsent.requestInfoUpdate needs to be called to update it.
24
+ */
25
+ UNKNOWN = 'UNKNOWN',
26
+
27
+ /**
28
+ * User consent required but not yet obtained.
29
+ */
30
+ REQUIRED = 'REQUIRED',
31
+
32
+ /**
33
+ * User consent not required.
34
+ */
35
+ NOT_REQUIRED = 'NOT_REQUIRED',
36
+ }
@@ -1,6 +1,7 @@
1
1
  import { TCModel } from '@iabtcf/core';
2
2
  import { AdsConsentDebugGeography } from '../AdsConsentDebugGeography';
3
3
  import { AdsConsentStatus } from '../AdsConsentStatus';
4
+ import { AdsConsentPrivacyOptionsRequirementStatus } from '../AdsConsentPrivacyOptionsRequirementStatus';
4
5
 
5
6
  /**
6
7
  * Under the Google [EU User Consent Policy](https://www.google.com/about/company/consentstaging.html), you must make certain disclosures to your users in the European Economic Area (EEA)
@@ -167,6 +168,16 @@ export interface AdsConsentInfo {
167
168
  */
168
169
  status: AdsConsentStatus;
169
170
 
171
+ /**
172
+ * Indicates whether the app has completed the necessary steps for gathering updated user consent.
173
+ */
174
+ canRequestAds: boolean;
175
+
176
+ /**
177
+ * Privacy options requirement status.
178
+ */
179
+ privacyOptionsRequirementStatus: AdsConsentPrivacyOptionsRequirementStatus;
180
+
170
181
  /**
171
182
  * If `true` a consent form is available.
172
183
  */
package/src/version.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  // Generated by genversion.
2
- export const version = '11.4.1';
2
+ export const version = '11.5.0';