react-native-google-mobile-ads 6.1.0 → 6.2.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.
- package/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsBannerAdViewManager.java +14 -4
- package/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsCommon.java +9 -3
- package/docs/european-user-consent.mdx +31 -0
- package/ios/RNGoogleMobileAds/RNGoogleMobileAdsAppOpenModule.m +1 -2
- package/ios/RNGoogleMobileAds/RNGoogleMobileAdsBannerViewManager.m +14 -5
- package/ios/RNGoogleMobileAds/RNGoogleMobileAdsCommon.h +2 -0
- package/ios/RNGoogleMobileAds/RNGoogleMobileAdsCommon.m +16 -1
- package/ios/RNGoogleMobileAds/RNGoogleMobileAdsInterstitialModule.m +1 -2
- package/ios/RNGoogleMobileAds/RNGoogleMobileAdsRewardedInterstitialModule.m +1 -1
- package/ios/RNGoogleMobileAds/RNGoogleMobileAdsRewardedModule.m +18 -18
- package/lib/commonjs/AdsConsent.js +3 -3
- package/lib/commonjs/AdsConsent.js.map +1 -1
- package/lib/commonjs/BannerAdSize.js +2 -0
- package/lib/commonjs/BannerAdSize.js.map +1 -1
- package/lib/commonjs/common/index.js +6 -0
- package/lib/commonjs/common/index.js.map +1 -1
- package/lib/commonjs/validateAdRequestConfiguration.js +3 -3
- package/lib/commonjs/validateAdRequestConfiguration.js.map +1 -1
- package/lib/commonjs/validateAdRequestOptions.js +1 -1
- package/lib/commonjs/validateAdRequestOptions.js.map +1 -1
- package/lib/commonjs/validateAdShowOptions.js +1 -1
- package/lib/commonjs/validateAdShowOptions.js.map +1 -1
- package/lib/commonjs/version.js +1 -1
- package/lib/commonjs/version.js.map +1 -1
- package/lib/module/AdsConsent.js +4 -4
- package/lib/module/AdsConsent.js.map +1 -1
- package/lib/module/BannerAdSize.js +2 -0
- package/lib/module/BannerAdSize.js.map +1 -1
- package/lib/module/common/index.js +4 -1
- package/lib/module/common/index.js.map +1 -1
- package/lib/module/validateAdRequestConfiguration.js +4 -4
- package/lib/module/validateAdRequestConfiguration.js.map +1 -1
- package/lib/module/validateAdRequestOptions.js +2 -2
- package/lib/module/validateAdRequestOptions.js.map +1 -1
- package/lib/module/validateAdShowOptions.js +2 -2
- package/lib/module/validateAdShowOptions.js.map +1 -1
- package/lib/module/version.js +1 -1
- package/lib/module/version.js.map +1 -1
- package/lib/typescript/BannerAdSize.d.ts +10 -1
- package/lib/typescript/common/index.d.ts +1 -0
- package/lib/typescript/index.d.ts +1 -1
- package/lib/typescript/version.d.ts +1 -1
- package/package.json +8 -8
- package/src/AdsConsent.ts +4 -4
- package/src/BannerAdSize.ts +12 -1
- package/src/common/index.ts +8 -1
- package/src/validateAdRequestConfiguration.ts +4 -4
- package/src/validateAdRequestOptions.ts +2 -2
- package/src/validateAdShowOptions.ts +2 -2
- package/src/version.ts +1 -1
package/lib/module/AdsConsent.js
CHANGED
|
@@ -19,7 +19,7 @@ import { NativeModules } from 'react-native';
|
|
|
19
19
|
import { AdsConsentDebugGeography } from './AdsConsentDebugGeography';
|
|
20
20
|
import { AdsConsentPurposes } from './AdsConsentPurposes';
|
|
21
21
|
import { AdsConsentSpecialFeatures } from './AdsConsentSpecialFeatures';
|
|
22
|
-
import {
|
|
22
|
+
import { isPropertySet, isArray, isBoolean, isObject, isString } from './common';
|
|
23
23
|
const native = NativeModules.RNGoogleMobileAdsConsentModule;
|
|
24
24
|
export const AdsConsent = {
|
|
25
25
|
requestInfoUpdate() {
|
|
@@ -29,15 +29,15 @@ export const AdsConsent = {
|
|
|
29
29
|
throw new Error("AdsConsent.requestInfoUpdate(*) 'options' expected an object value.");
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
if (
|
|
32
|
+
if (isPropertySet(options, 'debugGeography') && options.debugGeography !== AdsConsentDebugGeography.DISABLED && options.debugGeography !== AdsConsentDebugGeography.EEA && options.debugGeography !== AdsConsentDebugGeography.NOT_EEA) {
|
|
33
33
|
throw new Error("AdsConsent.requestInfoUpdate(*) 'options.debugGeography' expected one of AdsConsentDebugGeography.DISABLED, AdsConsentDebugGeography.EEA or AdsConsentDebugGeography.NOT_EEA.");
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
if (
|
|
36
|
+
if (isPropertySet(options, 'tagForUnderAgeOfConsent') && !isBoolean(options.tagForUnderAgeOfConsent)) {
|
|
37
37
|
throw new Error("AdsConsent.requestInfoUpdate(*) 'options.tagForUnderAgeOfConsent' expected a boolean value.");
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
if (
|
|
40
|
+
if (isPropertySet(options, 'testDeviceIdentifiers')) {
|
|
41
41
|
if (!isArray(options.testDeviceIdentifiers)) {
|
|
42
42
|
throw new Error("AdsConsent.requestInfoUpdate(*) 'options.testDeviceIdentifiers' expected an array of string values.");
|
|
43
43
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["AdsConsent.ts"],"names":["TCModel","TCString","NativeModules","AdsConsentDebugGeography","AdsConsentPurposes","AdsConsentSpecialFeatures","
|
|
1
|
+
{"version":3,"sources":["AdsConsent.ts"],"names":["TCModel","TCString","NativeModules","AdsConsentDebugGeography","AdsConsentPurposes","AdsConsentSpecialFeatures","isPropertySet","isArray","isBoolean","isObject","isString","native","RNGoogleMobileAdsConsentModule","AdsConsent","requestInfoUpdate","options","Error","debugGeography","DISABLED","EEA","NOT_EEA","tagForUnderAgeOfConsent","testDeviceIdentifiers","deviceId","showForm","reset","getTCString","getTCModel","tcString","decode","getUserChoices","tcModel","e","__DEV__","console","warn","activelyScanDeviceCharacteristicsForIdentification","specialFeatureOptins","has","ACTIVELY_SCAN_DEVICE_CHARACTERISTICS_FOR_IDENTIFICATION","applyMarketResearchToGenerateAudienceInsights","purposeConsents","APPLY_MARKET_RESEARCH_TO_GENERATE_AUDIENCE_INSIGHTS","createAPersonalisedAdsProfile","CREATE_A_PERSONALISED_ADS_PROFILE","createAPersonalisedContentProfile","developAndImproveProducts","DEVELOP_AND_IMPROVE_PRODUCTS","measureAdPerformance","MEASURE_AD_PERFORMANCE","measureContentPerformance","MEASURE_CONTENT_PERFORMANCE","selectBasicAds","SELECT_BASIC_ADS","selectPersonalisedAds","SELECT_PERSONALISED_ADS","selectPersonalisedContent","SELECT_PERSONALISED_CONTENT","storeAndAccessInformationOnDevice","STORE_AND_ACCESS_INFORMATION_ON_DEVICE","usePreciseGeolocationData","USE_PRECISE_GEOLOCATION_DATA"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,SAASA,OAAT,EAAkBC,QAAlB,QAAkC,cAAlC;AACA,SAASC,aAAT,QAA8B,cAA9B;AACA,SAASC,wBAAT,QAAyC,4BAAzC;AACA,SAASC,kBAAT,QAAmC,sBAAnC;AACA,SAASC,yBAAT,QAA0C,6BAA1C;AACA,SAASC,aAAT,EAAwBC,OAAxB,EAAiCC,SAAjC,EAA4CC,QAA5C,EAAsDC,QAAtD,QAAsE,UAAtE;AASA,MAAMC,MAAM,GAAGT,aAAa,CAACU,8BAA7B;AAEA,OAAO,MAAMC,UAA+B,GAAG;AAC7CC,EAAAA,iBAAiB,GAA+D;AAAA,QAA9DC,OAA8D,uEAA7B,EAA6B;;AAC9E,QAAI,CAACN,QAAQ,CAACM,OAAD,CAAb,EAAwB;AACtB,YAAM,IAAIC,KAAJ,CAAU,qEAAV,CAAN;AACD;;AAED,QACEV,aAAa,CAACS,OAAD,EAAU,gBAAV,CAAb,IACAA,OAAO,CAACE,cAAR,KAA2Bd,wBAAwB,CAACe,QADpD,IAEAH,OAAO,CAACE,cAAR,KAA2Bd,wBAAwB,CAACgB,GAFpD,IAGAJ,OAAO,CAACE,cAAR,KAA2Bd,wBAAwB,CAACiB,OAJtD,EAKE;AACA,YAAM,IAAIJ,KAAJ,CACJ,+KADI,CAAN;AAGD;;AAED,QACEV,aAAa,CAACS,OAAD,EAAU,yBAA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,GAAxB,CACjClC,kBAAkB,CAACuD,sCADc,CA3B9B;AA8BLC,MAAAA,yBAAyB,EAAE7B,OAAO,CAACM,oBAAR,CAA6BC,GAA7B,CACzBjC,yBAAyB,CAACwD,4BADD;AA9BtB,KAAP;AAkCD;;AAhH4C,CAAxC","sourcesContent":["/*\n * Copyright (c) 2016-present Invertase Limited & Contributors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this library except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\n\nimport { TCModel, TCString } from '@iabtcf/core';\nimport { NativeModules } from 'react-native';\nimport { AdsConsentDebugGeography } from './AdsConsentDebugGeography';\nimport { AdsConsentPurposes } from './AdsConsentPurposes';\nimport { AdsConsentSpecialFeatures } from './AdsConsentSpecialFeatures';\nimport { isPropertySet, isArray, isBoolean, isObject, isString } from './common';\nimport {\n AdsConsentFormResult,\n AdsConsentInfo,\n AdsConsentInfoOptions,\n AdsConsentInterface,\n AdsConsentUserChoices,\n} from './types/AdsConsent.interface';\n\nconst native = NativeModules.RNGoogleMobileAdsConsentModule;\n\nexport const AdsConsent: AdsConsentInterface = {\n requestInfoUpdate(options: AdsConsentInfoOptions = {}): Promise<AdsConsentInfo> {\n if (!isObject(options)) {\n throw new Error(\"AdsConsent.requestInfoUpdate(*) 'options' expected an object value.\");\n }\n\n if (\n isPropertySet(options, 'debugGeography') &&\n options.debugGeography !== AdsConsentDebugGeography.DISABLED &&\n options.debugGeography !== AdsConsentDebugGeography.EEA &&\n options.debugGeography !== AdsConsentDebugGeography.NOT_EEA\n ) {\n throw new Error(\n \"AdsConsent.requestInfoUpdate(*) 'options.debugGeography' expected one of AdsConsentDebugGeography.DISABLED, AdsConsentDebugGeography.EEA or AdsConsentDebugGeography.NOT_EEA.\",\n );\n }\n\n if (\n isPropertySet(options, 'tagForUnderAgeOfConsent') &&\n !isBoolean(options.tagForUnderAgeOfConsent)\n ) {\n throw new Error(\n \"AdsConsent.requestInfoUpdate(*) 'options.tagForUnderAgeOfConsent' expected a boolean value.\",\n );\n }\n\n if (isPropertySet(options, 'testDeviceIdentifiers')) {\n if (!isArray(options.testDeviceIdentifiers)) {\n throw new Error(\n \"AdsConsent.requestInfoUpdate(*) 'options.testDeviceIdentifiers' expected an array of string values.\",\n );\n }\n\n for (const deviceId of options.testDeviceIdentifiers ?? []) {\n if (!isString(deviceId)) {\n throw new Error(\n \"AdsConsent.requestInfoUpdate(*) 'options.testDeviceIdentifiers' expected an array of string values.\",\n );\n }\n }\n }\n\n return native.requestInfoUpdate(options);\n },\n\n showForm(): Promise<AdsConsentFormResult> {\n return native.showForm();\n },\n\n reset(): void {\n return native.reset();\n },\n\n getTCString(): Promise<string> {\n return native.getTCString();\n },\n\n async getTCModel(): Promise<TCModel> {\n const tcString = await native.getTCString();\n return TCString.decode(tcString);\n },\n\n async getUserChoices(): Promise<AdsConsentUserChoices> {\n const tcString = await native.getTCString();\n\n let tcModel: TCModel;\n\n try {\n tcModel = TCString.decode(tcString);\n } catch (e) {\n tcModel = new TCModel();\n\n if (__DEV__) {\n // eslint-disable-next-line no-console\n console.warn(`Failed to decode tcString ${tcString}:`, e);\n }\n }\n\n return {\n activelyScanDeviceCharacteristicsForIdentification: tcModel.specialFeatureOptins.has(\n AdsConsentSpecialFeatures.ACTIVELY_SCAN_DEVICE_CHARACTERISTICS_FOR_IDENTIFICATION,\n ),\n applyMarketResearchToGenerateAudienceInsights: tcModel.purposeConsents.has(\n AdsConsentPurposes.APPLY_MARKET_RESEARCH_TO_GENERATE_AUDIENCE_INSIGHTS,\n ),\n createAPersonalisedAdsProfile: tcModel.purposeConsents.has(\n AdsConsentPurposes.CREATE_A_PERSONALISED_ADS_PROFILE,\n ),\n createAPersonalisedContentProfile: tcModel.purposeConsents.has(\n AdsConsentPurposes.CREATE_A_PERSONALISED_ADS_PROFILE,\n ),\n developAndImproveProducts: tcModel.purposeConsents.has(\n AdsConsentPurposes.DEVELOP_AND_IMPROVE_PRODUCTS,\n ),\n measureAdPerformance: tcModel.purposeConsents.has(AdsConsentPurposes.MEASURE_AD_PERFORMANCE),\n measureContentPerformance: tcModel.purposeConsents.has(\n AdsConsentPurposes.MEASURE_CONTENT_PERFORMANCE,\n ),\n selectBasicAds: tcModel.purposeConsents.has(AdsConsentPurposes.SELECT_BASIC_ADS),\n selectPersonalisedAds: tcModel.purposeConsents.has(\n AdsConsentPurposes.SELECT_PERSONALISED_ADS,\n ),\n selectPersonalisedContent: tcModel.purposeConsents.has(\n AdsConsentPurposes.SELECT_PERSONALISED_CONTENT,\n ),\n storeAndAccessInformationOnDevice: tcModel.purposeConsents.has(\n AdsConsentPurposes.STORE_AND_ACCESS_INFORMATION_ON_DEVICE,\n ),\n usePreciseGeolocationData: tcModel.specialFeatureOptins.has(\n AdsConsentSpecialFeatures.USE_PRECISE_GEOLOCATION_DATA,\n ),\n };\n },\n};\n"]}
|
|
@@ -24,6 +24,8 @@ export let BannerAdSize;
|
|
|
24
24
|
BannerAdSize["LEADERBOARD"] = "LEADERBOARD";
|
|
25
25
|
BannerAdSize["MEDIUM_RECTANGLE"] = "MEDIUM_RECTANGLE";
|
|
26
26
|
BannerAdSize["ADAPTIVE_BANNER"] = "ADAPTIVE_BANNER";
|
|
27
|
+
BannerAdSize["ANCHORED_ADAPTIVE_BANNER"] = "ANCHORED_ADAPTIVE_BANNER";
|
|
28
|
+
BannerAdSize["INLINE_ADAPTIVE_BANNER"] = "INLINE_ADAPTIVE_BANNER";
|
|
27
29
|
BannerAdSize["FLUID"] = "FLUID";
|
|
28
30
|
BannerAdSize["WIDE_SKYSCRAPER"] = "WIDE_SKYSCRAPER";
|
|
29
31
|
})(BannerAdSize || (BannerAdSize = {}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["BannerAdSize.ts"],"names":["BannerAdSize"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,WAAYA,YAAZ;;WAAYA,Y;AAAAA,EAAAA,Y;AAAAA,EAAAA,Y;AAAAA,EAAAA,Y;AAAAA,EAAAA,Y;AAAAA,EAAAA,Y;AAAAA,EAAAA,Y;AAAAA,EAAAA,Y;AAAAA,EAAAA,Y;GAAAA,Y,KAAAA,Y","sourcesContent":["/*\n * Copyright (c) 2016-present Invertase Limited & Contributors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this library except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n *\n */\n\nexport enum BannerAdSize {\n /**\n * Mobile Marketing Association (MMA) banner ad size (320x50 density-independent pixels).\n */\n BANNER = 'BANNER',\n\n /**\n * Interactive Advertising Bureau (IAB) full banner ad size (468x60 density-independent pixels).\n */\n FULL_BANNER = 'FULL_BANNER',\n\n /**\n * Large banner ad size (320x100 density-independent pixels).\n */\n LARGE_BANNER = 'LARGE_BANNER',\n\n /**\n * Interactive Advertising Bureau (IAB) leaderboard ad size (728x90 density-independent pixels).\n */\n LEADERBOARD = 'LEADERBOARD',\n\n /**\n * Interactive Advertising Bureau (IAB) medium rectangle ad size (300x250 density-independent pixels).\n */\n MEDIUM_RECTANGLE = 'MEDIUM_RECTANGLE',\n\n /**\n * A (next generation) dynamically sized banner that is full-width and auto-height.\n */\n
|
|
1
|
+
{"version":3,"sources":["BannerAdSize.ts"],"names":["BannerAdSize"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,WAAYA,YAAZ;;WAAYA,Y;AAAAA,EAAAA,Y;AAAAA,EAAAA,Y;AAAAA,EAAAA,Y;AAAAA,EAAAA,Y;AAAAA,EAAAA,Y;AAAAA,EAAAA,Y;AAAAA,EAAAA,Y;AAAAA,EAAAA,Y;AAAAA,EAAAA,Y;AAAAA,EAAAA,Y;GAAAA,Y,KAAAA,Y","sourcesContent":["/*\n * Copyright (c) 2016-present Invertase Limited & Contributors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this library except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n *\n */\n\nexport enum BannerAdSize {\n /**\n * Mobile Marketing Association (MMA) banner ad size (320x50 density-independent pixels).\n */\n BANNER = 'BANNER',\n\n /**\n * Interactive Advertising Bureau (IAB) full banner ad size (468x60 density-independent pixels).\n */\n FULL_BANNER = 'FULL_BANNER',\n\n /**\n * Large banner ad size (320x100 density-independent pixels).\n */\n LARGE_BANNER = 'LARGE_BANNER',\n\n /**\n * Interactive Advertising Bureau (IAB) leaderboard ad size (728x90 density-independent pixels).\n */\n LEADERBOARD = 'LEADERBOARD',\n\n /**\n * Interactive Advertising Bureau (IAB) medium rectangle ad size (300x250 density-independent pixels).\n */\n MEDIUM_RECTANGLE = 'MEDIUM_RECTANGLE',\n\n /**\n * @deprecated Use `ANCHORED_ADAPTIVE_BANNER` instead.\n */\n ADAPTIVE_BANNER = 'ADAPTIVE_BANNER',\n\n /**\n * A (next generation) dynamically sized banner that is full-width and auto-height.\n */\n ANCHORED_ADAPTIVE_BANNER = 'ANCHORED_ADAPTIVE_BANNER',\n\n /**\n * Inline adaptive banners are larger, taller banners compared to anchored adaptive banners. They are of variable height, and can be as tall as the device screen.\n * They are intended to be placed in scrolling content.\n */\n INLINE_ADAPTIVE_BANNER = 'INLINE_ADAPTIVE_BANNER',\n\n /**\n * A dynamically sized banner that matches its parent's width and expands/contracts its height to match the ad's content after loading completes.\n */\n FLUID = 'FLUID',\n\n /**\n * IAB wide skyscraper ad size (160x600 density-independent pixels). This size is currently not supported by the Google Mobile Ads network; this is intended for mediation ad networks only.\n */\n WIDE_SKYSCRAPER = 'WIDE_SKYSCRAPER',\n}\n"]}
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
*/
|
|
17
17
|
import { Platform } from 'react-native';
|
|
18
18
|
import * as Base64 from './Base64';
|
|
19
|
-
import { isString } from './validate';
|
|
19
|
+
import { isString, isUndefined } from './validate';
|
|
20
20
|
export * from './id';
|
|
21
21
|
export * from './path';
|
|
22
22
|
export * from './promise';
|
|
@@ -76,6 +76,9 @@ export function isError(value) {
|
|
|
76
76
|
export function hasOwnProperty(target, property) {
|
|
77
77
|
return Object.hasOwnProperty.call(target, property);
|
|
78
78
|
}
|
|
79
|
+
export function isPropertySet(target, property) {
|
|
80
|
+
return hasOwnProperty(target, property) && !isUndefined(target[property]);
|
|
81
|
+
}
|
|
79
82
|
/**
|
|
80
83
|
* Remove a trailing forward slash from a string if it exists
|
|
81
84
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.ts"],"names":["Platform","Base64","isString","ReferenceBase","getDataUrlParts","dataUrlString","isBase64","includes","mediaType","base64String","split","undefined","replace","decodeURIComponent","btoa","once","fn","context","onceResult","ranOnce","onceInner","args","apply","isError","value","Object","prototype","toString","call","Error","hasOwnProperty","target","property","stripTrailingSlash","string","endsWith","slice","isIOS","OS","isAndroid","tryJSONParse","JSON","parse","jsonError","tryJSONStringify","data","stringify"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,SAASA,QAAT,QAAyB,cAAzB;AACA,OAAO,KAAKC,MAAZ,MAAwB,UAAxB;AACA,SAASC,QAAT,
|
|
1
|
+
{"version":3,"sources":["index.ts"],"names":["Platform","Base64","isString","isUndefined","ReferenceBase","getDataUrlParts","dataUrlString","isBase64","includes","mediaType","base64String","split","undefined","replace","decodeURIComponent","btoa","once","fn","context","onceResult","ranOnce","onceInner","args","apply","isError","value","Object","prototype","toString","call","Error","hasOwnProperty","target","property","isPropertySet","stripTrailingSlash","string","endsWith","slice","isIOS","OS","isAndroid","tryJSONParse","JSON","parse","jsonError","tryJSONStringify","data","stringify"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,SAASA,QAAT,QAAyB,cAAzB;AACA,OAAO,KAAKC,MAAZ,MAAwB,UAAxB;AACA,SAASC,QAAT,EAAmBC,WAAnB,QAAsC,YAAtC;AAEA,cAAc,MAAd;AACA,cAAc,QAAd;AACA,cAAc,WAAd;AACA,cAAc,YAAd;AAEA,SAASF,MAAT;AACA,SAASG,aAAT,QAA8B,iBAA9B;AAEA,OAAO,SAASC,eAAT,CAAyBC,aAAzB,EAAgD;AACrD,QAAMC,QAAQ,GAAGD,aAAa,CAACE,QAAd,CAAuB,SAAvB,CAAjB;AACA,MAAI,CAACC,SAAD,EAAYC,YAAZ,IAA4BJ,aAAa,CAACK,KAAd,CAAoB,GAApB,CAAhC;;AACA,MAAI,CAACF,SAAD,IAAc,CAACC,YAAnB,EAAiC;AAC/B,WAAO;AAAEA,MAAAA,YAAY,EAAEE,SAAhB;AAA2BH,MAAAA,SAAS,EAAEG;AAAtC,KAAP;AACD;;AACDH,EAAAA,SAAS,GAAGA,SAAS,CAACI,OAAV,CAAkB,OAAlB,EAA2B,EAA3B,EAA+BA,OAA/B,CAAuC,SAAvC,EAAkD,EAAlD,CAAZ;;AACA,MAAIH,YAAY,IAAIA,YAAY,CAACF,QAAb,CA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,MAA5B,EAA4C;AACjD,MAAI,CAAClC,QAAQ,CAACkC,MAAD,CAAb,EAAuB;AACrB,WAAOA,MAAP;AACD;;AACD,SAAOA,MAAM,CAACC,QAAP,CAAgB,GAAhB,IAAuBD,MAAM,CAACE,KAAP,CAAa,CAAb,EAAgB,CAAC,CAAjB,CAAvB,GAA6CF,MAApD;AACD;AAED,OAAO,MAAMG,KAAK,GAAGvC,QAAQ,CAACwC,EAAT,KAAgB,KAA9B;AAEP,OAAO,MAAMC,SAAS,GAAGzC,QAAQ,CAACwC,EAAT,KAAgB,SAAlC;AAEP,OAAO,SAASE,YAAT,CAAsBN,MAAtB,EAAsC;AAC3C,MAAI;AACF,WAAOA,MAAM,IAAIO,IAAI,CAACC,KAAL,CAAWR,MAAX,CAAjB;AACD,GAFD,CAEE,OAAOS,SAAP,EAAkB;AAClB,WAAOT,MAAP;AACD;AACF;AAED,OAAO,SAASU,gBAAT,CAA0BC,IAA1B,EAAyC;AAC9C,MAAI;AACF,WAAOJ,IAAI,CAACK,SAAL,CAAeD,IAAf,CAAP;AACD,GAFD,CAEE,OAAOF,SAAP,EAAkB;AAClB,WAAO,IAAP;AACD;AACF","sourcesContent":["/*\n * Copyright (c) 2016-present Invertase Limited & Contributors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this library except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\n\nimport { Platform } from 'react-native';\nimport * as Base64 from './Base64';\nimport { isString, isUndefined } from './validate';\n\nexport * from './id';\nexport * from './path';\nexport * from './promise';\nexport * from './validate';\n\nexport { Base64 };\nexport { ReferenceBase } from './ReferenceBase';\n\nexport function getDataUrlParts(dataUrlString: string) {\n const isBase64 = dataUrlString.includes(';base64');\n let [mediaType, base64String] = dataUrlString.split(',');\n if (!mediaType || !base64String) {\n return { base64String: undefined, mediaType: undefined };\n }\n mediaType = mediaType.replace('data:', '').replace(';base64', '');\n if (base64String && base64String.includes('%')) {\n base64String = decodeURIComponent(base64String);\n }\n if (!isBase64) {\n base64String = Base64.btoa(base64String);\n }\n return { base64String, mediaType };\n}\n\nexport function once<T>(fn: () => void, context: unknown): (this: T, ...args: []) => void {\n let onceResult: unknown;\n let ranOnce = false;\n\n return function onceInner(...args: []) {\n if (!ranOnce) {\n ranOnce = true;\n onceResult = fn.apply(context || this, args);\n }\n\n return onceResult;\n };\n}\n\nexport function isError(value: unknown) {\n if (Object.prototype.toString.call(value) === '[object Error]') {\n return true;\n }\n\n return value instanceof Error;\n}\n\nexport function hasOwnProperty(target: unknown, property: PropertyKey) {\n return Object.hasOwnProperty.call(target, property);\n}\n\nexport function isPropertySet(target: unknown, property: PropertyKey) {\n return (\n hasOwnProperty(target, property) &&\n !isUndefined((target as Record<PropertyKey, unknown>)[property])\n );\n}\n\n/**\n * Remove a trailing forward slash from a string if it exists\n *\n * @param string\n * @returns {*}\n */\nexport function stripTrailingSlash(string: string) {\n if (!isString(string)) {\n return string;\n }\n return string.endsWith('/') ? string.slice(0, -1) : string;\n}\n\nexport const isIOS = Platform.OS === 'ios';\n\nexport const isAndroid = Platform.OS === 'android';\n\nexport function tryJSONParse(string: string) {\n try {\n return string && JSON.parse(string);\n } catch (jsonError) {\n return string;\n }\n}\n\nexport function tryJSONStringify(data: unknown) {\n try {\n return JSON.stringify(data);\n } catch (jsonError) {\n return null;\n }\n}\n"]}
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*
|
|
16
16
|
*/
|
|
17
|
-
import {
|
|
17
|
+
import { isPropertySet, isArray, isBoolean, isObject } from './common';
|
|
18
18
|
import { MaxAdContentRating } from './MaxAdContentRating';
|
|
19
19
|
export function validateAdRequestConfiguration(requestConfiguration) {
|
|
20
20
|
const out = {};
|
|
@@ -31,7 +31,7 @@ export function validateAdRequestConfiguration(requestConfiguration) {
|
|
|
31
31
|
out.maxAdContentRating = requestConfiguration.maxAdContentRating;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
if (
|
|
34
|
+
if (isPropertySet(requestConfiguration, 'tagForChildDirectedTreatment')) {
|
|
35
35
|
if (!isBoolean(requestConfiguration.tagForChildDirectedTreatment)) {
|
|
36
36
|
throw new Error("'requestConfiguration.tagForChildDirectedTreatment' expected a boolean value");
|
|
37
37
|
}
|
|
@@ -39,7 +39,7 @@ export function validateAdRequestConfiguration(requestConfiguration) {
|
|
|
39
39
|
out.tagForChildDirectedTreatment = requestConfiguration.tagForChildDirectedTreatment;
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
if (
|
|
42
|
+
if (isPropertySet(requestConfiguration, 'tagForUnderAgeOfConsent')) {
|
|
43
43
|
if (!isBoolean(requestConfiguration.tagForUnderAgeOfConsent)) {
|
|
44
44
|
throw new Error("'requestConfiguration.tagForUnderAgeOfConsent' expected a boolean value");
|
|
45
45
|
}
|
|
@@ -47,7 +47,7 @@ export function validateAdRequestConfiguration(requestConfiguration) {
|
|
|
47
47
|
out.tagForUnderAgeOfConsent = requestConfiguration.tagForUnderAgeOfConsent;
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
if (
|
|
50
|
+
if (isPropertySet(requestConfiguration, 'testDeviceIdentifiers')) {
|
|
51
51
|
if (!isArray(requestConfiguration.testDeviceIdentifiers)) {
|
|
52
52
|
throw new Error("'requestConfiguration.testDeviceIdentifiers' expected an array value");
|
|
53
53
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["validateAdRequestConfiguration.ts"],"names":["
|
|
1
|
+
{"version":3,"sources":["validateAdRequestConfiguration.ts"],"names":["isPropertySet","isArray","isBoolean","isObject","MaxAdContentRating","validateAdRequestConfiguration","requestConfiguration","out","Error","maxAdContentRating","G","PG","T","MA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8D;AAC5D,YAAM,IAAIP,KAAJ,CAAU,yEAAV,CAAN;AACD;;AAEDD,IAAAA,GAAG,CAACQ,uBAAJ,GAA8BT,oBAAoB,CAACS,uBAAnD;AACD;;AAED,MAAIf,aAAa,CAACM,oBAAD,EAAuB,uBAAvB,CAAjB,EAAkE;AAChE,QAAI,CAACL,OAAO,CAACK,oBAAoB,CAACU,qBAAtB,CAAZ,EAA0D;AACxD,YAAM,IAAIR,KAAJ,CAAU,sEAAV,CAAN;AACD;;AAEDD,IAAAA,GAAG,CAACS,qBAAJ,GAA4BV,oBAAoB,CAACU,qBAAjD;AACD;;AAED,SAAOT,GAAP;AACD","sourcesContent":["/*\n * Copyright (c) 2016-present Invertase Limited & Contributors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this library except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\n\nimport { isPropertySet, isArray, isBoolean, isObject } from './common';\nimport { MaxAdContentRating } from './MaxAdContentRating';\nimport { RequestConfiguration } from './types/RequestConfiguration';\n\nexport function validateAdRequestConfiguration(requestConfiguration: RequestConfiguration) {\n const out: RequestConfiguration = {};\n\n if (!isObject(requestConfiguration)) {\n throw new Error(\"'requestConfiguration' expected an object value\");\n }\n\n if (requestConfiguration.maxAdContentRating) {\n if (\n requestConfiguration.maxAdContentRating !== MaxAdContentRating.G &&\n requestConfiguration.maxAdContentRating !== MaxAdContentRating.PG &&\n requestConfiguration.maxAdContentRating !== MaxAdContentRating.T &&\n requestConfiguration.maxAdContentRating !== MaxAdContentRating.MA\n ) {\n throw new Error(\n \"'requestConfiguration.maxAdContentRating' expected on of MaxAdContentRating.G, MaxAdContentRating.PG, MaxAdContentRating.T or MaxAdContentRating.MA\",\n );\n }\n\n out.maxAdContentRating = requestConfiguration.maxAdContentRating;\n }\n\n if (isPropertySet(requestConfiguration, 'tagForChildDirectedTreatment')) {\n if (!isBoolean(requestConfiguration.tagForChildDirectedTreatment)) {\n throw new Error(\n \"'requestConfiguration.tagForChildDirectedTreatment' expected a boolean value\",\n );\n }\n\n out.tagForChildDirectedTreatment = requestConfiguration.tagForChildDirectedTreatment;\n }\n\n if (isPropertySet(requestConfiguration, 'tagForUnderAgeOfConsent')) {\n if (!isBoolean(requestConfiguration.tagForUnderAgeOfConsent)) {\n throw new Error(\"'requestConfiguration.tagForUnderAgeOfConsent' expected a boolean value\");\n }\n\n out.tagForUnderAgeOfConsent = requestConfiguration.tagForUnderAgeOfConsent;\n }\n\n if (isPropertySet(requestConfiguration, 'testDeviceIdentifiers')) {\n if (!isArray(requestConfiguration.testDeviceIdentifiers)) {\n throw new Error(\"'requestConfiguration.testDeviceIdentifiers' expected an array value\");\n }\n\n out.testDeviceIdentifiers = requestConfiguration.testDeviceIdentifiers;\n }\n\n return out;\n}\n"]}
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*
|
|
16
16
|
*/
|
|
17
|
-
import {
|
|
17
|
+
import { isPropertySet, isArray, isBoolean, isObject, isString, isUndefined, isValidUrl } from './common';
|
|
18
18
|
export function validateAdRequestOptions(options) {
|
|
19
19
|
const out = {};
|
|
20
20
|
|
|
@@ -26,7 +26,7 @@ export function validateAdRequestOptions(options) {
|
|
|
26
26
|
throw new Error("'options' expected an object value");
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
if (
|
|
29
|
+
if (isPropertySet(options, 'requestNonPersonalizedAdsOnly')) {
|
|
30
30
|
if (!isBoolean(options.requestNonPersonalizedAdsOnly)) {
|
|
31
31
|
throw new Error("'options.requestNonPersonalizedAdsOnly' expected a boolean value");
|
|
32
32
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["validateAdRequestOptions.ts"],"names":["
|
|
1
|
+
{"version":3,"sources":["validateAdRequestOptions.ts"],"names":["isPropertySet","isArray","isBoolean","isObject","isString","isUndefined","isValidUrl","validateAdRequestOptions","options","out","Error","requestNonPersonalizedAdsOnly","networkExtras","Object","entries","forEach","key","value","keywords","i","length","keyword","contentUrl","requestAgent","serverSideVerificationOptions","ssvOptions","userId","customData","customTargeting"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,SACEA,aADF,EAEEC,OAFF,EAGEC,SAHF,EAIEC,QAJF,EAKEC,QALF,EAMEC,WANF,EAOEC,UAPF,QAQO,UARP;AAWA,OAAO,SAASC,wBAAT,CAAkCC,OAAlC,EAA4D;AACjE,QAAMC,GAAmB,GAAG,EAA5B;;AAEA,MAAIJ,WAAW,CAACG,OAAD,CAAf,EAA0B;AACxB,WAAOC,GAAP;AACD;;AAED,MAAI,CAACN,QAAQ,CAACK,OAAD,CAAb,EAAwB;AACtB,UAAM,IAAIE,KAAJ,CAAU,oCAAV,CAAN;AACD;;AAED,MAAIV,aAAa,CAACQ,OAAD,EAAU,+BAAV,CAAjB,EAA6D;AAC3D,QAAI,CAACN,SAAS,CAACM,OAAO,CAACG,6BAAT,CAAd,EAAuD;AACrD,YAAM,IAAID,KAAJ,CAAU,kEAAV,CAAN;AACD;;AAEDD,IAAAA,GAAG,CAACE,6BAAJ,GAAoCH,OAAO,CAACG,6BAA5C;AACD;;AAED,MAAIH,OAAO,CAACI,aAAZ,EAA2B;AACzB,QAAI,CAACT,QAAQ,CAACK,OAAO,CAACI,aAAT,CAAb,EAAsC;AACpC,YAAM,IAAIF,KAAJ,CAAU,+DAAV,CAAN;AACD;;AAEDG,IAAAA,MAAM,CAACC,OAAP,CAAeN,OAAO,CAACI,aAAvB,EAAsCG,OAAtC,CAA8C,QAAkB;AAAA,UAAjB,CAACC,GAAD,EAAMC,KAAN,CAAiB;;AAC9D,UAA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AO,CAACe,YAAT,CAAb,EAAqC;AACnC,YAAM,IAAIb,KAAJ,CAAU,gDAAV,CAAN;AACD;;AAEDD,IAAAA,GAAG,CAACc,YAAJ,GAAmBf,OAAO,CAACe,YAA3B;AACD;;AAED,MAAIf,OAAO,CAACgB,6BAAZ,EAA2C;AACzC,QAAI,CAACrB,QAAQ,CAACK,OAAO,CAACgB,6BAAT,CAAb,EAAsD;AACpD,YAAM,IAAId,KAAJ,CACJ,+EADI,CAAN;AAGD;;AAED,UAAMe,UAAU,GAAGjB,OAAO,CAACgB,6BAA3B;;AAEA,QAAIC,UAAU,CAACC,MAAX,IAAqB,CAACtB,QAAQ,CAACqB,UAAU,CAACC,MAAZ,CAAlC,EAAuD;AACrD,YAAM,IAAIhB,KAAJ,CAAU,wEAAV,CAAN;AACD;;AAED,QAAIe,UAAU,CAACE,UAAX,IAAyB,CAACvB,QAAQ,CAACqB,UAAU,CAACE,UAAZ,CAAtC,EAA+D;AAC7D,YAAM,IAAIjB,KAAJ,CAAU,4EAAV,CAAN;AACD;;AAEDD,IAAAA,GAAG,CAACe,6BAAJ,GAAoChB,OAAO,CAACgB,6BAA5C;AACD;;AAED,MAAIhB,OAAO,CAACoB,eAAZ,EAA6B;AAC3B,QAAI,CAACzB,QAAQ,CAACK,OAAO,CAACoB,eAAT,CAAb,EAAwC;AACtC,YAAM,IAAIlB,KAAJ,CAAU,iEAAV,CAAN;AACD;;AACDD,IAAAA,GAAG,CAACmB,eAAJ,GAAsBpB,OAAO,CAACoB,eAA9B;AACD;;AAED,SAAOnB,GAAP;AACD","sourcesContent":["/*\n * Copyright (c) 2016-present Invertase Limited & Contributors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this library except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\n\nimport {\n isPropertySet,\n isArray,\n isBoolean,\n isObject,\n isString,\n isUndefined,\n isValidUrl,\n} from './common';\nimport { RequestOptions } from './types/RequestOptions';\n\nexport function validateAdRequestOptions(options?: RequestOptions) {\n const out: RequestOptions = {};\n\n if (isUndefined(options)) {\n return out;\n }\n\n if (!isObject(options)) {\n throw new Error(\"'options' expected an object value\");\n }\n\n if (isPropertySet(options, 'requestNonPersonalizedAdsOnly')) {\n if (!isBoolean(options.requestNonPersonalizedAdsOnly)) {\n throw new Error(\"'options.requestNonPersonalizedAdsOnly' expected a boolean value\");\n }\n\n out.requestNonPersonalizedAdsOnly = options.requestNonPersonalizedAdsOnly;\n }\n\n if (options.networkExtras) {\n if (!isObject(options.networkExtras)) {\n throw new Error(\"'options.networkExtras' expected an object of key/value pairs\");\n }\n\n Object.entries(options.networkExtras).forEach(([key, value]) => {\n if (!isString(value)) {\n throw new Error(`'options.networkExtras' expected a string value for object key \"${key}\"`);\n }\n });\n\n out.networkExtras = options.networkExtras;\n }\n\n if (options.keywords) {\n if (!isArray(options.keywords)) {\n throw new Error(\"'options.keywords' expected an array containing string values\");\n }\n\n for (let i = 0; i < options.keywords.length; i++) {\n const keyword = options.keywords[i];\n\n if (!isString(keyword)) {\n throw new Error(\"'options.keywords' expected an array containing string values\");\n }\n }\n\n out.keywords = options.keywords;\n }\n\n if (options.contentUrl) {\n if (!isString(options.contentUrl)) {\n throw new Error(\"'options.contentUrl' expected a string value\");\n }\n\n if (!isValidUrl(options.contentUrl)) {\n throw new Error(\"'options.contentUrl' expected a valid HTTP or HTTPS url.\");\n }\n\n if (options.contentUrl.length > 512) {\n throw new Error(\"'options.contentUrl' maximum length of a content URL is 512 characters.\");\n }\n\n out.contentUrl = options.contentUrl;\n }\n\n if (options.requestAgent) {\n if (!isString(options.requestAgent)) {\n throw new Error(\"'options.requestAgent' expected a string value\");\n }\n\n out.requestAgent = options.requestAgent;\n }\n\n if (options.serverSideVerificationOptions) {\n if (!isObject(options.serverSideVerificationOptions)) {\n throw new Error(\n \"'options.serverSideVerificationOptions' expected an object of key/value pairs\",\n );\n }\n\n const ssvOptions = options.serverSideVerificationOptions;\n\n if (ssvOptions.userId && !isString(ssvOptions.userId)) {\n throw new Error(\"'options.serverSideVerificationOptions.userId' expected a string value\");\n }\n\n if (ssvOptions.customData && !isString(ssvOptions.customData)) {\n throw new Error(\"'options.serverSideVerificationOptions.customData' expected a string value\");\n }\n\n out.serverSideVerificationOptions = options.serverSideVerificationOptions;\n }\n\n if (options.customTargeting) {\n if (!isObject(options.customTargeting)) {\n throw new Error(\"'options.customTargeting' expected an object of key/value pairs\");\n }\n out.customTargeting = options.customTargeting;\n }\n\n return out;\n}\n"]}
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*
|
|
16
16
|
*/
|
|
17
|
-
import {
|
|
17
|
+
import { isPropertySet, isBoolean, isObject, isUndefined } from './common';
|
|
18
18
|
export function validateAdShowOptions(options) {
|
|
19
19
|
const out = {};
|
|
20
20
|
|
|
@@ -26,7 +26,7 @@ export function validateAdShowOptions(options) {
|
|
|
26
26
|
throw new Error("'options' expected an object value");
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
if (
|
|
29
|
+
if (isPropertySet(options, 'immersiveModeEnabled')) {
|
|
30
30
|
if (!isBoolean(options.immersiveModeEnabled)) {
|
|
31
31
|
throw new Error("'options.immersiveModeEnabled' expected a boolean value");
|
|
32
32
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["validateAdShowOptions.ts"],"names":["
|
|
1
|
+
{"version":3,"sources":["validateAdShowOptions.ts"],"names":["isPropertySet","isBoolean","isObject","isUndefined","validateAdShowOptions","options","out","Error","immersiveModeEnabled"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,SAASA,aAAT,EAAwBC,SAAxB,EAAmCC,QAAnC,EAA6CC,WAA7C,QAAgE,UAAhE;AAGA,OAAO,SAASC,qBAAT,CAA+BC,OAA/B,EAAwD;AAC7D,QAAMC,GAAkB,GAAG,EAA3B;;AAEA,MAAIH,WAAW,CAACE,OAAD,CAAf,EAA0B;AACxB,WAAOC,GAAP;AACD;;AAED,MAAI,CAACJ,QAAQ,CAACG,OAAD,CAAb,EAAwB;AACtB,UAAM,IAAIE,KAAJ,CAAU,oCAAV,CAAN;AACD;;AAED,MAAIP,aAAa,CAACK,OAAD,EAAU,sBAAV,CAAjB,EAAoD;AAClD,QAAI,CAACJ,SAAS,CAACI,OAAO,CAACG,oBAAT,CAAd,EAA8C;AAC5C,YAAM,IAAID,KAAJ,CAAU,yDAAV,CAAN;AACD;;AAEDD,IAAAA,GAAG,CAACE,oBAAJ,GAA2BH,OAAO,CAACG,oBAAnC;AACD;;AAED,SAAOF,GAAP;AACD","sourcesContent":["/*\n * Copyright (c) 2016-present Invertase Limited & Contributors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this library except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\n\nimport { isPropertySet, isBoolean, isObject, isUndefined } from './common';\nimport { AdShowOptions } from './types/AdShowOptions';\n\nexport function validateAdShowOptions(options?: AdShowOptions) {\n const out: AdShowOptions = {};\n\n if (isUndefined(options)) {\n return out;\n }\n\n if (!isObject(options)) {\n throw new Error(\"'options' expected an object value\");\n }\n\n if (isPropertySet(options, 'immersiveModeEnabled')) {\n if (!isBoolean(options.immersiveModeEnabled)) {\n throw new Error(\"'options.immersiveModeEnabled' expected a boolean value\");\n }\n\n out.immersiveModeEnabled = options.immersiveModeEnabled;\n }\n\n return out;\n}\n"]}
|
package/lib/module/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["version.ts"],"names":["version"],"mappings":"AAAA;AACA,OAAO,MAAMA,OAAO,GAAG,OAAhB","sourcesContent":["// Generated by genversion.\nexport const version = '6.
|
|
1
|
+
{"version":3,"sources":["version.ts"],"names":["version"],"mappings":"AAAA;AACA,OAAO,MAAMA,OAAO,GAAG,OAAhB","sourcesContent":["// Generated by genversion.\nexport const version = '6.2.2';\n"]}
|
|
@@ -20,9 +20,18 @@ export declare enum BannerAdSize {
|
|
|
20
20
|
*/
|
|
21
21
|
MEDIUM_RECTANGLE = "MEDIUM_RECTANGLE",
|
|
22
22
|
/**
|
|
23
|
-
*
|
|
23
|
+
* @deprecated Use `ANCHORED_ADAPTIVE_BANNER` instead.
|
|
24
24
|
*/
|
|
25
25
|
ADAPTIVE_BANNER = "ADAPTIVE_BANNER",
|
|
26
|
+
/**
|
|
27
|
+
* A (next generation) dynamically sized banner that is full-width and auto-height.
|
|
28
|
+
*/
|
|
29
|
+
ANCHORED_ADAPTIVE_BANNER = "ANCHORED_ADAPTIVE_BANNER",
|
|
30
|
+
/**
|
|
31
|
+
* Inline adaptive banners are larger, taller banners compared to anchored adaptive banners. They are of variable height, and can be as tall as the device screen.
|
|
32
|
+
* They are intended to be placed in scrolling content.
|
|
33
|
+
*/
|
|
34
|
+
INLINE_ADAPTIVE_BANNER = "INLINE_ADAPTIVE_BANNER",
|
|
26
35
|
/**
|
|
27
36
|
* A dynamically sized banner that matches its parent's width and expands/contracts its height to match the ad's content after loading completes.
|
|
28
37
|
*/
|
|
@@ -15,6 +15,7 @@ export declare function getDataUrlParts(dataUrlString: string): {
|
|
|
15
15
|
export declare function once<T>(fn: () => void, context: unknown): (this: T, ...args: []) => void;
|
|
16
16
|
export declare function isError(value: unknown): boolean;
|
|
17
17
|
export declare function hasOwnProperty(target: unknown, property: PropertyKey): boolean;
|
|
18
|
+
export declare function isPropertySet(target: unknown, property: PropertyKey): boolean;
|
|
18
19
|
/**
|
|
19
20
|
* Remove a trailing forward slash from a string if it exists
|
|
20
21
|
*
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "6.
|
|
1
|
+
export declare const SDK_VERSION = "6.2.2";
|
|
2
2
|
export { default, MobileAds } from './MobileAds';
|
|
3
3
|
export { AdsConsentDebugGeography } from './AdsConsentDebugGeography';
|
|
4
4
|
export { AdsConsentPurposes } from './AdsConsentPurposes';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "6.
|
|
1
|
+
export declare const version = "6.2.2";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-google-mobile-ads",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.2.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",
|
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
"tests:ios:test-cover": "cd RNGoogleMobileAdsExample && ./node_modules/.bin/nyc yarn detox test --configuration ios.sim.debug",
|
|
98
98
|
"tests:ios:test-cover-reuse": "cd RNGoogleMobileAdsExample && node_modules/.bin/nyc yarn detox test --configuration ios.sim.debug --reuse --loglevel warn",
|
|
99
99
|
"tests:ios:pod:install": "cd RNGoogleMobileAdsExample && cd ios && rm -rf RNGoogleMobileAdsExample.xcworkspace && rm -f Podfile.lock && pod install --repo-update && cd ..",
|
|
100
|
-
"package:update": "yarn upgrade --latest
|
|
100
|
+
"package:update": "yarn upgrade --latest"
|
|
101
101
|
},
|
|
102
102
|
"dependencies": {
|
|
103
103
|
"@iabtcf/core": "^1.4.0",
|
|
@@ -113,13 +113,13 @@
|
|
|
113
113
|
"@semantic-release/npm": "^9.0.1",
|
|
114
114
|
"@semantic-release/release-notes-generator": "^10.0.3",
|
|
115
115
|
"@types/jest": "^27.4.1",
|
|
116
|
-
"@types/node": "^17.0.
|
|
116
|
+
"@types/node": "^17.0.30",
|
|
117
117
|
"@types/react": "^18.0.8",
|
|
118
118
|
"@types/react-native": "^0.67.6",
|
|
119
119
|
"@typescript-eslint/eslint-plugin": "^5.21.0",
|
|
120
120
|
"@typescript-eslint/parser": "^5.21.0",
|
|
121
|
-
"babel-jest": "^28.0.
|
|
122
|
-
"clang-format": "1.
|
|
121
|
+
"babel-jest": "^28.0.3",
|
|
122
|
+
"clang-format": "1.8.0",
|
|
123
123
|
"codecov": "^3.8.3",
|
|
124
124
|
"conventional-changelog-cli": "^2.2.2",
|
|
125
125
|
"eslint": "^8.14.0",
|
|
@@ -130,8 +130,8 @@
|
|
|
130
130
|
"eslint-plugin-react": "^7.29.4",
|
|
131
131
|
"genversion": "^3.1.1",
|
|
132
132
|
"google-java-format": "^1.0.1",
|
|
133
|
-
"inquirer": "^8.2.
|
|
134
|
-
"jest": "^28.0.
|
|
133
|
+
"inquirer": "^8.2.4",
|
|
134
|
+
"jest": "^28.0.3",
|
|
135
135
|
"lerna": "4.0.0",
|
|
136
136
|
"prettier": "^2.6.2",
|
|
137
137
|
"react": "^18.1.0",
|
|
@@ -142,7 +142,7 @@
|
|
|
142
142
|
"shelljs": "^0.8.5",
|
|
143
143
|
"ts-jest": "^27.1.4",
|
|
144
144
|
"ts-node": "^10.7.0",
|
|
145
|
-
"typescript": "^4.6.
|
|
145
|
+
"typescript": "^4.6.4"
|
|
146
146
|
},
|
|
147
147
|
"publishConfig": {
|
|
148
148
|
"access": "public"
|
package/src/AdsConsent.ts
CHANGED
|
@@ -20,7 +20,7 @@ import { NativeModules } from 'react-native';
|
|
|
20
20
|
import { AdsConsentDebugGeography } from './AdsConsentDebugGeography';
|
|
21
21
|
import { AdsConsentPurposes } from './AdsConsentPurposes';
|
|
22
22
|
import { AdsConsentSpecialFeatures } from './AdsConsentSpecialFeatures';
|
|
23
|
-
import {
|
|
23
|
+
import { isPropertySet, isArray, isBoolean, isObject, isString } from './common';
|
|
24
24
|
import {
|
|
25
25
|
AdsConsentFormResult,
|
|
26
26
|
AdsConsentInfo,
|
|
@@ -38,7 +38,7 @@ export const AdsConsent: AdsConsentInterface = {
|
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
if (
|
|
41
|
-
|
|
41
|
+
isPropertySet(options, 'debugGeography') &&
|
|
42
42
|
options.debugGeography !== AdsConsentDebugGeography.DISABLED &&
|
|
43
43
|
options.debugGeography !== AdsConsentDebugGeography.EEA &&
|
|
44
44
|
options.debugGeography !== AdsConsentDebugGeography.NOT_EEA
|
|
@@ -49,7 +49,7 @@ export const AdsConsent: AdsConsentInterface = {
|
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
if (
|
|
52
|
-
|
|
52
|
+
isPropertySet(options, 'tagForUnderAgeOfConsent') &&
|
|
53
53
|
!isBoolean(options.tagForUnderAgeOfConsent)
|
|
54
54
|
) {
|
|
55
55
|
throw new Error(
|
|
@@ -57,7 +57,7 @@ export const AdsConsent: AdsConsentInterface = {
|
|
|
57
57
|
);
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
-
if (
|
|
60
|
+
if (isPropertySet(options, 'testDeviceIdentifiers')) {
|
|
61
61
|
if (!isArray(options.testDeviceIdentifiers)) {
|
|
62
62
|
throw new Error(
|
|
63
63
|
"AdsConsent.requestInfoUpdate(*) 'options.testDeviceIdentifiers' expected an array of string values.",
|
package/src/BannerAdSize.ts
CHANGED
|
@@ -43,10 +43,21 @@ export enum BannerAdSize {
|
|
|
43
43
|
MEDIUM_RECTANGLE = 'MEDIUM_RECTANGLE',
|
|
44
44
|
|
|
45
45
|
/**
|
|
46
|
-
*
|
|
46
|
+
* @deprecated Use `ANCHORED_ADAPTIVE_BANNER` instead.
|
|
47
47
|
*/
|
|
48
48
|
ADAPTIVE_BANNER = 'ADAPTIVE_BANNER',
|
|
49
49
|
|
|
50
|
+
/**
|
|
51
|
+
* A (next generation) dynamically sized banner that is full-width and auto-height.
|
|
52
|
+
*/
|
|
53
|
+
ANCHORED_ADAPTIVE_BANNER = 'ANCHORED_ADAPTIVE_BANNER',
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Inline adaptive banners are larger, taller banners compared to anchored adaptive banners. They are of variable height, and can be as tall as the device screen.
|
|
57
|
+
* They are intended to be placed in scrolling content.
|
|
58
|
+
*/
|
|
59
|
+
INLINE_ADAPTIVE_BANNER = 'INLINE_ADAPTIVE_BANNER',
|
|
60
|
+
|
|
50
61
|
/**
|
|
51
62
|
* A dynamically sized banner that matches its parent's width and expands/contracts its height to match the ad's content after loading completes.
|
|
52
63
|
*/
|
package/src/common/index.ts
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
|
|
18
18
|
import { Platform } from 'react-native';
|
|
19
19
|
import * as Base64 from './Base64';
|
|
20
|
-
import { isString } from './validate';
|
|
20
|
+
import { isString, isUndefined } from './validate';
|
|
21
21
|
|
|
22
22
|
export * from './id';
|
|
23
23
|
export * from './path';
|
|
@@ -69,6 +69,13 @@ export function hasOwnProperty(target: unknown, property: PropertyKey) {
|
|
|
69
69
|
return Object.hasOwnProperty.call(target, property);
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
+
export function isPropertySet(target: unknown, property: PropertyKey) {
|
|
73
|
+
return (
|
|
74
|
+
hasOwnProperty(target, property) &&
|
|
75
|
+
!isUndefined((target as Record<PropertyKey, unknown>)[property])
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
|
|
72
79
|
/**
|
|
73
80
|
* Remove a trailing forward slash from a string if it exists
|
|
74
81
|
*
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
|
-
import {
|
|
18
|
+
import { isPropertySet, isArray, isBoolean, isObject } from './common';
|
|
19
19
|
import { MaxAdContentRating } from './MaxAdContentRating';
|
|
20
20
|
import { RequestConfiguration } from './types/RequestConfiguration';
|
|
21
21
|
|
|
@@ -41,7 +41,7 @@ export function validateAdRequestConfiguration(requestConfiguration: RequestConf
|
|
|
41
41
|
out.maxAdContentRating = requestConfiguration.maxAdContentRating;
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
if (
|
|
44
|
+
if (isPropertySet(requestConfiguration, 'tagForChildDirectedTreatment')) {
|
|
45
45
|
if (!isBoolean(requestConfiguration.tagForChildDirectedTreatment)) {
|
|
46
46
|
throw new Error(
|
|
47
47
|
"'requestConfiguration.tagForChildDirectedTreatment' expected a boolean value",
|
|
@@ -51,7 +51,7 @@ export function validateAdRequestConfiguration(requestConfiguration: RequestConf
|
|
|
51
51
|
out.tagForChildDirectedTreatment = requestConfiguration.tagForChildDirectedTreatment;
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
if (
|
|
54
|
+
if (isPropertySet(requestConfiguration, 'tagForUnderAgeOfConsent')) {
|
|
55
55
|
if (!isBoolean(requestConfiguration.tagForUnderAgeOfConsent)) {
|
|
56
56
|
throw new Error("'requestConfiguration.tagForUnderAgeOfConsent' expected a boolean value");
|
|
57
57
|
}
|
|
@@ -59,7 +59,7 @@ export function validateAdRequestConfiguration(requestConfiguration: RequestConf
|
|
|
59
59
|
out.tagForUnderAgeOfConsent = requestConfiguration.tagForUnderAgeOfConsent;
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
-
if (
|
|
62
|
+
if (isPropertySet(requestConfiguration, 'testDeviceIdentifiers')) {
|
|
63
63
|
if (!isArray(requestConfiguration.testDeviceIdentifiers)) {
|
|
64
64
|
throw new Error("'requestConfiguration.testDeviceIdentifiers' expected an array value");
|
|
65
65
|
}
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
18
|
import {
|
|
19
|
-
|
|
19
|
+
isPropertySet,
|
|
20
20
|
isArray,
|
|
21
21
|
isBoolean,
|
|
22
22
|
isObject,
|
|
@@ -37,7 +37,7 @@ export function validateAdRequestOptions(options?: RequestOptions) {
|
|
|
37
37
|
throw new Error("'options' expected an object value");
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
if (
|
|
40
|
+
if (isPropertySet(options, 'requestNonPersonalizedAdsOnly')) {
|
|
41
41
|
if (!isBoolean(options.requestNonPersonalizedAdsOnly)) {
|
|
42
42
|
throw new Error("'options.requestNonPersonalizedAdsOnly' expected a boolean value");
|
|
43
43
|
}
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
|
-
import {
|
|
18
|
+
import { isPropertySet, isBoolean, isObject, isUndefined } from './common';
|
|
19
19
|
import { AdShowOptions } from './types/AdShowOptions';
|
|
20
20
|
|
|
21
21
|
export function validateAdShowOptions(options?: AdShowOptions) {
|
|
@@ -29,7 +29,7 @@ export function validateAdShowOptions(options?: AdShowOptions) {
|
|
|
29
29
|
throw new Error("'options' expected an object value");
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
if (
|
|
32
|
+
if (isPropertySet(options, 'immersiveModeEnabled')) {
|
|
33
33
|
if (!isBoolean(options.immersiveModeEnabled)) {
|
|
34
34
|
throw new Error("'options.immersiveModeEnabled' expected a boolean value");
|
|
35
35
|
}
|
package/src/version.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Generated by genversion.
|
|
2
|
-
export const version = '6.
|
|
2
|
+
export const version = '6.2.2';
|