react-native-google-mobile-ads 4.1.0 → 4.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -29,7 +29,7 @@ var _AdsConsentStatus = require("./AdsConsentStatus");
29
29
  * limitations under the License.
30
30
  *
31
31
  */
32
- const native = _reactNative.NativeModules.RNGoogleAdsConsentModule;
32
+ const native = _reactNative.NativeModules.RNGoogleMobileAdsConsentModule;
33
33
  const AdsConsent = {
34
34
  /**
35
35
  *
@@ -1 +1 @@
1
- {"version":3,"sources":["AdsConsent.ts"],"names":["native","NativeModules","RNGoogleAdsConsentModule","AdsConsent","requestInfoUpdate","publisherIds","Error","length","i","showForm","options","privacyPolicy","withPersonalizedAds","withNonPersonalizedAds","withAdFree","getAdProviders","setDebugGeography","geography","AdsConsentDebugGeography","DISABLED","EEA","NOT_EEA","getStatus","setStatus","status","AdsConsentStatus","UNKNOWN","NON_PERSONALIZED","PERSONALIZED","setTagForUnderAgeOfConsent","tag","addTestDevices","deviceIds"],"mappings":";;;;;;;AAiBA;;AASA;;AACA;;AACA;;AA5BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAgBA,MAAMA,MAAM,GAAGC,2BAAcC,wBAA7B;AAEO,MAAMC,UAA+B,GAAG;AAC7C;AACF;AACA;AACA;AACA;AACEC,EAAAA,iBAAiB,CAACC,YAAD,EAAe;AAC9B,QAAI,CAAC,qBAAQA,YAAR,CAAL,EAA4B;AAC1B,YAAM,IAAIC,KAAJ,CACJ,oFADI,CAAN;AAGD;;AAED,QAAID,YAAY,CAACE,MAAb,KAAwB,CAA5B,EAA+B;AAC7B,YAAM,IAAID,KAAJ,CACJ,uFADI,CAAN;AAGD;;AAED,SAAK,IAAIE,CAAC,GAAG,CAAb,EAAgBA,CAAC,GAAGH,YAAY,CAACE,MAAjC,EAAyCC,CAAC,EAA1C,EAA8C;AAC5C,UAAI,CAAC,s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,CAAC,sBAASwB,SAAS,CAACxB,CAAD,CAAlB,CAAL,EAA6B;AAC3B,cAAM,IAAIF,KAAJ,CACJ,8EADI,CAAN;AAGD;AACF;;AAED,WAAON,MAAM,CAAC+B,cAAP,CAAsBC,SAAtB,CAAP;AACD;;AA5J4C,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 {\n hasOwnProperty,\n isArray,\n isBoolean,\n isObject,\n isString,\n isUndefined,\n isValidUrl,\n} from './common';\nimport { NativeModules } from 'react-native';\nimport { AdsConsentDebugGeography } from './AdsConsentDebugGeography';\nimport { AdsConsentStatus } from './AdsConsentStatus';\nimport { AdsConsentInterface } from './types/AdsConsent.interface';\n\nconst native = NativeModules.RNGoogleAdsConsentModule;\n\nexport const AdsConsent: AdsConsentInterface = {\n /**\n *\n * @param publisherIds\n * @returns {*}\n */\n requestInfoUpdate(publisherIds) {\n if (!isArray(publisherIds)) {\n throw new Error(\n \"AdsConsent.requestInfoUpdate(*) 'publisherIds' expected an array of string values.\",\n );\n }\n\n if (publisherIds.length === 0) {\n throw new Error(\n \"AdsConsent.requestInfoUpdate(*) 'publisherIds' list of publisher IDs cannot be empty.\",\n );\n }\n\n for (let i = 0; i < publisherIds.length; i++) {\n if (!isString(publisherIds[i])) {\n throw new Error(\n `AdsConsent.requestInfoUpdate(*) 'publisherIds[${i}]' expected a string value.`,\n );\n }\n }\n\n return native.requestInfoUpdate(publisherIds);\n },\n\n /**\n *\n * @param options\n * @returns {*}\n */\n showForm(options) {\n if (!isUndefined(options) && !isObject(options)) {\n throw new Error(\"AdsConsent.showForm(*) 'options' expected an object value.\");\n }\n\n if (!isValidUrl(options.privacyPolicy)) {\n throw new Error(\n \"AdsConsent.showForm(*) 'options.privacyPolicy' expected a valid HTTP or HTTPS URL.\",\n );\n }\n\n if (hasOwnProperty(options, 'withPersonalizedAds') && !isBoolean(options.withPersonalizedAds)) {\n throw new Error(\n \"AdsConsent.showForm(*) 'options.withPersonalizedAds' expected a boolean value.\",\n );\n }\n\n if (\n hasOwnProperty(options, 'withNonPersonalizedAds') &&\n !isBoolean(options.withNonPersonalizedAds)\n ) {\n throw new Error(\n \"AdsConsent.showForm(*) 'options.withNonPersonalizedAds' expected a boolean value.\",\n );\n }\n\n if (hasOwnProperty(options, 'withAdFree') && !isBoolean(options.withAdFree)) {\n throw new Error(\"AdsConsent.showForm(*) 'options.withAdFree' expected a boolean value.\");\n }\n\n if (!options.withPersonalizedAds && !options.withNonPersonalizedAds && !options.withAdFree) {\n throw new Error(\n \"AdsConsent.showForm(*) 'options' form requires at least one option to be enabled.\",\n );\n }\n\n return native.showForm(options);\n },\n\n /**\n *\n */\n getAdProviders() {\n return native.getAdProviders();\n },\n\n /**\n *\n * @param geography\n */\n setDebugGeography(geography) {\n if (\n geography !== AdsConsentDebugGeography.DISABLED &&\n geography !== AdsConsentDebugGeography.EEA &&\n geography !== AdsConsentDebugGeography.NOT_EEA\n ) {\n throw new Error(\n \"AdsConsent.setDebugGeography(*) 'geography' expected one of AdsConsentDebugGeography.DISABLED, AdsConsentDebugGeography.EEA or AdsConsentDebugGeography.NOT_EEA.\",\n );\n }\n\n return native.setDebugGeography(geography);\n },\n\n /**\n *\n */\n getStatus() {\n return native.getStatus();\n },\n\n /**\n *\n * @param status\n */\n setStatus(status) {\n if (\n status !== AdsConsentStatus.UNKNOWN &&\n status !== AdsConsentStatus.NON_PERSONALIZED &&\n status !== AdsConsentStatus.PERSONALIZED\n ) {\n throw new Error(\n \"AdsConsent.setStatus(*) 'status' expected one of AdsConsentStatus.UNKNOWN, AdsConsentStatus.NON_PERSONALIZED or AdsConsentStatus.PERSONALIZED.\",\n );\n }\n\n return native.setStatus(status);\n },\n\n /**\n *\n * @param tag\n */\n setTagForUnderAgeOfConsent(tag) {\n if (!isBoolean(tag)) {\n throw new Error(\"AdsConsent.setTagForUnderAgeOfConsent(*) 'tag' expected a boolean value.\");\n }\n\n return native.setTagForUnderAgeOfConsent(tag);\n },\n\n /**\n *\n * @param deviceIds\n */\n addTestDevices(deviceIds) {\n if (!isArray(deviceIds)) {\n throw new Error(\n \"AdsConsent.addTestDevices(*) 'deviceIds' expected an array of string values.\",\n );\n }\n\n for (let i = 0; i < deviceIds.length; i++) {\n if (!isString(deviceIds[i])) {\n throw new Error(\n \"AdsConsent.addTestDevices(*) 'deviceIds' expected an array of string values.\",\n );\n }\n }\n\n return native.addTestDevices(deviceIds);\n },\n};\n"]}
1
+ {"version":3,"sources":["AdsConsent.ts"],"names":["native","NativeModules","RNGoogleMobileAdsConsentModule","AdsConsent","requestInfoUpdate","publisherIds","Error","length","i","showForm","options","privacyPolicy","withPersonalizedAds","withNonPersonalizedAds","withAdFree","getAdProviders","setDebugGeography","geography","AdsConsentDebugGeography","DISABLED","EEA","NOT_EEA","getStatus","setStatus","status","AdsConsentStatus","UNKNOWN","NON_PERSONALIZED","PERSONALIZED","setTagForUnderAgeOfConsent","tag","addTestDevices","deviceIds"],"mappings":";;;;;;;AAiBA;;AASA;;AACA;;AACA;;AA5BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAgBA,MAAMA,MAAM,GAAGC,2BAAcC,8BAA7B;AAEO,MAAMC,UAA+B,GAAG;AAC7C;AACF;AACA;AACA;AACA;AACEC,EAAAA,iBAAiB,CAACC,YAAD,EAAe;AAC9B,QAAI,CAAC,qBAAQA,YAAR,CAAL,EAA4B;AAC1B,YAAM,IAAIC,KAAJ,CACJ,oFADI,CAAN;AAGD;;AAED,QAAID,YAAY,C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AAI,CAAC,qBAAQA,SAAR,CAAL,EAAyB;AACvB,YAAM,IAAI1B,KAAJ,CACJ,8EADI,CAAN;AAGD;;AAED,SAAK,IAAIE,CAAC,GAAG,CAAb,EAAgBA,CAAC,GAAGwB,SAAS,CAACzB,MAA9B,EAAsCC,CAAC,EAAvC,EAA2C;AACzC,UAAI,CAAC,sBAASwB,SAAS,CAACxB,CAAD,CAAlB,CAAL,EAA6B;AAC3B,cAAM,IAAIF,KAAJ,CACJ,8EADI,CAAN;AAGD;AACF;;AAED,WAAON,MAAM,CAAC+B,cAAP,CAAsBC,SAAtB,CAAP;AACD;;AA5J4C,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 {\n hasOwnProperty,\n isArray,\n isBoolean,\n isObject,\n isString,\n isUndefined,\n isValidUrl,\n} from './common';\nimport { NativeModules } from 'react-native';\nimport { AdsConsentDebugGeography } from './AdsConsentDebugGeography';\nimport { AdsConsentStatus } from './AdsConsentStatus';\nimport { AdsConsentInterface } from './types/AdsConsent.interface';\n\nconst native = NativeModules.RNGoogleMobileAdsConsentModule;\n\nexport const AdsConsent: AdsConsentInterface = {\n /**\n *\n * @param publisherIds\n * @returns {*}\n */\n requestInfoUpdate(publisherIds) {\n if (!isArray(publisherIds)) {\n throw new Error(\n \"AdsConsent.requestInfoUpdate(*) 'publisherIds' expected an array of string values.\",\n );\n }\n\n if (publisherIds.length === 0) {\n throw new Error(\n \"AdsConsent.requestInfoUpdate(*) 'publisherIds' list of publisher IDs cannot be empty.\",\n );\n }\n\n for (let i = 0; i < publisherIds.length; i++) {\n if (!isString(publisherIds[i])) {\n throw new Error(\n `AdsConsent.requestInfoUpdate(*) 'publisherIds[${i}]' expected a string value.`,\n );\n }\n }\n\n return native.requestInfoUpdate(publisherIds);\n },\n\n /**\n *\n * @param options\n * @returns {*}\n */\n showForm(options) {\n if (!isUndefined(options) && !isObject(options)) {\n throw new Error(\"AdsConsent.showForm(*) 'options' expected an object value.\");\n }\n\n if (!isValidUrl(options.privacyPolicy)) {\n throw new Error(\n \"AdsConsent.showForm(*) 'options.privacyPolicy' expected a valid HTTP or HTTPS URL.\",\n );\n }\n\n if (hasOwnProperty(options, 'withPersonalizedAds') && !isBoolean(options.withPersonalizedAds)) {\n throw new Error(\n \"AdsConsent.showForm(*) 'options.withPersonalizedAds' expected a boolean value.\",\n );\n }\n\n if (\n hasOwnProperty(options, 'withNonPersonalizedAds') &&\n !isBoolean(options.withNonPersonalizedAds)\n ) {\n throw new Error(\n \"AdsConsent.showForm(*) 'options.withNonPersonalizedAds' expected a boolean value.\",\n );\n }\n\n if (hasOwnProperty(options, 'withAdFree') && !isBoolean(options.withAdFree)) {\n throw new Error(\"AdsConsent.showForm(*) 'options.withAdFree' expected a boolean value.\");\n }\n\n if (!options.withPersonalizedAds && !options.withNonPersonalizedAds && !options.withAdFree) {\n throw new Error(\n \"AdsConsent.showForm(*) 'options' form requires at least one option to be enabled.\",\n );\n }\n\n return native.showForm(options);\n },\n\n /**\n *\n */\n getAdProviders() {\n return native.getAdProviders();\n },\n\n /**\n *\n * @param geography\n */\n setDebugGeography(geography) {\n if (\n geography !== AdsConsentDebugGeography.DISABLED &&\n geography !== AdsConsentDebugGeography.EEA &&\n geography !== AdsConsentDebugGeography.NOT_EEA\n ) {\n throw new Error(\n \"AdsConsent.setDebugGeography(*) 'geography' expected one of AdsConsentDebugGeography.DISABLED, AdsConsentDebugGeography.EEA or AdsConsentDebugGeography.NOT_EEA.\",\n );\n }\n\n return native.setDebugGeography(geography);\n },\n\n /**\n *\n */\n getStatus() {\n return native.getStatus();\n },\n\n /**\n *\n * @param status\n */\n setStatus(status) {\n if (\n status !== AdsConsentStatus.UNKNOWN &&\n status !== AdsConsentStatus.NON_PERSONALIZED &&\n status !== AdsConsentStatus.PERSONALIZED\n ) {\n throw new Error(\n \"AdsConsent.setStatus(*) 'status' expected one of AdsConsentStatus.UNKNOWN, AdsConsentStatus.NON_PERSONALIZED or AdsConsentStatus.PERSONALIZED.\",\n );\n }\n\n return native.setStatus(status);\n },\n\n /**\n *\n * @param tag\n */\n setTagForUnderAgeOfConsent(tag) {\n if (!isBoolean(tag)) {\n throw new Error(\"AdsConsent.setTagForUnderAgeOfConsent(*) 'tag' expected a boolean value.\");\n }\n\n return native.setTagForUnderAgeOfConsent(tag);\n },\n\n /**\n *\n * @param deviceIds\n */\n addTestDevices(deviceIds) {\n if (!isArray(deviceIds)) {\n throw new Error(\n \"AdsConsent.addTestDevices(*) 'deviceIds' expected an array of string values.\",\n );\n }\n\n for (let i = 0; i < deviceIds.length; i++) {\n if (!isString(deviceIds[i])) {\n throw new Error(\n \"AdsConsent.addTestDevices(*) 'deviceIds' expected an array of string values.\",\n );\n }\n }\n\n return native.addTestDevices(deviceIds);\n },\n};\n"]}
@@ -5,6 +5,6 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.version = void 0;
7
7
  // generated by genversion
8
- const version = '4.1.0';
8
+ const version = '4.1.1';
9
9
  exports.version = version;
10
10
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["version.ts"],"names":["version"],"mappings":";;;;;;AAAA;AACO,MAAMA,OAAO,GAAG,OAAhB","sourcesContent":["// generated by genversion\nexport const version = '4.1.0';\n"]}
1
+ {"version":3,"sources":["version.ts"],"names":["version"],"mappings":";;;;;;AAAA;AACO,MAAMA,OAAO,GAAG,OAAhB","sourcesContent":["// generated by genversion\nexport const version = '4.1.1';\n"]}
@@ -18,7 +18,7 @@ import { hasOwnProperty, isArray, isBoolean, isObject, isString, isUndefined, is
18
18
  import { NativeModules } from 'react-native';
19
19
  import { AdsConsentDebugGeography } from './AdsConsentDebugGeography';
20
20
  import { AdsConsentStatus } from './AdsConsentStatus';
21
- const native = NativeModules.RNGoogleAdsConsentModule;
21
+ const native = NativeModules.RNGoogleMobileAdsConsentModule;
22
22
  export const AdsConsent = {
23
23
  /**
24
24
  *
@@ -1 +1 @@
1
- {"version":3,"sources":["AdsConsent.ts"],"names":["hasOwnProperty","isArray","isBoolean","isObject","isString","isUndefined","isValidUrl","NativeModules","AdsConsentDebugGeography","AdsConsentStatus","native","RNGoogleAdsConsentModule","AdsConsent","requestInfoUpdate","publisherIds","Error","length","i","showForm","options","privacyPolicy","withPersonalizedAds","withNonPersonalizedAds","withAdFree","getAdProviders","setDebugGeography","geography","DISABLED","EEA","NOT_EEA","getStatus","setStatus","status","UNKNOWN","NON_PERSONALIZED","PERSONALIZED","setTagForUnderAgeOfConsent","tag","addTestDevices","deviceIds"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,SACEA,cADF,EAEEC,OAFF,EAGEC,SAHF,EAIEC,QAJF,EAKEC,QALF,EAMEC,WANF,EAOEC,UAPF,QAQO,UARP;AASA,SAASC,aAAT,QAA8B,cAA9B;AACA,SAASC,wBAAT,QAAyC,4BAAzC;AACA,SAASC,gBAAT,QAAiC,oBAAjC;AAGA,MAAMC,MAAM,GAAGH,aAAa,CAACI,wBAA7B;AAEA,OAAO,MAAMC,UAA+B,GAAG;AAC7C;AACF;AACA;AACA;AACA;AACEC,EAAAA,iBAAiB,CAACC,YAAD,EAAe;AAC9B,QAAI,CAACb,OAAO,CAACa,YAAD,CAAZ,EAA4B;AAC1B,YAAM,IAAIC,KAAJ,CACJ,oFADI,CAAN;AAGD;;AAED,QAAID,YAAY,CAACE,MAAb,KAAwB,CAA5B,EAA+B;AAC7B,YAAM,IAAID,KAAJ,CACJ,uFADI,CAA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AACEC,EAAAA,cAAc,CAACC,SAAD,EAAY;AACxB,QAAI,CAACtC,OAAO,CAACsC,SAAD,CAAZ,EAAyB;AACvB,YAAM,IAAIxB,KAAJ,CACJ,8EADI,CAAN;AAGD;;AAED,SAAK,IAAIE,CAAC,GAAG,CAAb,EAAgBA,CAAC,GAAGsB,SAAS,CAACvB,MAA9B,EAAsCC,CAAC,EAAvC,EAA2C;AACzC,UAAI,CAACb,QAAQ,CAACmC,SAAS,CAACtB,CAAD,CAAV,CAAb,EAA6B;AAC3B,cAAM,IAAIF,KAAJ,CACJ,8EADI,CAAN;AAGD;AACF;;AAED,WAAOL,MAAM,CAAC4B,cAAP,CAAsBC,SAAtB,CAAP;AACD;;AA5J4C,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 {\n hasOwnProperty,\n isArray,\n isBoolean,\n isObject,\n isString,\n isUndefined,\n isValidUrl,\n} from './common';\nimport { NativeModules } from 'react-native';\nimport { AdsConsentDebugGeography } from './AdsConsentDebugGeography';\nimport { AdsConsentStatus } from './AdsConsentStatus';\nimport { AdsConsentInterface } from './types/AdsConsent.interface';\n\nconst native = NativeModules.RNGoogleAdsConsentModule;\n\nexport const AdsConsent: AdsConsentInterface = {\n /**\n *\n * @param publisherIds\n * @returns {*}\n */\n requestInfoUpdate(publisherIds) {\n if (!isArray(publisherIds)) {\n throw new Error(\n \"AdsConsent.requestInfoUpdate(*) 'publisherIds' expected an array of string values.\",\n );\n }\n\n if (publisherIds.length === 0) {\n throw new Error(\n \"AdsConsent.requestInfoUpdate(*) 'publisherIds' list of publisher IDs cannot be empty.\",\n );\n }\n\n for (let i = 0; i < publisherIds.length; i++) {\n if (!isString(publisherIds[i])) {\n throw new Error(\n `AdsConsent.requestInfoUpdate(*) 'publisherIds[${i}]' expected a string value.`,\n );\n }\n }\n\n return native.requestInfoUpdate(publisherIds);\n },\n\n /**\n *\n * @param options\n * @returns {*}\n */\n showForm(options) {\n if (!isUndefined(options) && !isObject(options)) {\n throw new Error(\"AdsConsent.showForm(*) 'options' expected an object value.\");\n }\n\n if (!isValidUrl(options.privacyPolicy)) {\n throw new Error(\n \"AdsConsent.showForm(*) 'options.privacyPolicy' expected a valid HTTP or HTTPS URL.\",\n );\n }\n\n if (hasOwnProperty(options, 'withPersonalizedAds') && !isBoolean(options.withPersonalizedAds)) {\n throw new Error(\n \"AdsConsent.showForm(*) 'options.withPersonalizedAds' expected a boolean value.\",\n );\n }\n\n if (\n hasOwnProperty(options, 'withNonPersonalizedAds') &&\n !isBoolean(options.withNonPersonalizedAds)\n ) {\n throw new Error(\n \"AdsConsent.showForm(*) 'options.withNonPersonalizedAds' expected a boolean value.\",\n );\n }\n\n if (hasOwnProperty(options, 'withAdFree') && !isBoolean(options.withAdFree)) {\n throw new Error(\"AdsConsent.showForm(*) 'options.withAdFree' expected a boolean value.\");\n }\n\n if (!options.withPersonalizedAds && !options.withNonPersonalizedAds && !options.withAdFree) {\n throw new Error(\n \"AdsConsent.showForm(*) 'options' form requires at least one option to be enabled.\",\n );\n }\n\n return native.showForm(options);\n },\n\n /**\n *\n */\n getAdProviders() {\n return native.getAdProviders();\n },\n\n /**\n *\n * @param geography\n */\n setDebugGeography(geography) {\n if (\n geography !== AdsConsentDebugGeography.DISABLED &&\n geography !== AdsConsentDebugGeography.EEA &&\n geography !== AdsConsentDebugGeography.NOT_EEA\n ) {\n throw new Error(\n \"AdsConsent.setDebugGeography(*) 'geography' expected one of AdsConsentDebugGeography.DISABLED, AdsConsentDebugGeography.EEA or AdsConsentDebugGeography.NOT_EEA.\",\n );\n }\n\n return native.setDebugGeography(geography);\n },\n\n /**\n *\n */\n getStatus() {\n return native.getStatus();\n },\n\n /**\n *\n * @param status\n */\n setStatus(status) {\n if (\n status !== AdsConsentStatus.UNKNOWN &&\n status !== AdsConsentStatus.NON_PERSONALIZED &&\n status !== AdsConsentStatus.PERSONALIZED\n ) {\n throw new Error(\n \"AdsConsent.setStatus(*) 'status' expected one of AdsConsentStatus.UNKNOWN, AdsConsentStatus.NON_PERSONALIZED or AdsConsentStatus.PERSONALIZED.\",\n );\n }\n\n return native.setStatus(status);\n },\n\n /**\n *\n * @param tag\n */\n setTagForUnderAgeOfConsent(tag) {\n if (!isBoolean(tag)) {\n throw new Error(\"AdsConsent.setTagForUnderAgeOfConsent(*) 'tag' expected a boolean value.\");\n }\n\n return native.setTagForUnderAgeOfConsent(tag);\n },\n\n /**\n *\n * @param deviceIds\n */\n addTestDevices(deviceIds) {\n if (!isArray(deviceIds)) {\n throw new Error(\n \"AdsConsent.addTestDevices(*) 'deviceIds' expected an array of string values.\",\n );\n }\n\n for (let i = 0; i < deviceIds.length; i++) {\n if (!isString(deviceIds[i])) {\n throw new Error(\n \"AdsConsent.addTestDevices(*) 'deviceIds' expected an array of string values.\",\n );\n }\n }\n\n return native.addTestDevices(deviceIds);\n },\n};\n"]}
1
+ {"version":3,"sources":["AdsConsent.ts"],"names":["hasOwnProperty","isArray","isBoolean","isObject","isString","isUndefined","isValidUrl","NativeModules","AdsConsentDebugGeography","AdsConsentStatus","native","RNGoogleMobileAdsConsentModule","AdsConsent","requestInfoUpdate","publisherIds","Error","length","i","showForm","options","privacyPolicy","withPersonalizedAds","withNonPersonalizedAds","withAdFree","getAdProviders","setDebugGeography","geography","DISABLED","EEA","NOT_EEA","getStatus","setStatus","status","UNKNOWN","NON_PERSONALIZED","PERSONALIZED","setTagForUnderAgeOfConsent","tag","addTestDevices","deviceIds"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA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AACA;AACA;AACEC,EAAAA,SAAS,CAACC,MAAD,EAAS;AAChB,QACEA,MAAM,KAAKvB,gBAAgB,CAACwB,OAA5B,IACAD,MAAM,KAAKvB,gBAAgB,CAACyB,gBAD5B,IAEAF,MAAM,KAAKvB,gBAAgB,CAAC0B,YAH9B,EAIE;AACA,YAAM,IAAIpB,KAAJ,CACJ,gJADI,CAAN;AAGD;;AAED,WAAOL,MAAM,CAACqB,SAAP,CAAiBC,MAAjB,CAAP;AACD,GA1H4C;;AA4H7C;AACF;AACA;AACA;AACEI,EAAAA,0BAA0B,CAACC,GAAD,EAAM;AAC9B,QAAI,CAACnC,SAAS,CAACmC,GAAD,CAAd,EAAqB;AACnB,YAAM,IAAItB,KAAJ,CAAU,0EAAV,CAAN;AACD;;AAED,WAAOL,MAAM,CAAC0B,0BAAP,CAAkCC,GAAlC,CAAP;AACD,GAtI4C;;AAwI7C;AACF;AACA;AACA;AACEC,EAAAA,cAAc,CAACC,SAAD,EAAY;AACxB,QAAI,CAACtC,OAAO,CAACsC,SAAD,CAAZ,EAAyB;AACvB,YAAM,IAAIxB,KAAJ,CACJ,8EADI,CAAN;AAGD;;AAED,SAAK,IAAIE,CAAC,GAAG,CAAb,EAAgBA,CAAC,GAAGsB,SAAS,CAACvB,MAA9B,EAAsCC,CAAC,EAAvC,EAA2C;AACzC,UAAI,CAACb,QAAQ,CAACmC,SAAS,CAACtB,CAAD,CAAV,CAAb,EAA6B;AAC3B,cAAM,IAAIF,KAAJ,CACJ,8EADI,CAAN;AAGD;AACF;;AAED,WAAOL,MAAM,CAAC4B,cAAP,CAAsBC,SAAtB,CAAP;AACD;;AA5J4C,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 {\n hasOwnProperty,\n isArray,\n isBoolean,\n isObject,\n isString,\n isUndefined,\n isValidUrl,\n} from './common';\nimport { NativeModules } from 'react-native';\nimport { AdsConsentDebugGeography } from './AdsConsentDebugGeography';\nimport { AdsConsentStatus } from './AdsConsentStatus';\nimport { AdsConsentInterface } from './types/AdsConsent.interface';\n\nconst native = NativeModules.RNGoogleMobileAdsConsentModule;\n\nexport const AdsConsent: AdsConsentInterface = {\n /**\n *\n * @param publisherIds\n * @returns {*}\n */\n requestInfoUpdate(publisherIds) {\n if (!isArray(publisherIds)) {\n throw new Error(\n \"AdsConsent.requestInfoUpdate(*) 'publisherIds' expected an array of string values.\",\n );\n }\n\n if (publisherIds.length === 0) {\n throw new Error(\n \"AdsConsent.requestInfoUpdate(*) 'publisherIds' list of publisher IDs cannot be empty.\",\n );\n }\n\n for (let i = 0; i < publisherIds.length; i++) {\n if (!isString(publisherIds[i])) {\n throw new Error(\n `AdsConsent.requestInfoUpdate(*) 'publisherIds[${i}]' expected a string value.`,\n );\n }\n }\n\n return native.requestInfoUpdate(publisherIds);\n },\n\n /**\n *\n * @param options\n * @returns {*}\n */\n showForm(options) {\n if (!isUndefined(options) && !isObject(options)) {\n throw new Error(\"AdsConsent.showForm(*) 'options' expected an object value.\");\n }\n\n if (!isValidUrl(options.privacyPolicy)) {\n throw new Error(\n \"AdsConsent.showForm(*) 'options.privacyPolicy' expected a valid HTTP or HTTPS URL.\",\n );\n }\n\n if (hasOwnProperty(options, 'withPersonalizedAds') && !isBoolean(options.withPersonalizedAds)) {\n throw new Error(\n \"AdsConsent.showForm(*) 'options.withPersonalizedAds' expected a boolean value.\",\n );\n }\n\n if (\n hasOwnProperty(options, 'withNonPersonalizedAds') &&\n !isBoolean(options.withNonPersonalizedAds)\n ) {\n throw new Error(\n \"AdsConsent.showForm(*) 'options.withNonPersonalizedAds' expected a boolean value.\",\n );\n }\n\n if (hasOwnProperty(options, 'withAdFree') && !isBoolean(options.withAdFree)) {\n throw new Error(\"AdsConsent.showForm(*) 'options.withAdFree' expected a boolean value.\");\n }\n\n if (!options.withPersonalizedAds && !options.withNonPersonalizedAds && !options.withAdFree) {\n throw new Error(\n \"AdsConsent.showForm(*) 'options' form requires at least one option to be enabled.\",\n );\n }\n\n return native.showForm(options);\n },\n\n /**\n *\n */\n getAdProviders() {\n return native.getAdProviders();\n },\n\n /**\n *\n * @param geography\n */\n setDebugGeography(geography) {\n if (\n geography !== AdsConsentDebugGeography.DISABLED &&\n geography !== AdsConsentDebugGeography.EEA &&\n geography !== AdsConsentDebugGeography.NOT_EEA\n ) {\n throw new Error(\n \"AdsConsent.setDebugGeography(*) 'geography' expected one of AdsConsentDebugGeography.DISABLED, AdsConsentDebugGeography.EEA or AdsConsentDebugGeography.NOT_EEA.\",\n );\n }\n\n return native.setDebugGeography(geography);\n },\n\n /**\n *\n */\n getStatus() {\n return native.getStatus();\n },\n\n /**\n *\n * @param status\n */\n setStatus(status) {\n if (\n status !== AdsConsentStatus.UNKNOWN &&\n status !== AdsConsentStatus.NON_PERSONALIZED &&\n status !== AdsConsentStatus.PERSONALIZED\n ) {\n throw new Error(\n \"AdsConsent.setStatus(*) 'status' expected one of AdsConsentStatus.UNKNOWN, AdsConsentStatus.NON_PERSONALIZED or AdsConsentStatus.PERSONALIZED.\",\n );\n }\n\n return native.setStatus(status);\n },\n\n /**\n *\n * @param tag\n */\n setTagForUnderAgeOfConsent(tag) {\n if (!isBoolean(tag)) {\n throw new Error(\"AdsConsent.setTagForUnderAgeOfConsent(*) 'tag' expected a boolean value.\");\n }\n\n return native.setTagForUnderAgeOfConsent(tag);\n },\n\n /**\n *\n * @param deviceIds\n */\n addTestDevices(deviceIds) {\n if (!isArray(deviceIds)) {\n throw new Error(\n \"AdsConsent.addTestDevices(*) 'deviceIds' expected an array of string values.\",\n );\n }\n\n for (let i = 0; i < deviceIds.length; i++) {\n if (!isString(deviceIds[i])) {\n throw new Error(\n \"AdsConsent.addTestDevices(*) 'deviceIds' expected an array of string values.\",\n );\n }\n }\n\n return native.addTestDevices(deviceIds);\n },\n};\n"]}
@@ -1,3 +1,3 @@
1
1
  // generated by genversion
2
- export const version = '4.1.0';
2
+ export const version = '4.1.1';
3
3
  //# sourceMappingURL=version.js.map
@@ -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 = '4.1.0';\n"]}
1
+ {"version":3,"sources":["version.ts"],"names":["version"],"mappings":"AAAA;AACA,OAAO,MAAMA,OAAO,GAAG,OAAhB","sourcesContent":["// generated by genversion\nexport const version = '4.1.1';\n"]}
@@ -1,4 +1,4 @@
1
- export declare const SDK_VERSION = "4.1.0";
1
+ export declare const SDK_VERSION = "4.1.1";
2
2
  export { default, MobileAds } from './MobileAds';
3
3
  export { AdsConsentDebugGeography } from './AdsConsentDebugGeography';
4
4
  export { AdsConsentStatus } from './AdsConsentStatus';
@@ -1 +1 @@
1
- export declare const version = "4.1.0";
1
+ export declare const version = "4.1.1";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-google-mobile-ads",
3
- "version": "4.1.0",
3
+ "version": "4.1.1",
4
4
  "author": "Invertase <oss@invertase.io> (http://invertase.io)",
5
5
  "description": "React Native Google Mobile Ads is an easy way to monetize mobile apps with targeted, in-app advertising.",
6
6
  "main": "lib/commonjs/index.js",
package/src/AdsConsent.ts CHANGED
@@ -29,7 +29,7 @@ import { AdsConsentDebugGeography } from './AdsConsentDebugGeography';
29
29
  import { AdsConsentStatus } from './AdsConsentStatus';
30
30
  import { AdsConsentInterface } from './types/AdsConsent.interface';
31
31
 
32
- const native = NativeModules.RNGoogleAdsConsentModule;
32
+ const native = NativeModules.RNGoogleMobileAdsConsentModule;
33
33
 
34
34
  export const AdsConsent: AdsConsentInterface = {
35
35
  /**
package/src/version.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  // generated by genversion
2
- export const version = '4.1.0';
2
+ export const version = '4.1.1';