react-native-google-mobile-ads 4.1.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 (373) hide show
  1. package/LICENSE +32 -0
  2. package/README.md +65 -0
  3. package/RNGoogleMobileAds.podspec +42 -0
  4. package/__tests__/consent.test.ts +25 -0
  5. package/__tests__/googleMobileAds.test.ts +63 -0
  6. package/__tests__/interstitial.test.ts +53 -0
  7. package/__tests__/requestOptions.test.tsx +4 -0
  8. package/__tests__/rewarded.test.tsx +4 -0
  9. package/__tests__/showOptions.test.tsx +4 -0
  10. package/android/.editorconfig +10 -0
  11. package/android/app-json.gradle +69 -0
  12. package/android/build.gradle +98 -0
  13. package/android/lint.xml +5 -0
  14. package/android/settings.gradle +1 -0
  15. package/android/src/main/AndroidManifest.xml +17 -0
  16. package/android/src/main/java/io/invertase/googlemobileads/ReactNativeAppModule.java +169 -0
  17. package/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsAppOpenModule.java +161 -0
  18. package/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsBannerAdViewManager.java +209 -0
  19. package/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsCommon.java +256 -0
  20. package/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsConsentModule.java +226 -0
  21. package/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsEvent.java +72 -0
  22. package/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsInterstitialModule.java +159 -0
  23. package/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsModule.java +143 -0
  24. package/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsPackage.java +48 -0
  25. package/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsRewardedModule.java +177 -0
  26. package/android/src/main/java/io/invertase/googlemobileads/common/RCTConvert.java +111 -0
  27. package/android/src/main/java/io/invertase/googlemobileads/common/ReactNativeApp.java +34 -0
  28. package/android/src/main/java/io/invertase/googlemobileads/common/ReactNativeEvent.java +41 -0
  29. package/android/src/main/java/io/invertase/googlemobileads/common/ReactNativeEventEmitter.java +150 -0
  30. package/android/src/main/java/io/invertase/googlemobileads/common/ReactNativeInitProvider.java +77 -0
  31. package/android/src/main/java/io/invertase/googlemobileads/common/ReactNativeJSON.java +107 -0
  32. package/android/src/main/java/io/invertase/googlemobileads/common/ReactNativeMeta.java +92 -0
  33. package/android/src/main/java/io/invertase/googlemobileads/common/ReactNativeModule.java +96 -0
  34. package/android/src/main/java/io/invertase/googlemobileads/common/ReactNativePreferences.java +86 -0
  35. package/android/src/main/java/io/invertase/googlemobileads/common/SharedUtils.java +427 -0
  36. package/android/src/main/java/io/invertase/googlemobileads/common/TaskExecutorService.java +124 -0
  37. package/android/src/main/java/io/invertase/googlemobileads/interfaces/ContextProvider.java +30 -0
  38. package/android/src/main/java/io/invertase/googlemobileads/interfaces/NativeError.java +28 -0
  39. package/android/src/main/java/io/invertase/googlemobileads/interfaces/NativeEvent.java +26 -0
  40. package/babel.config.js +18 -0
  41. package/docs/displaying-ads.mdx +319 -0
  42. package/docs/european-user-consent.mdx +258 -0
  43. package/docs/img/logo_admob_192px.svg +19 -0
  44. package/docs/index.mdx +168 -0
  45. package/docs.json +9 -0
  46. package/ios/RNGoogleMobileAds/RNGoogleMobileAdsAppOpenModule.h +29 -0
  47. package/ios/RNGoogleMobileAds/RNGoogleMobileAdsAppOpenModule.m +98 -0
  48. package/ios/RNGoogleMobileAds/RNGoogleMobileAdsBannerViewManager.h +23 -0
  49. package/ios/RNGoogleMobileAds/RNGoogleMobileAdsBannerViewManager.m +153 -0
  50. package/ios/RNGoogleMobileAds/RNGoogleMobileAdsCommon.h +60 -0
  51. package/ios/RNGoogleMobileAds/RNGoogleMobileAdsCommon.m +201 -0
  52. package/ios/RNGoogleMobileAds/RNGoogleMobileAdsConsentModule.h +26 -0
  53. package/ios/RNGoogleMobileAds/RNGoogleMobileAdsConsentModule.m +179 -0
  54. package/ios/RNGoogleMobileAds/RNGoogleMobileAdsFullScreenContentDelegate.h +32 -0
  55. package/ios/RNGoogleMobileAds/RNGoogleMobileAdsFullScreenContentDelegate.m +57 -0
  56. package/ios/RNGoogleMobileAds/RNGoogleMobileAdsInterstitialModule.h +25 -0
  57. package/ios/RNGoogleMobileAds/RNGoogleMobileAdsInterstitialModule.m +124 -0
  58. package/ios/RNGoogleMobileAds/RNGoogleMobileAdsModule.h +24 -0
  59. package/ios/RNGoogleMobileAds/RNGoogleMobileAdsModule.m +104 -0
  60. package/ios/RNGoogleMobileAds/RNGoogleMobileAdsRewardedModule.h +25 -0
  61. package/ios/RNGoogleMobileAds/RNGoogleMobileAdsRewardedModule.m +173 -0
  62. package/ios/RNGoogleMobileAds/common/RNAppModule.h +24 -0
  63. package/ios/RNGoogleMobileAds/common/RNAppModule.m +158 -0
  64. package/ios/RNGoogleMobileAds/common/RNJSON.h +34 -0
  65. package/ios/RNGoogleMobileAds/common/RNJSON.m +93 -0
  66. package/ios/RNGoogleMobileAds/common/RNMeta.h +30 -0
  67. package/ios/RNGoogleMobileAds/common/RNMeta.m +61 -0
  68. package/ios/RNGoogleMobileAds/common/RNPreferences.h +44 -0
  69. package/ios/RNGoogleMobileAds/common/RNPreferences.m +94 -0
  70. package/ios/RNGoogleMobileAds/common/RNRCTEventEmitter.h +73 -0
  71. package/ios/RNGoogleMobileAds/common/RNRCTEventEmitter.m +150 -0
  72. package/ios/RNGoogleMobileAds/common/RNSharedUtils.h +48 -0
  73. package/ios/RNGoogleMobileAds/common/RNSharedUtils.m +56 -0
  74. package/ios/RNGoogleMobileAds.xcodeproj/project.pbxproj +377 -0
  75. package/ios/RNGoogleMobileAds.xcodeproj/xcshareddata/IDETemplateMacros.plist +24 -0
  76. package/ios_config.sh +140 -0
  77. package/jest.config.js +6 -0
  78. package/jest.setup.ts +29 -0
  79. package/lib/commonjs/AdEventType.js +34 -0
  80. package/lib/commonjs/AdEventType.js.map +1 -0
  81. package/lib/commonjs/AdsConsent.js +160 -0
  82. package/lib/commonjs/AdsConsent.js.map +1 -0
  83. package/lib/commonjs/AdsConsentDebugGeography.js +38 -0
  84. package/lib/commonjs/AdsConsentDebugGeography.js.map +1 -0
  85. package/lib/commonjs/AdsConsentStatus.js +36 -0
  86. package/lib/commonjs/AdsConsentStatus.js.map +1 -0
  87. package/lib/commonjs/BannerAdSize.js +38 -0
  88. package/lib/commonjs/BannerAdSize.js.map +1 -0
  89. package/lib/commonjs/MaxAdContentRating.js +33 -0
  90. package/lib/commonjs/MaxAdContentRating.js.map +1 -0
  91. package/lib/commonjs/MobileAds.js +67 -0
  92. package/lib/commonjs/MobileAds.js.map +1 -0
  93. package/lib/commonjs/RewardedAdEventType.js +31 -0
  94. package/lib/commonjs/RewardedAdEventType.js.map +1 -0
  95. package/lib/commonjs/TestIds.js +47 -0
  96. package/lib/commonjs/TestIds.js.map +1 -0
  97. package/lib/commonjs/ads/AppOpenAd.js +96 -0
  98. package/lib/commonjs/ads/AppOpenAd.js.map +1 -0
  99. package/lib/commonjs/ads/BannerAd.js +128 -0
  100. package/lib/commonjs/ads/BannerAd.js.map +1 -0
  101. package/lib/commonjs/ads/InterstitialAd.js +163 -0
  102. package/lib/commonjs/ads/InterstitialAd.js.map +1 -0
  103. package/lib/commonjs/ads/MobileAd.js +90 -0
  104. package/lib/commonjs/ads/MobileAd.js.map +1 -0
  105. package/lib/commonjs/ads/RewardedAd.js +169 -0
  106. package/lib/commonjs/ads/RewardedAd.js.map +1 -0
  107. package/lib/commonjs/common/Base64.js +121 -0
  108. package/lib/commonjs/common/Base64.js.map +1 -0
  109. package/lib/commonjs/common/MutatableParams.js +46 -0
  110. package/lib/commonjs/common/MutatableParams.js.map +1 -0
  111. package/lib/commonjs/common/ReferenceBase.js +59 -0
  112. package/lib/commonjs/common/ReferenceBase.js.map +1 -0
  113. package/lib/commonjs/common/deeps.js +101 -0
  114. package/lib/commonjs/common/deeps.js.map +1 -0
  115. package/lib/commonjs/common/id.js +82 -0
  116. package/lib/commonjs/common/id.js.map +1 -0
  117. package/lib/commonjs/common/index.js +212 -0
  118. package/lib/commonjs/common/index.js.map +1 -0
  119. package/lib/commonjs/common/path.js +144 -0
  120. package/lib/commonjs/common/path.js.map +1 -0
  121. package/lib/commonjs/common/promise.js +70 -0
  122. package/lib/commonjs/common/promise.js.map +1 -0
  123. package/lib/commonjs/common/serialize.js +52 -0
  124. package/lib/commonjs/common/serialize.js.map +1 -0
  125. package/lib/commonjs/common/validate.js +239 -0
  126. package/lib/commonjs/common/validate.js.map +1 -0
  127. package/lib/commonjs/declarations.d.js +2 -0
  128. package/lib/commonjs/declarations.d.js.map +1 -0
  129. package/lib/commonjs/index.js +143 -0
  130. package/lib/commonjs/index.js.map +1 -0
  131. package/lib/commonjs/internal/GoogleMobileAdsNativeEventEmitter.js +76 -0
  132. package/lib/commonjs/internal/GoogleMobileAdsNativeEventEmitter.js.map +1 -0
  133. package/lib/commonjs/internal/Module.js +60 -0
  134. package/lib/commonjs/internal/Module.js.map +1 -0
  135. package/lib/commonjs/internal/NativeError.js +70 -0
  136. package/lib/commonjs/internal/NativeError.js.map +1 -0
  137. package/lib/commonjs/internal/SharedEventEmitter.js +31 -0
  138. package/lib/commonjs/internal/SharedEventEmitter.js.map +1 -0
  139. package/lib/commonjs/internal/constants.js +30 -0
  140. package/lib/commonjs/internal/constants.js.map +1 -0
  141. package/lib/commonjs/internal/index.js +49 -0
  142. package/lib/commonjs/internal/index.js.map +1 -0
  143. package/lib/commonjs/internal/registry/nativeModule.js +231 -0
  144. package/lib/commonjs/internal/registry/nativeModule.js.map +1 -0
  145. package/lib/commonjs/types/AdEventListener.js +6 -0
  146. package/lib/commonjs/types/AdEventListener.js.map +1 -0
  147. package/lib/commonjs/types/AdShowOptions.js +2 -0
  148. package/lib/commonjs/types/AdShowOptions.js.map +1 -0
  149. package/lib/commonjs/types/AdapterStatus.js +18 -0
  150. package/lib/commonjs/types/AdapterStatus.js.map +1 -0
  151. package/lib/commonjs/types/AdsConsent.interface.js +6 -0
  152. package/lib/commonjs/types/AdsConsent.interface.js.map +1 -0
  153. package/lib/commonjs/types/BannerAdProps.js +6 -0
  154. package/lib/commonjs/types/BannerAdProps.js.map +1 -0
  155. package/lib/commonjs/types/GoogleMobileAdsNativeModule.js +6 -0
  156. package/lib/commonjs/types/GoogleMobileAdsNativeModule.js.map +1 -0
  157. package/lib/commonjs/types/MobileAd.interface.js +6 -0
  158. package/lib/commonjs/types/MobileAd.interface.js.map +1 -0
  159. package/lib/commonjs/types/MobileAdsModule.interface.js +6 -0
  160. package/lib/commonjs/types/MobileAdsModule.interface.js.map +1 -0
  161. package/lib/commonjs/types/Module.interface.js +2 -0
  162. package/lib/commonjs/types/Module.interface.js.map +1 -0
  163. package/lib/commonjs/types/RequestConfiguration.js +6 -0
  164. package/lib/commonjs/types/RequestConfiguration.js.map +1 -0
  165. package/lib/commonjs/types/RequestOptions.js +2 -0
  166. package/lib/commonjs/types/RequestOptions.js.map +1 -0
  167. package/lib/commonjs/types/RewardedAdReward.js +2 -0
  168. package/lib/commonjs/types/RewardedAdReward.js.map +1 -0
  169. package/lib/commonjs/validateAdRequestConfiguration.js +69 -0
  170. package/lib/commonjs/validateAdRequestConfiguration.js.map +1 -0
  171. package/lib/commonjs/validateAdRequestOptions.js +158 -0
  172. package/lib/commonjs/validateAdRequestOptions.js.map +1 -0
  173. package/lib/commonjs/validateAdShowOptions.js +47 -0
  174. package/lib/commonjs/validateAdShowOptions.js.map +1 -0
  175. package/lib/commonjs/version.js +10 -0
  176. package/lib/commonjs/version.js.map +1 -0
  177. package/lib/module/AdEventType.js +26 -0
  178. package/lib/module/AdEventType.js.map +1 -0
  179. package/lib/module/AdsConsent.js +148 -0
  180. package/lib/module/AdsConsent.js.map +1 -0
  181. package/lib/module/AdsConsentDebugGeography.js +30 -0
  182. package/lib/module/AdsConsentDebugGeography.js.map +1 -0
  183. package/lib/module/AdsConsentStatus.js +28 -0
  184. package/lib/module/AdsConsentStatus.js.map +1 -0
  185. package/lib/module/BannerAdSize.js +30 -0
  186. package/lib/module/BannerAdSize.js.map +1 -0
  187. package/lib/module/MaxAdContentRating.js +25 -0
  188. package/lib/module/MaxAdContentRating.js.map +1 -0
  189. package/lib/module/MobileAds.js +53 -0
  190. package/lib/module/MobileAds.js.map +1 -0
  191. package/lib/module/RewardedAdEventType.js +23 -0
  192. package/lib/module/RewardedAdEventType.js.map +1 -0
  193. package/lib/module/TestIds.js +38 -0
  194. package/lib/module/TestIds.js.map +1 -0
  195. package/lib/module/ads/AppOpenAd.js +81 -0
  196. package/lib/module/ads/AppOpenAd.js.map +1 -0
  197. package/lib/module/ads/BannerAd.js +108 -0
  198. package/lib/module/ads/BannerAd.js.map +1 -0
  199. package/lib/module/ads/InterstitialAd.js +149 -0
  200. package/lib/module/ads/InterstitialAd.js.map +1 -0
  201. package/lib/module/ads/MobileAd.js +94 -0
  202. package/lib/module/ads/MobileAd.js.map +1 -0
  203. package/lib/module/ads/RewardedAd.js +155 -0
  204. package/lib/module/ads/RewardedAd.js.map +1 -0
  205. package/lib/module/common/Base64.js +106 -0
  206. package/lib/module/common/Base64.js.map +1 -0
  207. package/lib/module/common/MutatableParams.js +52 -0
  208. package/lib/module/common/MutatableParams.js.map +1 -0
  209. package/lib/module/common/ReferenceBase.js +50 -0
  210. package/lib/module/common/ReferenceBase.js.map +1 -0
  211. package/lib/module/common/deeps.js +91 -0
  212. package/lib/module/common/deeps.js.map +1 -0
  213. package/lib/module/common/id.js +74 -0
  214. package/lib/module/common/id.js.map +1 -0
  215. package/lib/module/common/index.js +109 -0
  216. package/lib/module/common/index.js.map +1 -0
  217. package/lib/module/common/path.js +120 -0
  218. package/lib/module/common/path.js.map +1 -0
  219. package/lib/module/common/promise.js +60 -0
  220. package/lib/module/common/promise.js.map +1 -0
  221. package/lib/module/common/serialize.js +41 -0
  222. package/lib/module/common/serialize.js.map +1 -0
  223. package/lib/module/common/validate.js +197 -0
  224. package/lib/module/common/validate.js.map +1 -0
  225. package/lib/module/declarations.d.js +2 -0
  226. package/lib/module/declarations.d.js.map +1 -0
  227. package/lib/module/index.js +33 -0
  228. package/lib/module/index.js.map +1 -0
  229. package/lib/module/internal/GoogleMobileAdsNativeEventEmitter.js +83 -0
  230. package/lib/module/internal/GoogleMobileAdsNativeEventEmitter.js.map +1 -0
  231. package/lib/module/internal/Module.js +64 -0
  232. package/lib/module/internal/Module.js.map +1 -0
  233. package/lib/module/internal/NativeError.js +61 -0
  234. package/lib/module/internal/NativeError.js.map +1 -0
  235. package/lib/module/internal/SharedEventEmitter.js +20 -0
  236. package/lib/module/internal/SharedEventEmitter.js.map +1 -0
  237. package/lib/module/internal/constants.js +20 -0
  238. package/lib/module/internal/constants.js.map +1 -0
  239. package/lib/module/internal/index.js +21 -0
  240. package/lib/module/internal/index.js.map +1 -0
  241. package/lib/module/internal/registry/nativeModule.js +215 -0
  242. package/lib/module/internal/registry/nativeModule.js.map +1 -0
  243. package/lib/module/types/AdEventListener.js +2 -0
  244. package/lib/module/types/AdEventListener.js.map +1 -0
  245. package/lib/module/types/AdShowOptions.js +2 -0
  246. package/lib/module/types/AdShowOptions.js.map +1 -0
  247. package/lib/module/types/AdapterStatus.js +10 -0
  248. package/lib/module/types/AdapterStatus.js.map +1 -0
  249. package/lib/module/types/AdsConsent.interface.js +2 -0
  250. package/lib/module/types/AdsConsent.interface.js.map +1 -0
  251. package/lib/module/types/BannerAdProps.js +2 -0
  252. package/lib/module/types/BannerAdProps.js.map +1 -0
  253. package/lib/module/types/GoogleMobileAdsNativeModule.js +2 -0
  254. package/lib/module/types/GoogleMobileAdsNativeModule.js.map +1 -0
  255. package/lib/module/types/MobileAd.interface.js +2 -0
  256. package/lib/module/types/MobileAd.interface.js.map +1 -0
  257. package/lib/module/types/MobileAdsModule.interface.js +2 -0
  258. package/lib/module/types/MobileAdsModule.interface.js.map +1 -0
  259. package/lib/module/types/Module.interface.js +2 -0
  260. package/lib/module/types/Module.interface.js.map +1 -0
  261. package/lib/module/types/RequestConfiguration.js +2 -0
  262. package/lib/module/types/RequestConfiguration.js.map +1 -0
  263. package/lib/module/types/RequestOptions.js +2 -0
  264. package/lib/module/types/RequestOptions.js.map +1 -0
  265. package/lib/module/types/RewardedAdReward.js +2 -0
  266. package/lib/module/types/RewardedAdReward.js.map +1 -0
  267. package/lib/module/validateAdRequestConfiguration.js +60 -0
  268. package/lib/module/validateAdRequestConfiguration.js.map +1 -0
  269. package/lib/module/validateAdRequestOptions.js +150 -0
  270. package/lib/module/validateAdRequestOptions.js.map +1 -0
  271. package/lib/module/validateAdShowOptions.js +39 -0
  272. package/lib/module/validateAdShowOptions.js.map +1 -0
  273. package/lib/module/version.js +3 -0
  274. package/lib/module/version.js.map +1 -0
  275. package/lib/typescript/AdEventType.d.ts +47 -0
  276. package/lib/typescript/AdsConsent.d.ts +2 -0
  277. package/lib/typescript/AdsConsentDebugGeography.d.ts +19 -0
  278. package/lib/typescript/AdsConsentStatus.d.ts +17 -0
  279. package/lib/typescript/BannerAdSize.d.ts +34 -0
  280. package/lib/typescript/MaxAdContentRating.d.ts +18 -0
  281. package/lib/typescript/MobileAds.d.ts +11 -0
  282. package/lib/typescript/RewardedAdEventType.d.ts +46 -0
  283. package/lib/typescript/TestIds.d.ts +6 -0
  284. package/lib/typescript/ads/AppOpenAd.d.ts +11 -0
  285. package/lib/typescript/ads/BannerAd.d.ts +3 -0
  286. package/lib/typescript/ads/InterstitialAd.d.ts +78 -0
  287. package/lib/typescript/ads/MobileAd.d.ts +32 -0
  288. package/lib/typescript/ads/RewardedAd.d.ts +84 -0
  289. package/lib/typescript/common/Base64.d.ts +14 -0
  290. package/lib/typescript/common/MutatableParams.d.ts +9 -0
  291. package/lib/typescript/common/ReferenceBase.d.ts +11 -0
  292. package/lib/typescript/common/deeps.d.ts +18 -0
  293. package/lib/typescript/common/id.d.ts +11 -0
  294. package/lib/typescript/common/index.d.ts +28 -0
  295. package/lib/typescript/common/path.d.ts +43 -0
  296. package/lib/typescript/common/promise.d.ts +13 -0
  297. package/lib/typescript/common/serialize.d.ts +5 -0
  298. package/lib/typescript/common/validate.d.ts +90 -0
  299. package/lib/typescript/index.d.ts +14 -0
  300. package/lib/typescript/internal/GoogleMobileAdsNativeEventEmitter.d.ts +12 -0
  301. package/lib/typescript/internal/Module.d.ts +13 -0
  302. package/lib/typescript/internal/NativeError.d.ts +26 -0
  303. package/lib/typescript/internal/SharedEventEmitter.d.ts +2 -0
  304. package/lib/typescript/internal/constants.d.ts +3 -0
  305. package/lib/typescript/internal/index.d.ts +4 -0
  306. package/lib/typescript/internal/registry/nativeModule.d.ts +15 -0
  307. package/lib/typescript/types/AdEventListener.d.ts +11 -0
  308. package/lib/typescript/types/AdShowOptions.d.ts +12 -0
  309. package/lib/typescript/types/AdapterStatus.d.ts +18 -0
  310. package/lib/typescript/types/AdsConsent.interface.d.ts +286 -0
  311. package/lib/typescript/types/BannerAdProps.d.ts +66 -0
  312. package/lib/typescript/types/GoogleMobileAdsNativeModule.d.ts +14 -0
  313. package/lib/typescript/types/MobileAd.interface.d.ts +64 -0
  314. package/lib/typescript/types/MobileAdsModule.interface.d.ts +38 -0
  315. package/lib/typescript/types/Module.interface.d.ts +14 -0
  316. package/lib/typescript/types/RequestConfiguration.d.ts +36 -0
  317. package/lib/typescript/types/RequestOptions.d.ts +106 -0
  318. package/lib/typescript/types/RewardedAdReward.d.ts +13 -0
  319. package/lib/typescript/validateAdRequestConfiguration.d.ts +2 -0
  320. package/lib/typescript/validateAdRequestOptions.d.ts +2 -0
  321. package/lib/typescript/validateAdShowOptions.d.ts +2 -0
  322. package/lib/typescript/version.d.ts +1 -0
  323. package/package.json +143 -0
  324. package/react-native.config.js +19 -0
  325. package/src/AdEventType.ts +68 -0
  326. package/src/AdsConsent.ts +191 -0
  327. package/src/AdsConsentDebugGeography.ts +38 -0
  328. package/src/AdsConsentStatus.ts +36 -0
  329. package/src/BannerAdSize.ts +59 -0
  330. package/src/MaxAdContentRating.ts +38 -0
  331. package/src/MobileAds.ts +84 -0
  332. package/src/RewardedAdEventType.ts +64 -0
  333. package/src/TestIds.ts +39 -0
  334. package/src/ads/AppOpenAd.ts +85 -0
  335. package/src/ads/BannerAd.tsx +126 -0
  336. package/src/ads/InterstitialAd.ts +156 -0
  337. package/src/ads/MobileAd.ts +101 -0
  338. package/src/ads/RewardedAd.ts +161 -0
  339. package/src/common/Base64.ts +114 -0
  340. package/src/common/MutatableParams.ts +50 -0
  341. package/src/common/ReferenceBase.ts +45 -0
  342. package/src/common/deeps.ts +88 -0
  343. package/src/common/id.ts +74 -0
  344. package/src/common/index.ts +103 -0
  345. package/src/common/path.ts +114 -0
  346. package/src/common/promise.ts +66 -0
  347. package/src/common/serialize.ts +43 -0
  348. package/src/common/validate.ts +205 -0
  349. package/src/declarations.d.ts +3 -0
  350. package/src/index.ts +35 -0
  351. package/src/internal/GoogleMobileAdsNativeEventEmitter.ts +81 -0
  352. package/src/internal/Module.ts +58 -0
  353. package/src/internal/NativeError.ts +56 -0
  354. package/src/internal/SharedEventEmitter.ts +22 -0
  355. package/src/internal/constants.ts +43 -0
  356. package/src/internal/index.ts +21 -0
  357. package/src/internal/registry/nativeModule.ts +226 -0
  358. package/src/types/AdEventListener.ts +16 -0
  359. package/src/types/AdShowOptions.ts +12 -0
  360. package/src/types/AdapterStatus.ts +20 -0
  361. package/src/types/AdsConsent.interface.ts +306 -0
  362. package/src/types/BannerAdProps.ts +73 -0
  363. package/src/types/GoogleMobileAdsNativeModule.ts +15 -0
  364. package/src/types/MobileAd.interface.ts +69 -0
  365. package/src/types/MobileAdsModule.interface.ts +43 -0
  366. package/src/types/Module.interface.ts +16 -0
  367. package/src/types/RequestConfiguration.ts +40 -0
  368. package/src/types/RequestOptions.ts +113 -0
  369. package/src/types/RewardedAdReward.ts +14 -0
  370. package/src/validateAdRequestConfiguration.ts +71 -0
  371. package/src/validateAdRequestOptions.ts +168 -0
  372. package/src/validateAdShowOptions.ts +41 -0
  373. package/src/version.ts +2 -0
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["SharedEventEmitter.ts"],"names":["SharedEventEmitter","Emitter"],"mappings":";;;;;;;AAkBA;;;;AAlBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAIO,MAAMA,kBAAgC,GAAG,IAAIC,qBAAJ,EAAzC","sourcesContent":["/*\n * Copyright (c) 2016-present Invertase Limited & Contributors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this library except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\n\n// @ts-ignore: Could not find a declaration file\nimport Emitter from 'react-native/Libraries/vendor/emitter/EventEmitter';\nimport { EventEmitter } from 'react-native';\n\nexport const SharedEventEmitter: EventEmitter = new Emitter();\n"]}
@@ -0,0 +1,30 @@
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
@@ -0,0 +1 @@
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"]}
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _exportNames = {
7
+ Module: true,
8
+ NativeError: true,
9
+ SharedEventEmitter: true
10
+ };
11
+ Object.defineProperty(exports, "Module", {
12
+ enumerable: true,
13
+ get: function () {
14
+ return _Module.AppModule;
15
+ }
16
+ });
17
+ Object.defineProperty(exports, "NativeError", {
18
+ enumerable: true,
19
+ get: function () {
20
+ return _NativeError.NativeError;
21
+ }
22
+ });
23
+ Object.defineProperty(exports, "SharedEventEmitter", {
24
+ enumerable: true,
25
+ get: function () {
26
+ return _SharedEventEmitter.SharedEventEmitter;
27
+ }
28
+ });
29
+
30
+ var _Module = require("./Module");
31
+
32
+ var _NativeError = require("./NativeError");
33
+
34
+ var _nativeModule = require("./registry/nativeModule");
35
+
36
+ Object.keys(_nativeModule).forEach(function (key) {
37
+ if (key === "default" || key === "__esModule") return;
38
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
39
+ if (key in exports && exports[key] === _nativeModule[key]) return;
40
+ Object.defineProperty(exports, key, {
41
+ enumerable: true,
42
+ get: function () {
43
+ return _nativeModule[key];
44
+ }
45
+ });
46
+ });
47
+
48
+ var _SharedEventEmitter = require("./SharedEventEmitter");
49
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiBA;;AACA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA","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 { AppModule as Module } from './Module';\nexport { NativeError } from './NativeError';\nexport * from './registry/nativeModule';\nexport { SharedEventEmitter } from './SharedEventEmitter';\n"]}
@@ -0,0 +1,231 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.getAppModule = getAppModule;
7
+ exports.getNativeModule = getNativeModule;
8
+
9
+ var _reactNative = require("react-native");
10
+
11
+ var _constants = require("../constants");
12
+
13
+ var _NativeError = require("../NativeError");
14
+
15
+ var _GoogleMobileAdsNativeEventEmitter = require("../GoogleMobileAdsNativeEventEmitter");
16
+
17
+ var _SharedEventEmitter = require("../SharedEventEmitter");
18
+
19
+ var _common = require("../../common");
20
+
21
+ /*
22
+ * Copyright (c) 2016-present Invertase Limited & Contributors
23
+ *
24
+ * Licensed under the Apache License, Version 2.0 (the "License");
25
+ * you may not use this library except in compliance with the License.
26
+ * You may obtain a copy of the License at
27
+ *
28
+ * http://www.apache.org/licenses/LICENSE-2.0
29
+ *
30
+ * Unless required by applicable law or agreed to in writing, software
31
+ * distributed under the License is distributed on an "AS IS" BASIS,
32
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
33
+ * See the License for the specific language governing permissions and
34
+ * limitations under the License.
35
+ *
36
+ */
37
+ const NATIVE_MODULE_REGISTRY = {};
38
+ const NATIVE_MODULE_EVENT_SUBSCRIPTIONS = {};
39
+
40
+ function nativeModuleKey(module) {
41
+ return `${module._customUrlOrRegion || ''}:${module.app.name}:${module._config.namespace}`;
42
+ }
43
+ /**
44
+ * Wraps a native module method to provide
45
+ * auto prepended args and custom Error classes.
46
+ *
47
+ * @param namespace
48
+ * @param method
49
+ * @param argToPrepend
50
+ * @returns {Function}
51
+ */
52
+
53
+
54
+ function nativeModuleMethodWrapped(namespace, method, argToPrepend) {
55
+ return function () {
56
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
57
+ args[_key] = arguments[_key];
58
+ }
59
+
60
+ const possiblePromise = method(...[...argToPrepend, ...args]);
61
+
62
+ if (possiblePromise && possiblePromise.then) {
63
+ const jsStack = new Error().stack || '';
64
+ return possiblePromise.catch(nativeError => Promise.reject(new _NativeError.NativeError(nativeError, jsStack, namespace)));
65
+ }
66
+
67
+ return possiblePromise;
68
+ };
69
+ }
70
+ /**
71
+ * Prepends all arguments in prependArgs to all native method calls
72
+ *
73
+ * @param namespace
74
+ * @param NativeModule
75
+ * @param argToPrepend
76
+ */
77
+
78
+
79
+ function nativeModuleWrapped(namespace, NativeModule, argToPrepend) {
80
+ const native = {};
81
+
82
+ if (!NativeModule) {
83
+ return NativeModule;
84
+ }
85
+
86
+ const properties = Object.keys(NativeModule);
87
+
88
+ for (let i = 0, len = properties.length; i < len; i++) {
89
+ const property = properties[i];
90
+
91
+ if ((0, _common.isFunction)(NativeModule[property])) {
92
+ native[property] = nativeModuleMethodWrapped(namespace, NativeModule[property], argToPrepend);
93
+ } else {
94
+ native[property] = NativeModule[property];
95
+ }
96
+ }
97
+
98
+ return native;
99
+ }
100
+ /**
101
+ * Initialises and wraps all the native module methods.
102
+ *
103
+ * @param module
104
+ * @returns {*}
105
+ */
106
+
107
+
108
+ function initialiseNativeModule(module) {
109
+ const config = module._config;
110
+ const key = nativeModuleKey(module);
111
+ const {
112
+ namespace,
113
+ nativeEvents,
114
+ nativeModuleName
115
+ } = config;
116
+ const multiModuleRoot = {};
117
+ const multiModule = Array.isArray(nativeModuleName);
118
+ const nativeModuleNames = multiModule ? nativeModuleName : [nativeModuleName];
119
+
120
+ for (let i = 0; i < nativeModuleNames.length; i++) {
121
+ const nativeModule = _reactNative.NativeModules[nativeModuleNames[i]]; // only error if there's a single native module
122
+ // as multi modules can mean some are optional
123
+
124
+ if (!multiModule && !nativeModule) {
125
+ throw new Error(getMissingModuleHelpText(namespace));
126
+ }
127
+
128
+ if (multiModule) {
129
+ multiModuleRoot[nativeModuleNames[i]] = !!nativeModule;
130
+ }
131
+
132
+ Object.assign(multiModuleRoot, nativeModuleWrapped(namespace, nativeModule, []));
133
+ }
134
+
135
+ if (nativeEvents && nativeEvents.length) {
136
+ for (let i = 0, len = nativeEvents.length; i < len; i++) {
137
+ subscribeToNativeModuleEvent(nativeEvents[i]);
138
+ }
139
+ }
140
+
141
+ Object.freeze(multiModuleRoot);
142
+ NATIVE_MODULE_REGISTRY[key] = multiModuleRoot;
143
+ return NATIVE_MODULE_REGISTRY[key];
144
+ }
145
+ /**
146
+ * Subscribe to a native event for js side distribution by appName
147
+ * React Native events are hard set at compile - cant do dynamic event names
148
+ * so we use a single event send it to js and js then internally can prefix it
149
+ * and distribute dynamically.
150
+ *
151
+ * @param eventName
152
+ * @private
153
+ */
154
+
155
+
156
+ function subscribeToNativeModuleEvent(eventName) {
157
+ if (!NATIVE_MODULE_EVENT_SUBSCRIPTIONS[eventName]) {
158
+ _GoogleMobileAdsNativeEventEmitter.GoogleMobileAdsNativeEventEmitter.addListener(eventName, event => {
159
+ if (event.appName) {
160
+ // native event has an appName property - auto prefix and internally emit
161
+ _SharedEventEmitter.SharedEventEmitter.emit(`${event.appName}-${eventName}`, event);
162
+ } else {
163
+ // standard event - no need to prefix
164
+ _SharedEventEmitter.SharedEventEmitter.emit(eventName, event);
165
+ }
166
+ });
167
+
168
+ NATIVE_MODULE_EVENT_SUBSCRIPTIONS[eventName] = true;
169
+ }
170
+ }
171
+ /**
172
+ * Help text for integrating the native counter parts for each module.
173
+ *
174
+ * @param namespace
175
+ * @returns {string}
176
+ */
177
+
178
+
179
+ function getMissingModuleHelpText(namespace) {
180
+ const snippet = `${namespace}()`;
181
+ const nativeModule = namespace.charAt(0).toUpperCase() + namespace.slice(1);
182
+
183
+ if (_reactNative.Platform.OS === 'ios') {
184
+ return `You attempted to use a module that's not installed natively on your iOS project by calling ${snippet}.` + '\r\n\r\nEnsure you have either linked the module or added it to your projects Podfile.' + '\r\n\r\nSee http://invertase.link/ios for full setup instructions.';
185
+ }
186
+
187
+ const rnPackage = `'io.invertase.${namespace}.ReactNative${nativeModule}Package'`;
188
+ const newInstance = `'new ReactNative${nativeModule}Package()'`;
189
+ return `You attempted to use a module that's not installed on your Android project by calling ${snippet}.` + `\r\n\r\nEnsure you have:\r\n\r\n1) imported the ${rnPackage} module in your 'MainApplication.java' file.\r\n\r\n2) Added the ` + `${newInstance} line inside of the RN 'getPackages()' method list.` + '\r\n\r\nSee http://invertase.link/android for full setup instructions.';
190
+ }
191
+ /**
192
+ * Gets a wrapped native module instance for the provided module.
193
+ * Will attempt to create a new instance if non previously created.
194
+ *
195
+ * @param module
196
+ * @returns {*}
197
+ */
198
+
199
+
200
+ function getNativeModule(module) {
201
+ const key = nativeModuleKey(module);
202
+
203
+ if (NATIVE_MODULE_REGISTRY[key]) {
204
+ return NATIVE_MODULE_REGISTRY[key];
205
+ }
206
+
207
+ return initialiseNativeModule(module);
208
+ }
209
+ /**
210
+ * Custom wrapped app module as it does not have it's own FirebaseModule based class.
211
+ *
212
+ * @returns {*}
213
+ */
214
+
215
+
216
+ function getAppModule() {
217
+ if (NATIVE_MODULE_REGISTRY[_constants.APP_NATIVE_MODULE]) {
218
+ return NATIVE_MODULE_REGISTRY[_constants.APP_NATIVE_MODULE];
219
+ }
220
+
221
+ const namespace = 'app';
222
+ const nativeModule = _reactNative.NativeModules[_constants.APP_NATIVE_MODULE];
223
+
224
+ if (!nativeModule) {
225
+ throw new Error(getMissingModuleHelpText(namespace));
226
+ }
227
+
228
+ NATIVE_MODULE_REGISTRY[_constants.APP_NATIVE_MODULE] = nativeModuleWrapped(namespace, nativeModule, []);
229
+ return NATIVE_MODULE_REGISTRY[_constants.APP_NATIVE_MODULE];
230
+ }
231
+ //# sourceMappingURL=nativeModule.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["nativeModule.ts"],"names":["NATIVE_MODULE_REGISTRY","NATIVE_MODULE_EVENT_SUBSCRIPTIONS","nativeModuleKey","module","_customUrlOrRegion","app","name","_config","namespace","nativeModuleMethodWrapped","method","argToPrepend","args","possiblePromise","then","jsStack","Error","stack","catch","nativeError","Promise","reject","NativeError","nativeModuleWrapped","NativeModule","native","properties","Object","keys","i","len","length","property","initialiseNativeModule","config","key","nativeEvents","nativeModuleName","multiModuleRoot","multiModule","Array","isArray","nativeModuleNames","nativeModule","NativeModules","getMissingModuleHelpText","assign","subscribeToNativeModuleEvent","freeze","eventName","GoogleMobileAdsNativeEventEmitter","addListener","event","appName","SharedEventEmitter","emit","snippet","charAt","toUpperCase","slice","Platform","OS","rnPackage","newInstance","getNativeModule","getAppModule","APP_NATIVE_MODULE"],"mappings":"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","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 { NativeModules, Platform } from 'react-native';\nimport { APP_NATIVE_MODULE } from '../constants';\nimport { NativeError } from '../NativeError';\nimport { GoogleMobileAdsNativeEventEmitter } from '../GoogleMobileAdsNativeEventEmitter';\nimport { SharedEventEmitter } from '../SharedEventEmitter';\nimport { isFunction } from '../../common';\nimport { ModuleInterface } from '../../types/Module.interface';\n\nconst NATIVE_MODULE_REGISTRY: Record<string, unknown> = {};\nconst NATIVE_MODULE_EVENT_SUBSCRIPTIONS: Record<string, unknown> = {};\n\nfunction nativeModuleKey(module: ModuleInterface) {\n return `${module._customUrlOrRegion || ''}:${module.app.name}:${module._config.namespace}`;\n}\n\n/**\n * Wraps a native module method to provide\n * auto prepended args and custom Error classes.\n *\n * @param namespace\n * @param method\n * @param argToPrepend\n * @returns {Function}\n */\nfunction nativeModuleMethodWrapped(\n namespace: string,\n method: (...args: unknown[]) => Promise<unknown> | void,\n argToPrepend: [],\n) {\n return (...args: []) => {\n const possiblePromise = method(...[...argToPrepend, ...args]);\n\n if (possiblePromise && possiblePromise.then) {\n const jsStack = new Error().stack || '';\n return possiblePromise.catch(nativeError =>\n Promise.reject(new NativeError(nativeError, jsStack, namespace)),\n );\n }\n\n return possiblePromise;\n };\n}\n\n/**\n * Prepends all arguments in prependArgs to all native method calls\n *\n * @param namespace\n * @param NativeModule\n * @param argToPrepend\n */\nfunction nativeModuleWrapped(\n namespace: string,\n NativeModule: Record<string, (...args: unknown[]) => Promise<unknown> | void>,\n argToPrepend: [],\n) {\n const native: Record<string, unknown> = {};\n if (!NativeModule) {\n return NativeModule;\n }\n\n const properties = Object.keys(NativeModule);\n\n for (let i = 0, len = properties.length; i < len; i++) {\n const property = properties[i];\n if (isFunction(NativeModule[property])) {\n native[property] = nativeModuleMethodWrapped(namespace, NativeModule[property], argToPrepend);\n } else {\n native[property] = NativeModule[property];\n }\n }\n\n return native;\n}\n\n/**\n * Initialises and wraps all the native module methods.\n *\n * @param module\n * @returns {*}\n */\nfunction initialiseNativeModule(module: ModuleInterface) {\n const config = module._config;\n const key = nativeModuleKey(module);\n const { namespace, nativeEvents, nativeModuleName } = config;\n const multiModuleRoot: Record<string, unknown> = {};\n const multiModule = Array.isArray(nativeModuleName);\n const nativeModuleNames = multiModule ? nativeModuleName : [nativeModuleName];\n\n for (let i = 0; i < nativeModuleNames.length; i++) {\n const nativeModule = NativeModules[nativeModuleNames[i]];\n\n // only error if there's a single native module\n // as multi modules can mean some are optional\n if (!multiModule && !nativeModule) {\n throw new Error(getMissingModuleHelpText(namespace));\n }\n\n if (multiModule) {\n multiModuleRoot[nativeModuleNames[i]] = !!nativeModule;\n }\n\n Object.assign(multiModuleRoot, nativeModuleWrapped(namespace, nativeModule, []));\n }\n\n if (nativeEvents && nativeEvents.length) {\n for (let i = 0, len = nativeEvents.length; i < len; i++) {\n subscribeToNativeModuleEvent(nativeEvents[i]);\n }\n }\n\n Object.freeze(multiModuleRoot);\n\n NATIVE_MODULE_REGISTRY[key] = multiModuleRoot;\n\n return NATIVE_MODULE_REGISTRY[key];\n}\n\n/**\n * Subscribe to a native event for js side distribution by appName\n * React Native events are hard set at compile - cant do dynamic event names\n * so we use a single event send it to js and js then internally can prefix it\n * and distribute dynamically.\n *\n * @param eventName\n * @private\n */\nfunction subscribeToNativeModuleEvent(eventName: string) {\n if (!NATIVE_MODULE_EVENT_SUBSCRIPTIONS[eventName]) {\n GoogleMobileAdsNativeEventEmitter.addListener(eventName, event => {\n if (event.appName) {\n // native event has an appName property - auto prefix and internally emit\n SharedEventEmitter.emit(`${event.appName}-${eventName}`, event);\n } else {\n // standard event - no need to prefix\n SharedEventEmitter.emit(eventName, event);\n }\n });\n\n NATIVE_MODULE_EVENT_SUBSCRIPTIONS[eventName] = true;\n }\n}\n\n/**\n * Help text for integrating the native counter parts for each module.\n *\n * @param namespace\n * @returns {string}\n */\nfunction getMissingModuleHelpText(namespace: string) {\n const snippet = `${namespace}()`;\n const nativeModule = namespace.charAt(0).toUpperCase() + namespace.slice(1);\n\n if (Platform.OS === 'ios') {\n return (\n `You attempted to use a module that's not installed natively on your iOS project by calling ${snippet}.` +\n '\\r\\n\\r\\nEnsure you have either linked the module or added it to your projects Podfile.' +\n '\\r\\n\\r\\nSee http://invertase.link/ios for full setup instructions.'\n );\n }\n\n const rnPackage = `'io.invertase.${namespace}.ReactNative${nativeModule}Package'`;\n const newInstance = `'new ReactNative${nativeModule}Package()'`;\n\n return (\n `You attempted to use a module that's not installed on your Android project by calling ${snippet}.` +\n `\\r\\n\\r\\nEnsure you have:\\r\\n\\r\\n1) imported the ${rnPackage} module in your 'MainApplication.java' file.\\r\\n\\r\\n2) Added the ` +\n `${newInstance} line inside of the RN 'getPackages()' method list.` +\n '\\r\\n\\r\\nSee http://invertase.link/android for full setup instructions.'\n );\n}\n\n/**\n * Gets a wrapped native module instance for the provided module.\n * Will attempt to create a new instance if non previously created.\n *\n * @param module\n * @returns {*}\n */\nexport function getNativeModule(module: ModuleInterface) {\n const key = nativeModuleKey(module);\n\n if (NATIVE_MODULE_REGISTRY[key]) {\n return NATIVE_MODULE_REGISTRY[key];\n }\n\n return initialiseNativeModule(module);\n}\n\n/**\n * Custom wrapped app module as it does not have it's own FirebaseModule based class.\n *\n * @returns {*}\n */\nexport function getAppModule() {\n if (NATIVE_MODULE_REGISTRY[APP_NATIVE_MODULE]) {\n return NATIVE_MODULE_REGISTRY[APP_NATIVE_MODULE];\n }\n\n const namespace = 'app';\n const nativeModule = NativeModules[APP_NATIVE_MODULE];\n\n if (!nativeModule) {\n throw new Error(getMissingModuleHelpText(namespace));\n }\n\n NATIVE_MODULE_REGISTRY[APP_NATIVE_MODULE] = nativeModuleWrapped(namespace, nativeModule, []);\n\n return NATIVE_MODULE_REGISTRY[APP_NATIVE_MODULE];\n}\n"]}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ //# sourceMappingURL=AdEventListener.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ //# sourceMappingURL=AdShowOptions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.InitializationState = void 0;
7
+ let InitializationState;
8
+ /**
9
+ * An immutable snapshot of a mediation adapter's initialization status.
10
+ */
11
+
12
+ exports.InitializationState = InitializationState;
13
+
14
+ (function (InitializationState) {
15
+ InitializationState[InitializationState["AdapterInitializationStateNotReady"] = 0] = "AdapterInitializationStateNotReady";
16
+ InitializationState[InitializationState["AdapterInitializationStateReady"] = 1] = "AdapterInitializationStateReady";
17
+ })(InitializationState || (exports.InitializationState = InitializationState = {}));
18
+ //# sourceMappingURL=AdapterStatus.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["AdapterStatus.ts"],"names":["InitializationState"],"mappings":";;;;;;IAAYA,mB;AAYZ;AACA;AACA;;;;WAdYA,mB;AAAAA,EAAAA,mB,CAAAA,mB;AAAAA,EAAAA,mB,CAAAA,mB;GAAAA,mB,mCAAAA,mB","sourcesContent":["export enum InitializationState {\n /**\n * The mediation adapter is less likely to fill ad requests.\n */\n AdapterInitializationStateNotReady = 0,\n\n /**\n * The mediation adapter is ready to service ad requests.\n */\n AdapterInitializationStateReady = 1,\n}\n\n/**\n * An immutable snapshot of a mediation adapter's initialization status.\n */\nexport type AdapterStatus = {\n name: string;\n description: string;\n status: InitializationState;\n};\n"]}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ //# sourceMappingURL=AdsConsent.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ //# sourceMappingURL=BannerAdProps.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ //# sourceMappingURL=GoogleMobileAdsNativeModule.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ //# sourceMappingURL=MobileAd.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ //# sourceMappingURL=MobileAdsModule.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ //# sourceMappingURL=Module.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ //# sourceMappingURL=RequestConfiguration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ //# sourceMappingURL=RequestOptions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ //# sourceMappingURL=RewardedAdReward.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
@@ -0,0 +1,69 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.validateAdRequestConfiguration = validateAdRequestConfiguration;
7
+
8
+ var _common = require("./common");
9
+
10
+ var _MaxAdContentRating = require("./MaxAdContentRating");
11
+
12
+ /*
13
+ * Copyright (c) 2016-present Invertase Limited & Contributors
14
+ *
15
+ * Licensed under the Apache License, Version 2.0 (the "License");
16
+ * you may not use this library except in compliance with the License.
17
+ * You may obtain a copy of the License at
18
+ *
19
+ * http://www.apache.org/licenses/LICENSE-2.0
20
+ *
21
+ * Unless required by applicable law or agreed to in writing, software
22
+ * distributed under the License is distributed on an "AS IS" BASIS,
23
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
24
+ * See the License for the specific language governing permissions and
25
+ * limitations under the License.
26
+ *
27
+ */
28
+ function validateAdRequestConfiguration(requestConfiguration) {
29
+ const out = {};
30
+
31
+ if (!(0, _common.isObject)(requestConfiguration)) {
32
+ throw new Error("'requestConfiguration' expected an object value");
33
+ }
34
+
35
+ if (requestConfiguration.maxAdContentRating) {
36
+ if (requestConfiguration.maxAdContentRating !== _MaxAdContentRating.MaxAdContentRating.G && requestConfiguration.maxAdContentRating !== _MaxAdContentRating.MaxAdContentRating.PG && requestConfiguration.maxAdContentRating !== _MaxAdContentRating.MaxAdContentRating.T && requestConfiguration.maxAdContentRating !== _MaxAdContentRating.MaxAdContentRating.MA) {
37
+ throw new Error("'requestConfiguration.maxAdContentRating' expected on of MaxAdContentRating.G, MaxAdContentRating.PG, MaxAdContentRating.T or MaxAdContentRating.MA");
38
+ }
39
+
40
+ out.maxAdContentRating = requestConfiguration.maxAdContentRating;
41
+ }
42
+
43
+ if ((0, _common.hasOwnProperty)(requestConfiguration, 'tagForChildDirectedTreatment')) {
44
+ if (!(0, _common.isBoolean)(requestConfiguration.tagForChildDirectedTreatment)) {
45
+ throw new Error("'requestConfiguration.tagForChildDirectedTreatment' expected a boolean value");
46
+ }
47
+
48
+ out.tagForChildDirectedTreatment = requestConfiguration.tagForChildDirectedTreatment;
49
+ }
50
+
51
+ if ((0, _common.hasOwnProperty)(requestConfiguration, 'tagForUnderAgeOfConsent')) {
52
+ if (!(0, _common.isBoolean)(requestConfiguration.tagForUnderAgeOfConsent)) {
53
+ throw new Error("'requestConfiguration.tagForUnderAgeOfConsent' expected a boolean value");
54
+ }
55
+
56
+ out.tagForUnderAgeOfConsent = requestConfiguration.tagForUnderAgeOfConsent;
57
+ }
58
+
59
+ if ((0, _common.hasOwnProperty)(requestConfiguration, 'testDeviceIdentifiers')) {
60
+ if (!(0, _common.isArray)(requestConfiguration.testDeviceIdentifiers)) {
61
+ throw new Error("'requestConfiguration.testDeviceIdentifiers' expected an array value");
62
+ }
63
+
64
+ out.testDeviceIdentifiers = requestConfiguration.testDeviceIdentifiers;
65
+ }
66
+
67
+ return out;
68
+ }
69
+ //# sourceMappingURL=validateAdRequestConfiguration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["validateAdRequestConfiguration.ts"],"names":["validateAdRequestConfiguration","requestConfiguration","out","Error","maxAdContentRating","MaxAdContentRating","G","PG","T","MA","tagForChildDirectedTreatment","tagForUnderAgeOfConsent","testDeviceIdentifiers"],"mappings":";;;;;;;AAiBA;;AACA;;AAlBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAMO,SAASA,8BAAT,CAAwCC,oBAAxC,EAAoF;AACzF,QAAMC,GAAyB,GAAG,EAAlC;;AAEA,MAAI,CAAC,sBAASD,oBAAT,CAAL,EAAqC;AACnC,UAAM,IAAIE,KAAJ,CAAU,iDAAV,CAAN;AACD;;AAED,MAAIF,oBAAoB,CAACG,kBAAzB,EAA6C;AAC3C,QACEH,oBAAoB,CAACG,kBAArB,KAA4CC,uCAAmBC,CAA/D,IACAL,oBAAoB,CAACG,kBAArB,KAA4CC,uCAAmBE,EAD/D,IAEAN,oBAAoB,CAACG,kBAArB,KAA4CC,uCAAmBG,CAF/D,IAGAP,oBAAoB,CAACG,kBAArB,KAA4CC,uCAAmBI,EAJjE,EAKE;AACA,YAAM,IAAIN,KAAJ,CACJ,qJADI,CAAN;AAGD;;AAEDD,IAAAA,GAAG,CAACE,kBAAJ,GAAyBH,oBAAoB,CAACG,kBAA9C;AACD;;AAED,MAAI,4BAAeH,oBAAf,EAAqC,8BAArC,CAAJ,EAA0E;AACxE,QAAI,CAAC,uBAAUA,oBAAoB,CAACS,4BAA/B,CAAL,EAAmE;AACjE,YAAM,IAAIP,KAAJ,CACJ,8EADI,CAAN;AAGD;;AAEDD,IAAAA,GAAG,CAACQ,4BAAJ,GAAmCT,oBAAoB,CAACS,4BAAxD;AACD;;AAED,MAAI,4BAAeT,oBAAf,EAAqC,yBAArC,CAAJ,EAAqE;AACnE,QAAI,CAAC,uBAAUA,oBAAoB,CAACU,uBAA/B,CAAL,EAA8D;AAC5D,YAAM,IAAIR,KAAJ,CAAU,yEAAV,CAAN;AACD;;AAEDD,IAAAA,GAAG,CAACS,uBAAJ,GAA8BV,oBAAoB,CAACU,uBAAnD;AACD;;AAED,MAAI,4BAAeV,oBAAf,EAAqC,uBAArC,CAAJ,EAAmE;AACjE,QAAI,CAAC,qBAAQA,oBAAoB,CAACW,qBAA7B,CAAL,EAA0D;AACxD,YAAM,IAAIT,KAAJ,CAAU,sEAAV,CAAN;AACD;;AAEDD,IAAAA,GAAG,CAACU,qBAAJ,GAA4BX,oBAAoB,CAACW,qBAAjD;AACD;;AAED,SAAOV,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 { hasOwnProperty, 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 (hasOwnProperty(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 (hasOwnProperty(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 (hasOwnProperty(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"]}