react-native-google-mobile-ads 8.1.1 → 8.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (244) hide show
  1. package/__tests__/interstitial.test.ts +60 -0
  2. package/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsAdHelper.kt +17 -42
  3. package/docs/index.mdx +43 -1
  4. package/jest.setup.ts +3 -0
  5. package/lib/commonjs/AdEventType.js +1 -4
  6. package/lib/commonjs/AdEventType.js.map +1 -1
  7. package/lib/commonjs/AdsConsent.js +2 -25
  8. package/lib/commonjs/AdsConsent.js.map +1 -1
  9. package/lib/commonjs/AdsConsentDebugGeography.js +0 -3
  10. package/lib/commonjs/AdsConsentDebugGeography.js.map +1 -1
  11. package/lib/commonjs/AdsConsentPurposes.js +1 -4
  12. package/lib/commonjs/AdsConsentPurposes.js.map +1 -1
  13. package/lib/commonjs/AdsConsentSpecialFeatures.js +1 -4
  14. package/lib/commonjs/AdsConsentSpecialFeatures.js.map +1 -1
  15. package/lib/commonjs/AdsConsentStatus.js +0 -3
  16. package/lib/commonjs/AdsConsentStatus.js.map +1 -1
  17. package/lib/commonjs/BannerAdSize.js +1 -4
  18. package/lib/commonjs/BannerAdSize.js.map +1 -1
  19. package/lib/commonjs/GAMAdEventType.js +1 -4
  20. package/lib/commonjs/GAMAdEventType.js.map +1 -1
  21. package/lib/commonjs/MaxAdContentRating.js +1 -4
  22. package/lib/commonjs/MaxAdContentRating.js.map +1 -1
  23. package/lib/commonjs/MobileAds.js +0 -14
  24. package/lib/commonjs/MobileAds.js.map +1 -1
  25. package/lib/commonjs/RewardedAdEventType.js +1 -4
  26. package/lib/commonjs/RewardedAdEventType.js.map +1 -1
  27. package/lib/commonjs/TestIds.js +1 -2
  28. package/lib/commonjs/TestIds.js.map +1 -1
  29. package/lib/commonjs/ads/AppOpenAd.js +0 -14
  30. package/lib/commonjs/ads/AppOpenAd.js.map +1 -1
  31. package/lib/commonjs/ads/BannerAd.js +1 -6
  32. package/lib/commonjs/ads/BannerAd.js.map +1 -1
  33. package/lib/commonjs/ads/BaseAd.js +1 -20
  34. package/lib/commonjs/ads/BaseAd.js.map +1 -1
  35. package/lib/commonjs/ads/GAMBannerAd.js +1 -14
  36. package/lib/commonjs/ads/GAMBannerAd.js.map +1 -1
  37. package/lib/commonjs/ads/GAMInterstitialAd.js +0 -6
  38. package/lib/commonjs/ads/GAMInterstitialAd.js.map +1 -1
  39. package/lib/commonjs/ads/InterstitialAd.js +0 -14
  40. package/lib/commonjs/ads/InterstitialAd.js.map +1 -1
  41. package/lib/commonjs/ads/MobileAd.js +6 -55
  42. package/lib/commonjs/ads/MobileAd.js.map +1 -1
  43. package/lib/commonjs/ads/RewardedAd.js +0 -16
  44. package/lib/commonjs/ads/RewardedAd.js.map +1 -1
  45. package/lib/commonjs/ads/RewardedInterstitialAd.js +0 -16
  46. package/lib/commonjs/ads/RewardedInterstitialAd.js.map +1 -1
  47. package/lib/commonjs/common/Base64.js +4 -23
  48. package/lib/commonjs/common/Base64.js.map +1 -1
  49. package/lib/commonjs/common/MutatableParams.js +2 -12
  50. package/lib/commonjs/common/MutatableParams.js.map +1 -1
  51. package/lib/commonjs/common/ReferenceBase.js +2 -10
  52. package/lib/commonjs/common/ReferenceBase.js.map +1 -1
  53. package/lib/commonjs/common/deeps.js +1 -17
  54. package/lib/commonjs/common/deeps.js.map +1 -1
  55. package/lib/commonjs/common/id.js +7 -17
  56. package/lib/commonjs/common/id.js.map +1 -1
  57. package/lib/commonjs/common/index.js +2 -34
  58. package/lib/commonjs/common/index.js.map +1 -1
  59. package/lib/commonjs/common/path.js +9 -28
  60. package/lib/commonjs/common/path.js.map +1 -1
  61. package/lib/commonjs/common/promise.js +1 -7
  62. package/lib/commonjs/common/promise.js.map +1 -1
  63. package/lib/commonjs/common/serialize.js +4 -8
  64. package/lib/commonjs/common/serialize.js.map +1 -1
  65. package/lib/commonjs/common/validate.js +17 -44
  66. package/lib/commonjs/common/validate.js.map +1 -1
  67. package/lib/commonjs/declarations.d.js.map +1 -1
  68. package/lib/commonjs/hooks/useAppOpenAd.js +0 -6
  69. package/lib/commonjs/hooks/useAppOpenAd.js.map +1 -1
  70. package/lib/commonjs/hooks/useFullScreenAd.js +5 -16
  71. package/lib/commonjs/hooks/useFullScreenAd.js.map +1 -1
  72. package/lib/commonjs/hooks/useInterstitialAd.js +0 -6
  73. package/lib/commonjs/hooks/useInterstitialAd.js.map +1 -1
  74. package/lib/commonjs/hooks/useRewardedAd.js +0 -6
  75. package/lib/commonjs/hooks/useRewardedAd.js.map +1 -1
  76. package/lib/commonjs/hooks/useRewardedInterstitialAd.js +0 -6
  77. package/lib/commonjs/hooks/useRewardedInterstitialAd.js.map +1 -1
  78. package/lib/commonjs/index.js +1 -29
  79. package/lib/commonjs/index.js.map +1 -1
  80. package/lib/commonjs/internal/GoogleMobileAdsNativeEventEmitter.js +8 -20
  81. package/lib/commonjs/internal/GoogleMobileAdsNativeEventEmitter.js.map +1 -1
  82. package/lib/commonjs/internal/Module.js +2 -18
  83. package/lib/commonjs/internal/Module.js.map +1 -1
  84. package/lib/commonjs/internal/NativeError.js +2 -13
  85. package/lib/commonjs/internal/NativeError.js.map +1 -1
  86. package/lib/commonjs/internal/SharedEventEmitter.js +2 -3
  87. package/lib/commonjs/internal/SharedEventEmitter.js.map +1 -1
  88. package/lib/commonjs/internal/index.js +0 -5
  89. package/lib/commonjs/internal/index.js.map +1 -1
  90. package/lib/commonjs/internal/registry/nativeModule.js +12 -63
  91. package/lib/commonjs/internal/registry/nativeModule.js.map +1 -1
  92. package/lib/commonjs/types/AdEventListener.js.map +1 -1
  93. package/lib/commonjs/types/AdEventsListener.js.map +1 -1
  94. package/lib/commonjs/types/AdShowOptions.js.map +1 -1
  95. package/lib/commonjs/types/AdStates.js.map +1 -1
  96. package/lib/commonjs/types/AdapterStatus.js +3 -6
  97. package/lib/commonjs/types/AdapterStatus.js.map +1 -1
  98. package/lib/commonjs/types/AdsConsent.interface.js.map +1 -1
  99. package/lib/commonjs/types/AppEvent.js.map +1 -1
  100. package/lib/commonjs/types/BannerAdProps.js.map +1 -1
  101. package/lib/commonjs/types/GoogleMobileAdsNativeModule.js.map +1 -1
  102. package/lib/commonjs/types/MobileAd.interface.js.map +1 -1
  103. package/lib/commonjs/types/MobileAdsModule.interface.js.map +1 -1
  104. package/lib/commonjs/types/Module.interface.js.map +1 -1
  105. package/lib/commonjs/types/RequestConfiguration.js.map +1 -1
  106. package/lib/commonjs/types/RequestOptions.js.map +1 -1
  107. package/lib/commonjs/types/RewardedAdReward.js.map +1 -1
  108. package/lib/commonjs/types/index.js +0 -22
  109. package/lib/commonjs/types/index.js.map +1 -1
  110. package/lib/commonjs/validateAdRequestConfiguration.js +1 -13
  111. package/lib/commonjs/validateAdRequestConfiguration.js.map +1 -1
  112. package/lib/commonjs/validateAdRequestOptions.js +1 -29
  113. package/lib/commonjs/validateAdRequestOptions.js.map +1 -1
  114. package/lib/commonjs/validateAdShowOptions.js +1 -7
  115. package/lib/commonjs/validateAdShowOptions.js.map +1 -1
  116. package/lib/commonjs/version.js +1 -1
  117. package/lib/commonjs/version.js.map +1 -1
  118. package/lib/module/AdEventType.js +1 -1
  119. package/lib/module/AdEventType.js.map +1 -1
  120. package/lib/module/AdsConsent.js +2 -18
  121. package/lib/module/AdsConsent.js.map +1 -1
  122. package/lib/module/AdsConsentDebugGeography.js +0 -1
  123. package/lib/module/AdsConsentDebugGeography.js.map +1 -1
  124. package/lib/module/AdsConsentPurposes.js +1 -1
  125. package/lib/module/AdsConsentPurposes.js.map +1 -1
  126. package/lib/module/AdsConsentSpecialFeatures.js +1 -1
  127. package/lib/module/AdsConsentSpecialFeatures.js.map +1 -1
  128. package/lib/module/AdsConsentStatus.js +0 -1
  129. package/lib/module/AdsConsentStatus.js.map +1 -1
  130. package/lib/module/BannerAdSize.js +1 -1
  131. package/lib/module/BannerAdSize.js.map +1 -1
  132. package/lib/module/GAMAdEventType.js +1 -1
  133. package/lib/module/GAMAdEventType.js.map +1 -1
  134. package/lib/module/MaxAdContentRating.js +1 -1
  135. package/lib/module/MaxAdContentRating.js.map +1 -1
  136. package/lib/module/MobileAds.js +0 -8
  137. package/lib/module/MobileAds.js.map +1 -1
  138. package/lib/module/RewardedAdEventType.js +1 -1
  139. package/lib/module/RewardedAdEventType.js.map +1 -1
  140. package/lib/module/TestIds.js +1 -0
  141. package/lib/module/TestIds.js.map +1 -1
  142. package/lib/module/ads/AppOpenAd.js +1 -8
  143. package/lib/module/ads/AppOpenAd.js.map +1 -1
  144. package/lib/module/ads/BannerAd.js +2 -2
  145. package/lib/module/ads/BannerAd.js.map +1 -1
  146. package/lib/module/ads/BaseAd.js +1 -9
  147. package/lib/module/ads/BaseAd.js.map +1 -1
  148. package/lib/module/ads/GAMBannerAd.js +2 -7
  149. package/lib/module/ads/GAMBannerAd.js.map +1 -1
  150. package/lib/module/ads/GAMInterstitialAd.js +0 -3
  151. package/lib/module/ads/GAMInterstitialAd.js.map +1 -1
  152. package/lib/module/ads/InterstitialAd.js +1 -9
  153. package/lib/module/ads/InterstitialAd.js.map +1 -1
  154. package/lib/module/ads/MobileAd.js +7 -47
  155. package/lib/module/ads/MobileAd.js.map +1 -1
  156. package/lib/module/ads/RewardedAd.js +1 -10
  157. package/lib/module/ads/RewardedAd.js.map +1 -1
  158. package/lib/module/ads/RewardedInterstitialAd.js +1 -10
  159. package/lib/module/ads/RewardedInterstitialAd.js.map +1 -1
  160. package/lib/module/common/Base64.js +4 -17
  161. package/lib/module/common/Base64.js.map +1 -1
  162. package/lib/module/common/MutatableParams.js +3 -9
  163. package/lib/module/common/MutatableParams.js.map +1 -1
  164. package/lib/module/common/ReferenceBase.js +2 -8
  165. package/lib/module/common/ReferenceBase.js.map +1 -1
  166. package/lib/module/common/deeps.js +3 -15
  167. package/lib/module/common/deeps.js.map +1 -1
  168. package/lib/module/common/id.js +7 -16
  169. package/lib/module/common/id.js.map +1 -1
  170. package/lib/module/common/index.js +2 -11
  171. package/lib/module/common/index.js.map +1 -1
  172. package/lib/module/common/path.js +9 -19
  173. package/lib/module/common/path.js.map +1 -1
  174. package/lib/module/common/promise.js +3 -5
  175. package/lib/module/common/promise.js.map +1 -1
  176. package/lib/module/common/serialize.js +4 -4
  177. package/lib/module/common/serialize.js.map +1 -1
  178. package/lib/module/common/validate.js +17 -24
  179. package/lib/module/common/validate.js.map +1 -1
  180. package/lib/module/declarations.d.js.map +1 -1
  181. package/lib/module/hooks/useAppOpenAd.js +2 -1
  182. package/lib/module/hooks/useAppOpenAd.js.map +1 -1
  183. package/lib/module/hooks/useFullScreenAd.js +5 -11
  184. package/lib/module/hooks/useFullScreenAd.js.map +1 -1
  185. package/lib/module/hooks/useInterstitialAd.js +2 -1
  186. package/lib/module/hooks/useInterstitialAd.js.map +1 -1
  187. package/lib/module/hooks/useRewardedAd.js +2 -1
  188. package/lib/module/hooks/useRewardedAd.js.map +1 -1
  189. package/lib/module/hooks/useRewardedInterstitialAd.js +2 -1
  190. package/lib/module/hooks/useRewardedInterstitialAd.js.map +1 -1
  191. package/lib/module/index.js +3 -1
  192. package/lib/module/index.js.map +1 -1
  193. package/lib/module/internal/GoogleMobileAdsNativeEventEmitter.js +9 -18
  194. package/lib/module/internal/GoogleMobileAdsNativeEventEmitter.js.map +1 -1
  195. package/lib/module/internal/Module.js +3 -13
  196. package/lib/module/internal/Module.js.map +1 -1
  197. package/lib/module/internal/NativeError.js +2 -11
  198. package/lib/module/internal/NativeError.js.map +1 -1
  199. package/lib/module/internal/SharedEventEmitter.js +1 -0
  200. package/lib/module/internal/SharedEventEmitter.js.map +1 -1
  201. package/lib/module/internal/index.js +1 -0
  202. package/lib/module/internal/index.js.map +1 -1
  203. package/lib/module/internal/registry/nativeModule.js +12 -53
  204. package/lib/module/internal/registry/nativeModule.js.map +1 -1
  205. package/lib/module/types/AdEventListener.js.map +1 -1
  206. package/lib/module/types/AdEventsListener.js.map +1 -1
  207. package/lib/module/types/AdShowOptions.js.map +1 -1
  208. package/lib/module/types/AdStates.js.map +1 -1
  209. package/lib/module/types/AdapterStatus.js +1 -1
  210. package/lib/module/types/AdapterStatus.js.map +1 -1
  211. package/lib/module/types/AdsConsent.interface.js.map +1 -1
  212. package/lib/module/types/AppEvent.js.map +1 -1
  213. package/lib/module/types/BannerAdProps.js.map +1 -1
  214. package/lib/module/types/GoogleMobileAdsNativeModule.js.map +1 -1
  215. package/lib/module/types/MobileAd.interface.js.map +1 -1
  216. package/lib/module/types/MobileAdsModule.interface.js.map +1 -1
  217. package/lib/module/types/Module.interface.js.map +1 -1
  218. package/lib/module/types/RequestConfiguration.js.map +1 -1
  219. package/lib/module/types/RequestOptions.js.map +1 -1
  220. package/lib/module/types/RewardedAdReward.js.map +1 -1
  221. package/lib/module/types/index.js +1 -0
  222. package/lib/module/types/index.js.map +1 -1
  223. package/lib/module/validateAdRequestConfiguration.js +1 -10
  224. package/lib/module/validateAdRequestConfiguration.js.map +1 -1
  225. package/lib/module/validateAdRequestOptions.js +1 -27
  226. package/lib/module/validateAdRequestOptions.js.map +1 -1
  227. package/lib/module/validateAdShowOptions.js +1 -5
  228. package/lib/module/validateAdShowOptions.js.map +1 -1
  229. package/lib/module/version.js +1 -1
  230. package/lib/module/version.js.map +1 -1
  231. package/lib/typescript/common/Base64.d.ts +0 -1
  232. package/lib/typescript/index.d.ts +1 -1
  233. package/lib/typescript/internal/registry/nativeModule.d.ts +0 -6
  234. package/lib/typescript/version.d.ts +1 -1
  235. package/package.json +34 -29
  236. package/src/ads/MobileAd.ts +5 -0
  237. package/src/internal/registry/nativeModule.ts +2 -23
  238. package/src/version.ts +1 -1
  239. package/lib/commonjs/internal/constants.js +0 -30
  240. package/lib/commonjs/internal/constants.js.map +0 -1
  241. package/lib/module/internal/constants.js +0 -20
  242. package/lib/module/internal/constants.js.map +0 -1
  243. package/lib/typescript/internal/constants.d.ts +0 -3
  244. package/src/internal/constants.ts +0 -43
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
1
+ {"version":3,"names":[],"sources":["RequestOptions.ts"],"sourcesContent":["export interface ServerSideVerificationOptions {\n /**\n * User identifier.\n * If no user identifier is provided by the app, this query parameter will not be present in the SSV callback.\n */\n userId?: string;\n\n /**\n * Custom data string.\n * If no custom data string is provided by the app, this query parameter value will not be present in the SSV callback.\n */\n customData?: string;\n}\n\n/**\n * The `RequestOptions` interface. Used when passing additional request options before an advert is loaded.\n */\nexport interface RequestOptions {\n /**\n * If `true` only non-personalized ads will be loaded.\n *\n * Google serves personalized ads by default. This option must be `true` if users who are within the EEA have only\n * given consent to non-personalized ads.\n */\n requestNonPersonalizedAdsOnly?: boolean;\n\n /**\n * Attaches additional properties to an ad request for direct campaign delivery.\n *\n * Takes an array of string key/value pairs.\n *\n * #### Example\n *\n * Attaches `?campaign=abc&user=123` to the ad request:\n *\n * ```js\n * await Interstitial.createForAdRequest('ca-app-pub-3940256099942544/1033173712', {\n * networkExtras: {\n * campaign: 'abc',\n * user: '123',\n * },\n * });\n */\n networkExtras?: { [key: string]: string };\n\n /**\n * An array of keywords to be sent when loading the ad.\n *\n * Setting keywords helps deliver more specific ads to a user based on the keywords.\n *\n * #### Example\n *\n * ```js\n * await Interstitial.createForAdRequest('ca-app-pub-3940256099942544/1033173712', {\n * keywords: ['fashion', 'clothing'],\n * });\n * ```\n */\n keywords?: string[];\n\n /**\n * Sets a content URL for targeting purposes.\n *\n * Max length of 512.\n */\n contentUrl?: string;\n\n /**\n * key-value pairs used for custom targeting\n *\n * Takes an array of string key/value pairs.\n */\n customTargeting?: { [key: string]: string };\n\n /**\n * Sets the request agent string to identify the ad request's origin. Third party libraries that reference the Mobile\n * Ads SDK should call this method to denote the platform from which the ad request originated. For example, if a\n * third party ad network called \"CoolAds network\" mediates requests to the Mobile Ads SDK, it should call this\n * method with \"CoolAds\".\n *\n * #### Example\n *\n * ```js\n * await Interstitial.createForAdRequest('ca-app-pub-3940256099942544/1033173712', {\n * requestAgent: 'CoolAds',\n * });\n * ```\n */\n requestAgent?: string;\n\n /**\n * Server Side Verification(SSV) Options\n * See [Google Mobile SDK Docs](https://developers.google.com/admob/android/ssv) for more information.\n */\n serverSideVerificationOptions?: ServerSideVerificationOptions;\n\n /**\n * Publisher provided identifier (PPID) for use in frequency capping, audience segmentation and targeting,\n * sequential ad rotation, and other audience-based ad delivery controls across devices.\n * See [this article](https://support.google.com/admanager/answer/2880055) for more information.\n */\n publisherProvidedId?: string;\n}\n"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
1
+ {"version":3,"names":[],"sources":["RewardedAdReward.ts"],"sourcesContent":["/**\n * A `RewardedAdReward` returned from rewarded ads.\n */\nexport interface RewardedAdReward {\n /**\n * The reward name, e.g. 'coins', 'diamonds'.\n */\n type: string;\n\n /**\n * The number value of the reward, e.g. 10\n */\n amount: number;\n}\n"],"mappings":""}
@@ -14,6 +14,7 @@
14
14
  * limitations under the License.
15
15
  *
16
16
  */
17
+
17
18
  export * from './AdapterStatus';
18
19
  export * from './AdEventListener';
19
20
  export * from './AdEventsListener';
@@ -1 +1 @@
1
- {"version":3,"sources":["index.ts"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,cAAc,iBAAd;AACA,cAAc,mBAAd;AACA,cAAc,oBAAd;AACA,cAAc,wBAAd;AACA,cAAc,iBAAd;AACA,cAAc,YAAd;AACA,cAAc,iBAAd;AACA,cAAc,wBAAd;AACA,cAAc,kBAAd;AACA,cAAc,oBAAd;AACA,cAAc,YAAd","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\nexport * from './AdapterStatus';\nexport * from './AdEventListener';\nexport * from './AdEventsListener';\nexport * from './AdsConsent.interface';\nexport * from './AdShowOptions';\nexport * from './AdStates';\nexport * from './BannerAdProps';\nexport * from './RequestConfiguration';\nexport * from './RequestOptions';\nexport * from './RewardedAdReward';\nexport * from './AppEvent';\n"]}
1
+ {"version":3,"names":[],"sources":["index.ts"],"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\nexport * from './AdapterStatus';\nexport * from './AdEventListener';\nexport * from './AdEventsListener';\nexport * from './AdsConsent.interface';\nexport * from './AdShowOptions';\nexport * from './AdStates';\nexport * from './BannerAdProps';\nexport * from './RequestConfiguration';\nexport * from './RequestOptions';\nexport * from './RewardedAdReward';\nexport * from './AppEvent';\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,cAAc,iBAAiB;AAC/B,cAAc,mBAAmB;AACjC,cAAc,oBAAoB;AAClC,cAAc,wBAAwB;AACtC,cAAc,iBAAiB;AAC/B,cAAc,YAAY;AAC1B,cAAc,iBAAiB;AAC/B,cAAc,wBAAwB;AACtC,cAAc,kBAAkB;AAChC,cAAc,oBAAoB;AAClC,cAAc,YAAY"}
@@ -14,47 +14,38 @@
14
14
  * limitations under the License.
15
15
  *
16
16
  */
17
+
17
18
  import { isPropertySet, isArray, isBoolean, isObject } from './common';
18
19
  import { MaxAdContentRating } from './MaxAdContentRating';
19
20
  export function validateAdRequestConfiguration(requestConfiguration) {
20
21
  const out = {};
21
-
22
22
  if (!isObject(requestConfiguration)) {
23
23
  throw new Error("'requestConfiguration' expected an object value");
24
24
  }
25
-
26
25
  if (requestConfiguration.maxAdContentRating) {
27
26
  if (requestConfiguration.maxAdContentRating !== MaxAdContentRating.G && requestConfiguration.maxAdContentRating !== MaxAdContentRating.PG && requestConfiguration.maxAdContentRating !== MaxAdContentRating.T && requestConfiguration.maxAdContentRating !== MaxAdContentRating.MA) {
28
27
  throw new Error("'requestConfiguration.maxAdContentRating' expected on of MaxAdContentRating.G, MaxAdContentRating.PG, MaxAdContentRating.T or MaxAdContentRating.MA");
29
28
  }
30
-
31
29
  out.maxAdContentRating = requestConfiguration.maxAdContentRating;
32
30
  }
33
-
34
31
  if (isPropertySet(requestConfiguration, 'tagForChildDirectedTreatment')) {
35
32
  if (!isBoolean(requestConfiguration.tagForChildDirectedTreatment)) {
36
33
  throw new Error("'requestConfiguration.tagForChildDirectedTreatment' expected a boolean value");
37
34
  }
38
-
39
35
  out.tagForChildDirectedTreatment = requestConfiguration.tagForChildDirectedTreatment;
40
36
  }
41
-
42
37
  if (isPropertySet(requestConfiguration, 'tagForUnderAgeOfConsent')) {
43
38
  if (!isBoolean(requestConfiguration.tagForUnderAgeOfConsent)) {
44
39
  throw new Error("'requestConfiguration.tagForUnderAgeOfConsent' expected a boolean value");
45
40
  }
46
-
47
41
  out.tagForUnderAgeOfConsent = requestConfiguration.tagForUnderAgeOfConsent;
48
42
  }
49
-
50
43
  if (isPropertySet(requestConfiguration, 'testDeviceIdentifiers')) {
51
44
  if (!isArray(requestConfiguration.testDeviceIdentifiers)) {
52
45
  throw new Error("'requestConfiguration.testDeviceIdentifiers' expected an array value");
53
46
  }
54
-
55
47
  out.testDeviceIdentifiers = requestConfiguration.testDeviceIdentifiers;
56
48
  }
57
-
58
49
  return out;
59
50
  }
60
51
  //# sourceMappingURL=validateAdRequestConfiguration.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["validateAdRequestConfiguration.ts"],"names":["isPropertySet","isArray","isBoolean","isObject","MaxAdContentRating","validateAdRequestConfiguration","requestConfiguration","out","Error","maxAdContentRating","G","PG","T","MA","tagForChildDirectedTreatment","tagForUnderAgeOfConsent","testDeviceIdentifiers"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,SAASA,aAAT,EAAwBC,OAAxB,EAAiCC,SAAjC,EAA4CC,QAA5C,QAA4D,UAA5D;AACA,SAASC,kBAAT,QAAmC,sBAAnC;AAGA,OAAO,SAASC,8BAAT,CAAwCC,oBAAxC,EAAoF;AACzF,QAAMC,GAAyB,GAAG,EAAlC;;AAEA,MAAI,CAACJ,QAAQ,CAACG,oBAAD,CAAb,EAAqC;AACnC,UAAM,IAAIE,KAAJ,CAAU,iDAAV,CAAN;AACD;;AAED,MAAIF,oBAAoB,CAACG,kBAAzB,EAA6C;AAC3C,QACEH,oBAAoB,CAACG,kBAArB,KAA4CL,kBAAkB,CAACM,CAA/D,IACAJ,oBAAoB,CAACG,kBAArB,KAA4CL,kBAAkB,CAACO,EAD/D,IAEAL,oBAAoB,CAACG,kBAArB,KAA4CL,kBAAkB,CAACQ,CAF/D,IAGAN,oBAAoB,CAACG,kBAArB,KAA4CL,kBAAkB,CAACS,EAJjE,EAKE;AACA,YAAM,IAAIL,KAAJ,CACJ,qJADI,CAAN;AAGD;;AAEDD,IAAAA,GAAG,CAACE,kBAAJ,GAAyBH,oBAAoB,CAACG,kBAA9C;AACD;;AAED,MAAIT,aAAa,CAACM,oBAAD,EAAuB,8BAAvB,CAAjB,EAAyE;AACvE,QAAI,CAACJ,SAAS,CAACI,oBAAoB,CAACQ,4BAAtB,CAAd,EAAmE;AACjE,YAAM,IAAIN,KAAJ,CACJ,8EADI,CAAN;AAGD;;AAEDD,IAAAA,GAAG,CAACO,4BAAJ,GAAmCR,oBAAoB,CAACQ,4BAAxD;AACD;;AAED,MAAId,aAAa,CAACM,oBAAD,EAAuB,yBAAvB,CAAjB,EAAoE;AAClE,QAAI,CAACJ,SAAS,CAACI,oBAAoB,CAACS,uBAAtB,CAAd,EAA8D;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"]}
1
+ {"version":3,"names":["isPropertySet","isArray","isBoolean","isObject","MaxAdContentRating","validateAdRequestConfiguration","requestConfiguration","out","Error","maxAdContentRating","G","PG","T","MA","tagForChildDirectedTreatment","tagForUnderAgeOfConsent","testDeviceIdentifiers"],"sources":["validateAdRequestConfiguration.ts"],"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"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,aAAa,EAAEC,OAAO,EAAEC,SAAS,EAAEC,QAAQ,QAAQ,UAAU;AACtE,SAASC,kBAAkB,QAAQ,sBAAsB;AAGzD,OAAO,SAASC,8BAA8B,CAACC,oBAA0C,EAAE;EACzF,MAAMC,GAAyB,GAAG,CAAC,CAAC;EAEpC,IAAI,CAACJ,QAAQ,CAACG,oBAAoB,CAAC,EAAE;IACnC,MAAM,IAAIE,KAAK,CAAC,iDAAiD,CAAC;EACpE;EAEA,IAAIF,oBAAoB,CAACG,kBAAkB,EAAE;IAC3C,IACEH,oBAAoB,CAACG,kBAAkB,KAAKL,kBAAkB,CAACM,CAAC,IAChEJ,oBAAoB,CAACG,kBAAkB,KAAKL,kBAAkB,CAACO,EAAE,IACjEL,oBAAoB,CAACG,kBAAkB,KAAKL,kBAAkB,CAACQ,CAAC,IAChEN,oBAAoB,CAACG,kBAAkB,KAAKL,kBAAkB,CAACS,EAAE,EACjE;MACA,MAAM,IAAIL,KAAK,CACb,qJAAqJ,CACtJ;IACH;IAEAD,GAAG,CAACE,kBAAkB,GAAGH,oBAAoB,CAACG,kBAAkB;EAClE;EAEA,IAAIT,aAAa,CAACM,oBAAoB,EAAE,8BAA8B,CAAC,EAAE;IACvE,IAAI,CAACJ,SAAS,CAACI,oBAAoB,CAACQ,4BAA4B,CAAC,EAAE;MACjE,MAAM,IAAIN,KAAK,CACb,8EAA8E,CAC/E;IACH;IAEAD,GAAG,CAACO,4BAA4B,GAAGR,oBAAoB,CAACQ,4BAA4B;EACtF;EAEA,IAAId,aAAa,CAACM,oBAAoB,EAAE,yBAAyB,CAAC,EAAE;IAClE,IAAI,CAACJ,SAAS,CAACI,oBAAoB,CAACS,uBAAuB,CAAC,EAAE;MAC5D,MAAM,IAAIP,KAAK,CAAC,yEAAyE,CAAC;IAC5F;IAEAD,GAAG,CAACQ,uBAAuB,GAAGT,oBAAoB,CAACS,uBAAuB;EAC5E;EAEA,IAAIf,aAAa,CAACM,oBAAoB,EAAE,uBAAuB,CAAC,EAAE;IAChE,IAAI,CAACL,OAAO,CAACK,oBAAoB,CAACU,qBAAqB,CAAC,EAAE;MACxD,MAAM,IAAIR,KAAK,CAAC,sEAAsE,CAAC;IACzF;IAEAD,GAAG,CAACS,qBAAqB,GAAGV,oBAAoB,CAACU,qBAAqB;EACxE;EAEA,OAAOT,GAAG;AACZ"}
@@ -14,115 +14,89 @@
14
14
  * limitations under the License.
15
15
  *
16
16
  */
17
+
17
18
  import { isPropertySet, isArray, isBoolean, isObject, isString, isUndefined, isValidUrl } from './common';
18
19
  export function validateAdRequestOptions(options) {
19
20
  const out = {};
20
-
21
21
  if (isUndefined(options)) {
22
22
  return out;
23
23
  }
24
-
25
24
  if (!isObject(options)) {
26
25
  throw new Error("'options' expected an object value");
27
26
  }
28
-
29
27
  if (isPropertySet(options, 'requestNonPersonalizedAdsOnly')) {
30
28
  if (!isBoolean(options.requestNonPersonalizedAdsOnly)) {
31
29
  throw new Error("'options.requestNonPersonalizedAdsOnly' expected a boolean value");
32
30
  }
33
-
34
31
  out.requestNonPersonalizedAdsOnly = options.requestNonPersonalizedAdsOnly;
35
32
  }
36
-
37
33
  if (options.networkExtras) {
38
34
  if (!isObject(options.networkExtras)) {
39
35
  throw new Error("'options.networkExtras' expected an object of key/value pairs");
40
36
  }
41
-
42
37
  Object.entries(options.networkExtras).forEach(_ref => {
43
38
  let [key, value] = _ref;
44
-
45
39
  if (!isString(value)) {
46
40
  throw new Error(`'options.networkExtras' expected a string value for object key "${key}"`);
47
41
  }
48
42
  });
49
43
  out.networkExtras = options.networkExtras;
50
44
  }
51
-
52
45
  if (options.keywords) {
53
46
  if (!isArray(options.keywords)) {
54
47
  throw new Error("'options.keywords' expected an array containing string values");
55
48
  }
56
-
57
49
  for (let i = 0; i < options.keywords.length; i++) {
58
50
  const keyword = options.keywords[i];
59
-
60
51
  if (!isString(keyword)) {
61
52
  throw new Error("'options.keywords' expected an array containing string values");
62
53
  }
63
54
  }
64
-
65
55
  out.keywords = options.keywords;
66
56
  }
67
-
68
57
  if (options.contentUrl) {
69
58
  if (!isString(options.contentUrl)) {
70
59
  throw new Error("'options.contentUrl' expected a string value");
71
60
  }
72
-
73
61
  if (!isValidUrl(options.contentUrl)) {
74
62
  throw new Error("'options.contentUrl' expected a valid HTTP or HTTPS url.");
75
63
  }
76
-
77
64
  if (options.contentUrl.length > 512) {
78
65
  throw new Error("'options.contentUrl' maximum length of a content URL is 512 characters.");
79
66
  }
80
-
81
67
  out.contentUrl = options.contentUrl;
82
68
  }
83
-
84
69
  if (options.requestAgent) {
85
70
  if (!isString(options.requestAgent)) {
86
71
  throw new Error("'options.requestAgent' expected a string value");
87
72
  }
88
-
89
73
  out.requestAgent = options.requestAgent;
90
74
  }
91
-
92
75
  if (options.serverSideVerificationOptions) {
93
76
  if (!isObject(options.serverSideVerificationOptions)) {
94
77
  throw new Error("'options.serverSideVerificationOptions' expected an object of key/value pairs");
95
78
  }
96
-
97
79
  const ssvOptions = options.serverSideVerificationOptions;
98
-
99
80
  if (ssvOptions.userId && !isString(ssvOptions.userId)) {
100
81
  throw new Error("'options.serverSideVerificationOptions.userId' expected a string value");
101
82
  }
102
-
103
83
  if (ssvOptions.customData && !isString(ssvOptions.customData)) {
104
84
  throw new Error("'options.serverSideVerificationOptions.customData' expected a string value");
105
85
  }
106
-
107
86
  out.serverSideVerificationOptions = options.serverSideVerificationOptions;
108
87
  }
109
-
110
88
  if (options.customTargeting) {
111
89
  if (!isObject(options.customTargeting)) {
112
90
  throw new Error("'options.customTargeting' expected an object of key/value pairs");
113
91
  }
114
-
115
92
  out.customTargeting = options.customTargeting;
116
93
  }
117
-
118
94
  if (options.publisherProvidedId) {
119
95
  if (!isString(options.publisherProvidedId)) {
120
96
  throw new Error("'options.publisherProvidedId' expected a string value");
121
97
  }
122
-
123
98
  out.publisherProvidedId = options.publisherProvidedId;
124
99
  }
125
-
126
100
  return out;
127
101
  }
128
102
  //# sourceMappingURL=validateAdRequestOptions.js.map
@@ -1 +1 @@
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","publisherProvidedId"],"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;;AAE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AU,uDAAV,CAAN;AACD;;AACDD,IAAAA,GAAG,CAACoB,mBAAJ,GAA0BrB,OAAO,CAACqB,mBAAlC;AACD;;AAED,SAAOpB,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 if (options.publisherProvidedId) {\n if (!isString(options.publisherProvidedId)) {\n throw new Error(\"'options.publisherProvidedId' expected a string value\");\n }\n out.publisherProvidedId = options.publisherProvidedId;\n }\n\n return out;\n}\n"]}
1
+ {"version":3,"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","publisherProvidedId"],"sources":["validateAdRequestOptions.ts"],"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 if (options.publisherProvidedId) {\n if (!isString(options.publisherProvidedId)) {\n throw new Error(\"'options.publisherProvidedId' expected a string value\");\n }\n out.publisherProvidedId = options.publisherProvidedId;\n }\n\n return out;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SACEA,aAAa,EACbC,OAAO,EACPC,SAAS,EACTC,QAAQ,EACRC,QAAQ,EACRC,WAAW,EACXC,UAAU,QACL,UAAU;AAGjB,OAAO,SAASC,wBAAwB,CAACC,OAAwB,EAAE;EACjE,MAAMC,GAAmB,GAAG,CAAC,CAAC;EAE9B,IAAIJ,WAAW,CAACG,OAAO,CAAC,EAAE;IACxB,OAAOC,GAAG;EACZ;EAEA,IAAI,CAACN,QAAQ,CAACK,OAAO,CAAC,EAAE;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AIhB,OAAO,CAACoB,eAAe,EAAE;IAC3B,IAAI,CAACzB,QAAQ,CAACK,OAAO,CAACoB,eAAe,CAAC,EAAE;MACtC,MAAM,IAAIlB,KAAK,CAAC,iEAAiE,CAAC;IACpF;IACAD,GAAG,CAACmB,eAAe,GAAGpB,OAAO,CAACoB,eAAe;EAC/C;EAEA,IAAIpB,OAAO,CAACqB,mBAAmB,EAAE;IAC/B,IAAI,CAACzB,QAAQ,CAACI,OAAO,CAACqB,mBAAmB,CAAC,EAAE;MAC1C,MAAM,IAAInB,KAAK,CAAC,uDAAuD,CAAC;IAC1E;IACAD,GAAG,CAACoB,mBAAmB,GAAGrB,OAAO,CAACqB,mBAAmB;EACvD;EAEA,OAAOpB,GAAG;AACZ"}
@@ -14,26 +14,22 @@
14
14
  * limitations under the License.
15
15
  *
16
16
  */
17
+
17
18
  import { isPropertySet, isBoolean, isObject, isUndefined } from './common';
18
19
  export function validateAdShowOptions(options) {
19
20
  const out = {};
20
-
21
21
  if (isUndefined(options)) {
22
22
  return out;
23
23
  }
24
-
25
24
  if (!isObject(options)) {
26
25
  throw new Error("'options' expected an object value");
27
26
  }
28
-
29
27
  if (isPropertySet(options, 'immersiveModeEnabled')) {
30
28
  if (!isBoolean(options.immersiveModeEnabled)) {
31
29
  throw new Error("'options.immersiveModeEnabled' expected a boolean value");
32
30
  }
33
-
34
31
  out.immersiveModeEnabled = options.immersiveModeEnabled;
35
32
  }
36
-
37
33
  return out;
38
34
  }
39
35
  //# sourceMappingURL=validateAdShowOptions.js.map
@@ -1 +1 @@
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"]}
1
+ {"version":3,"names":["isPropertySet","isBoolean","isObject","isUndefined","validateAdShowOptions","options","out","Error","immersiveModeEnabled"],"sources":["validateAdShowOptions.ts"],"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"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,aAAa,EAAEC,SAAS,EAAEC,QAAQ,EAAEC,WAAW,QAAQ,UAAU;AAG1E,OAAO,SAASC,qBAAqB,CAACC,OAAuB,EAAE;EAC7D,MAAMC,GAAkB,GAAG,CAAC,CAAC;EAE7B,IAAIH,WAAW,CAACE,OAAO,CAAC,EAAE;IACxB,OAAOC,GAAG;EACZ;EAEA,IAAI,CAACJ,QAAQ,CAACG,OAAO,CAAC,EAAE;IACtB,MAAM,IAAIE,KAAK,CAAC,oCAAoC,CAAC;EACvD;EAEA,IAAIP,aAAa,CAACK,OAAO,EAAE,sBAAsB,CAAC,EAAE;IAClD,IAAI,CAACJ,SAAS,CAACI,OAAO,CAACG,oBAAoB,CAAC,EAAE;MAC5C,MAAM,IAAID,KAAK,CAAC,yDAAyD,CAAC;IAC5E;IAEAD,GAAG,CAACE,oBAAoB,GAAGH,OAAO,CAACG,oBAAoB;EACzD;EAEA,OAAOF,GAAG;AACZ"}
@@ -1,3 +1,3 @@
1
1
  // Generated by genversion.
2
- export const version = '8.1.1';
2
+ export const version = '8.2.0';
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 = '8.1.1';\n"]}
1
+ {"version":3,"names":["version"],"sources":["version.ts"],"sourcesContent":["// Generated by genversion.\nexport const version = '8.2.0';\n"],"mappings":"AAAA;AACA,OAAO,MAAMA,OAAO,GAAG,OAAO"}
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react-native" />
2
- /// <reference types="node" />
3
2
  /**
4
3
  * window.btoa
5
4
  */
@@ -1,4 +1,4 @@
1
- export declare const SDK_VERSION = "8.1.1";
1
+ export declare const SDK_VERSION = "8.2.0";
2
2
  export { default, MobileAds } from './MobileAds';
3
3
  export { AdsConsentDebugGeography } from './AdsConsentDebugGeography';
4
4
  export { AdsConsentPurposes } from './AdsConsentPurposes';
@@ -7,9 +7,3 @@ import { ModuleInterface } from '../../types/Module.interface';
7
7
  * @returns {*}
8
8
  */
9
9
  export declare function getNativeModule(module: ModuleInterface): unknown;
10
- /**
11
- * Custom wrapped app module as it does not have it's own FirebaseModule based class.
12
- *
13
- * @returns {*}
14
- */
15
- export declare function getAppModule(): unknown;
@@ -1 +1 @@
1
- export declare const version = "8.1.1";
1
+ export declare const version = "8.2.0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-google-mobile-ads",
3
- "version": "8.1.1",
3
+ "version": "8.2.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",
@@ -84,8 +84,13 @@
84
84
  "tests:packager": "cd RNGoogleMobileAdsExample && yarn react-native start",
85
85
  "tests:packager:reset-cache": "cd RNGoogleMobileAdsExample && yarn react-native start --reset-cache",
86
86
  "tests:android:build": "cd RNGoogleMobileAdsExample && yarn detox build --configuration android.emu.debug",
87
+ "tests:android:build:windows": "cd RNGoogleMobileAdsExample && yarn detox build --configuration android.emu.debug.windows",
87
88
  "tests:android:build-release": "cd RNGoogleMobileAdsExample && yarn detox build --configuration android.emu.release",
89
+ "tests:android:build-release:windows": "cd RNGoogleMobileAdsExample && yarn detox build --configuration android.emu.release.windows",
88
90
  "tests:android:test": "cd RNGoogleMobileAdsExample && yarn detox test --configuration android.emu.debug --loglevel trace",
91
+ "tests:android:test:windows": "cd RNGoogleMobileAdsExample && yarn detox test --configuration android.emu.debug.windows --loglevel trace",
92
+ "tests:android:test-release": "cd RNGoogleMobileAdsExample && yarn detox test --configuration android.emu.release --loglevel trace",
93
+ "tests:android:test-release:windows": "cd RNGoogleMobileAdsExample && yarn detox test --configuration android.emu.release.windows --loglevel trace",
89
94
  "tests:android:test:debug": "cd RNGoogleMobileAdsExample && yarn detox test --configuration android.emu.debug --inspect",
90
95
  "tests:android:test-reuse": "cd RNGoogleMobileAdsExample && yarn detox test --configuration android.emu.debug --reuse",
91
96
  "tests:android:test-cover": "cd RNGoogleMobileAdsExample && ./node_modules/.bin/nyc yarn detox test --loglevel trace --configuration android.emu.debug",
@@ -101,49 +106,49 @@
101
106
  "package:update": "yarn upgrade --latest"
102
107
  },
103
108
  "dependencies": {
104
- "@iabtcf/core": "^1.4.0",
109
+ "@iabtcf/core": "^1.5.3",
105
110
  "use-deep-compare-effect": "^1.8.1"
106
111
  },
107
112
  "devDependencies": {
108
- "@babel/core": "^7.17.9",
109
- "@babel/preset-env": "^7.16.11",
113
+ "@babel/core": "^7.19.3",
114
+ "@babel/preset-env": "^7.19.4",
110
115
  "@semantic-release/changelog": "^6.0.1",
111
116
  "@semantic-release/commit-analyzer": "^9.0.2",
112
117
  "@semantic-release/git": "^10.0.1",
113
- "@semantic-release/github": "^8.0.4",
118
+ "@semantic-release/github": "^8.0.6",
114
119
  "@semantic-release/npm": "^9.0.1",
115
120
  "@semantic-release/release-notes-generator": "^10.0.3",
116
- "@types/jest": "^27.4.1",
117
- "@types/node": "^17.0.30",
118
- "@types/react": "^18.0.8",
119
- "@types/react-native": "^0.67.6",
120
- "@typescript-eslint/eslint-plugin": "^5.21.0",
121
- "@typescript-eslint/parser": "^5.21.0",
122
- "babel-jest": "^28.0.3",
121
+ "@types/jest": "^29.1.2",
122
+ "@types/node": "^18.8.4",
123
+ "@types/react": "^18.0.21",
124
+ "@types/react-native": "^0.70.4",
125
+ "@typescript-eslint/eslint-plugin": "^5.40.0",
126
+ "@typescript-eslint/parser": "^5.40.0",
127
+ "babel-jest": "^29.1.2",
123
128
  "clang-format": "1.8.0",
124
129
  "codecov": "^3.8.3",
125
130
  "conventional-changelog-cli": "^2.2.2",
126
- "eslint": "^8.14.0",
131
+ "eslint": "^8.25.0",
127
132
  "eslint-config-prettier": "^8.5.0",
128
- "eslint-plugin-jest": "^26.1.5",
129
- "eslint-plugin-mocha": "^10.0.4",
130
- "eslint-plugin-prettier": "^4.0.0",
131
- "eslint-plugin-react": "^7.29.4",
133
+ "eslint-plugin-jest": "^27.1.1",
134
+ "eslint-plugin-mocha": "^10.1.0",
135
+ "eslint-plugin-prettier": "^4.2.1",
136
+ "eslint-plugin-react": "^7.31.10",
132
137
  "genversion": "^3.1.1",
133
- "google-java-format": "^1.0.1",
134
- "inquirer": "^8.2.4",
135
- "jest": "^28.0.3",
136
- "lerna": "4.0.0",
137
- "prettier": "^2.6.2",
138
- "react": "^18.1.0",
139
- "react-native": "0.68.1",
140
- "react-native-builder-bob": "^0.18.2",
138
+ "google-java-format": "^1.1.0",
139
+ "inquirer": "^9.1.3",
140
+ "jest": "^29.1.2",
141
+ "lerna": "5.6.2",
142
+ "prettier": "^2.7.1",
143
+ "react": "^18.2.0",
144
+ "react-native": "0.70.2",
145
+ "react-native-builder-bob": "^0.18.3",
141
146
  "rimraf": "^3.0.2",
142
- "semantic-release": "^19.0.2",
147
+ "semantic-release": "^19.0.5",
143
148
  "shelljs": "^0.8.5",
144
- "ts-jest": "^27.1.4",
145
- "ts-node": "^10.7.0",
146
- "typescript": "^4.6.4"
149
+ "ts-jest": "^29.0.3",
150
+ "ts-node": "^10.9.1",
151
+ "typescript": "^4.8.4"
147
152
  },
148
153
  "publishConfig": {
149
154
  "access": "public"
@@ -99,6 +99,11 @@ export abstract class MobileAd implements MobileAdInterface {
99
99
  this._isLoadCalled = false;
100
100
  }
101
101
 
102
+ if (type === AdEventType.ERROR) {
103
+ this._loaded = false;
104
+ this._isLoadCalled = false;
105
+ }
106
+
102
107
  let payload: AdEventPayload<EventType> = data;
103
108
  if (error) {
104
109
  payload = NativeError.fromEvent(error, 'googleMobileAds');
@@ -16,7 +16,6 @@
16
16
  */
17
17
 
18
18
  import { NativeModules, Platform } from 'react-native';
19
- import { APP_NATIVE_MODULE } from '../constants';
20
19
  import { NativeError } from '../NativeError';
21
20
  import { GoogleMobileAdsNativeEventEmitter } from '../GoogleMobileAdsNativeEventEmitter';
22
21
  import { SharedEventEmitter } from '../SharedEventEmitter';
@@ -47,6 +46,8 @@ function nativeModuleMethodWrapped(
47
46
  return (...args: []) => {
48
47
  const possiblePromise = method(...[...argToPrepend, ...args]);
49
48
 
49
+ // @ts-ignore -- return type is Promise, so tsc infers we *know* it is a promise and .then always exists, but
50
+ // but the typing is actually speculative, we do need to test it
50
51
  if (possiblePromise && possiblePromise.then) {
51
52
  const jsStack = new Error().stack || '';
52
53
  return possiblePromise.catch(nativeError =>
@@ -202,25 +203,3 @@ export function getNativeModule(module: ModuleInterface) {
202
203
 
203
204
  return initialiseNativeModule(module);
204
205
  }
205
-
206
- /**
207
- * Custom wrapped app module as it does not have it's own FirebaseModule based class.
208
- *
209
- * @returns {*}
210
- */
211
- export function getAppModule() {
212
- if (NATIVE_MODULE_REGISTRY[APP_NATIVE_MODULE]) {
213
- return NATIVE_MODULE_REGISTRY[APP_NATIVE_MODULE];
214
- }
215
-
216
- const namespace = 'app';
217
- const nativeModule = NativeModules[APP_NATIVE_MODULE];
218
-
219
- if (!nativeModule) {
220
- throw new Error(getMissingModuleHelpText(namespace));
221
- }
222
-
223
- NATIVE_MODULE_REGISTRY[APP_NATIVE_MODULE] = nativeModuleWrapped(namespace, nativeModule, []);
224
-
225
- return NATIVE_MODULE_REGISTRY[APP_NATIVE_MODULE];
226
- }
package/src/version.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  // Generated by genversion.
2
- export const version = '8.1.1';
2
+ export const version = '8.2.0';
@@ -1,30 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.KNOWN_NAMESPACES = exports.DEFAULT_APP_NAME = exports.APP_NATIVE_MODULE = void 0;
7
-
8
- /*
9
- * Copyright (c) 2016-present Invertase Limited & Contributors
10
- *
11
- * Licensed under the Apache License, Version 2.0 (the "License");
12
- * you may not use this library except in compliance with the License.
13
- * You may obtain a copy of the License at
14
- *
15
- * http://www.apache.org/licenses/LICENSE-2.0
16
- *
17
- * Unless required by applicable law or agreed to in writing, software
18
- * distributed under the License is distributed on an "AS IS" BASIS,
19
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20
- * See the License for the specific language governing permissions and
21
- * limitations under the License.
22
- *
23
- */
24
- const APP_NATIVE_MODULE = 'RNFBAppModule';
25
- exports.APP_NATIVE_MODULE = APP_NATIVE_MODULE;
26
- const DEFAULT_APP_NAME = '[DEFAULT]';
27
- exports.DEFAULT_APP_NAME = DEFAULT_APP_NAME;
28
- const KNOWN_NAMESPACES = ['appCheck', 'appDistribution', 'auth', 'analytics', 'remoteConfig', 'crashlytics', 'database', 'inAppMessaging', 'installations', 'firestore', 'functions', 'indexing', 'storage', 'dynamicLinks', 'messaging', 'naturalLanguage', 'ml', 'notifications', 'perf', 'utils'];
29
- exports.KNOWN_NAMESPACES = KNOWN_NAMESPACES;
30
- //# sourceMappingURL=constants.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["constants.ts"],"names":["APP_NATIVE_MODULE","DEFAULT_APP_NAME","KNOWN_NAMESPACES"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEO,MAAMA,iBAAiB,GAAG,eAA1B;;AAEA,MAAMC,gBAAgB,GAAG,WAAzB;;AAEA,MAAMC,gBAAgB,GAAG,CAC9B,UAD8B,EAE9B,iBAF8B,EAG9B,MAH8B,EAI9B,WAJ8B,EAK9B,cAL8B,EAM9B,aAN8B,EAO9B,UAP8B,EAQ9B,gBAR8B,EAS9B,eAT8B,EAU9B,WAV8B,EAW9B,WAX8B,EAY9B,UAZ8B,EAa9B,SAb8B,EAc9B,cAd8B,EAe9B,WAf8B,EAgB9B,iBAhB8B,EAiB9B,IAjB8B,EAkB9B,eAlB8B,EAmB9B,MAnB8B,EAoB9B,OApB8B,CAAzB","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\nexport const APP_NATIVE_MODULE = 'RNFBAppModule';\n\nexport const DEFAULT_APP_NAME = '[DEFAULT]';\n\nexport const KNOWN_NAMESPACES = [\n 'appCheck',\n 'appDistribution',\n 'auth',\n 'analytics',\n 'remoteConfig',\n 'crashlytics',\n 'database',\n 'inAppMessaging',\n 'installations',\n 'firestore',\n 'functions',\n 'indexing',\n 'storage',\n 'dynamicLinks',\n 'messaging',\n 'naturalLanguage',\n 'ml',\n 'notifications',\n 'perf',\n 'utils',\n];\n"]}
@@ -1,20 +0,0 @@
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
- export const APP_NATIVE_MODULE = 'RNFBAppModule';
18
- export const DEFAULT_APP_NAME = '[DEFAULT]';
19
- export const KNOWN_NAMESPACES = ['appCheck', 'appDistribution', 'auth', 'analytics', 'remoteConfig', 'crashlytics', 'database', 'inAppMessaging', 'installations', 'firestore', 'functions', 'indexing', 'storage', 'dynamicLinks', 'messaging', 'naturalLanguage', 'ml', 'notifications', 'perf', 'utils'];
20
- //# sourceMappingURL=constants.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["constants.ts"],"names":["APP_NATIVE_MODULE","DEFAULT_APP_NAME","KNOWN_NAMESPACES"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,OAAO,MAAMA,iBAAiB,GAAG,eAA1B;AAEP,OAAO,MAAMC,gBAAgB,GAAG,WAAzB;AAEP,OAAO,MAAMC,gBAAgB,GAAG,CAC9B,UAD8B,EAE9B,iBAF8B,EAG9B,MAH8B,EAI9B,WAJ8B,EAK9B,cAL8B,EAM9B,aAN8B,EAO9B,UAP8B,EAQ9B,gBAR8B,EAS9B,eAT8B,EAU9B,WAV8B,EAW9B,WAX8B,EAY9B,UAZ8B,EAa9B,SAb8B,EAc9B,cAd8B,EAe9B,WAf8B,EAgB9B,iBAhB8B,EAiB9B,IAjB8B,EAkB9B,eAlB8B,EAmB9B,MAnB8B,EAoB9B,OApB8B,CAAzB","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\nexport const APP_NATIVE_MODULE = 'RNFBAppModule';\n\nexport const DEFAULT_APP_NAME = '[DEFAULT]';\n\nexport const KNOWN_NAMESPACES = [\n 'appCheck',\n 'appDistribution',\n 'auth',\n 'analytics',\n 'remoteConfig',\n 'crashlytics',\n 'database',\n 'inAppMessaging',\n 'installations',\n 'firestore',\n 'functions',\n 'indexing',\n 'storage',\n 'dynamicLinks',\n 'messaging',\n 'naturalLanguage',\n 'ml',\n 'notifications',\n 'perf',\n 'utils',\n];\n"]}
@@ -1,3 +0,0 @@
1
- export declare const APP_NATIVE_MODULE = "RNFBAppModule";
2
- export declare const DEFAULT_APP_NAME = "[DEFAULT]";
3
- export declare const KNOWN_NAMESPACES: string[];
@@ -1,43 +0,0 @@
1
- /*
2
- * Copyright (c) 2016-present Invertase Limited & Contributors
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this library except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- *
16
- */
17
-
18
- export const APP_NATIVE_MODULE = 'RNFBAppModule';
19
-
20
- export const DEFAULT_APP_NAME = '[DEFAULT]';
21
-
22
- export const KNOWN_NAMESPACES = [
23
- 'appCheck',
24
- 'appDistribution',
25
- 'auth',
26
- 'analytics',
27
- 'remoteConfig',
28
- 'crashlytics',
29
- 'database',
30
- 'inAppMessaging',
31
- 'installations',
32
- 'firestore',
33
- 'functions',
34
- 'indexing',
35
- 'storage',
36
- 'dynamicLinks',
37
- 'messaging',
38
- 'naturalLanguage',
39
- 'ml',
40
- 'notifications',
41
- 'perf',
42
- 'utils',
43
- ];