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,158 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.validateAdRequestOptions = validateAdRequestOptions;
7
+
8
+ var _common = require("./common");
9
+
10
+ /*
11
+ * Copyright (c) 2016-present Invertase Limited & Contributors
12
+ *
13
+ * Licensed under the Apache License, Version 2.0 (the "License");
14
+ * you may not use this library except in compliance with the License.
15
+ * You may obtain a copy of the License at
16
+ *
17
+ * http://www.apache.org/licenses/LICENSE-2.0
18
+ *
19
+ * Unless required by applicable law or agreed to in writing, software
20
+ * distributed under the License is distributed on an "AS IS" BASIS,
21
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22
+ * See the License for the specific language governing permissions and
23
+ * limitations under the License.
24
+ *
25
+ */
26
+ function validateAdRequestOptions(options) {
27
+ const out = {};
28
+
29
+ if ((0, _common.isUndefined)(options)) {
30
+ return out;
31
+ }
32
+
33
+ if (!(0, _common.isObject)(options)) {
34
+ throw new Error("'options' expected an object value");
35
+ }
36
+
37
+ if ((0, _common.hasOwnProperty)(options, 'requestNonPersonalizedAdsOnly')) {
38
+ if (!(0, _common.isBoolean)(options.requestNonPersonalizedAdsOnly)) {
39
+ throw new Error("'options.requestNonPersonalizedAdsOnly' expected a boolean value");
40
+ }
41
+
42
+ out.requestNonPersonalizedAdsOnly = options.requestNonPersonalizedAdsOnly;
43
+ }
44
+
45
+ if (options.networkExtras) {
46
+ if (!(0, _common.isObject)(options.networkExtras)) {
47
+ throw new Error("'options.networkExtras' expected an object of key/value pairs");
48
+ }
49
+
50
+ Object.entries(options.networkExtras).forEach(_ref => {
51
+ let [key, value] = _ref;
52
+
53
+ if (!(0, _common.isString)(value)) {
54
+ throw new Error(`'options.networkExtras' expected a string value for object key "${key}"`);
55
+ }
56
+ });
57
+ out.networkExtras = options.networkExtras;
58
+ }
59
+
60
+ if (options.keywords) {
61
+ if (!(0, _common.isArray)(options.keywords)) {
62
+ throw new Error("'options.keywords' expected an array containing string values");
63
+ }
64
+
65
+ for (let i = 0; i < options.keywords.length; i++) {
66
+ const keyword = options.keywords[i];
67
+
68
+ if (!(0, _common.isString)(keyword)) {
69
+ throw new Error("'options.keywords' expected an array containing string values");
70
+ }
71
+ }
72
+
73
+ out.keywords = options.keywords;
74
+ }
75
+
76
+ if (options.contentUrl) {
77
+ if (!(0, _common.isString)(options.contentUrl)) {
78
+ throw new Error("'options.contentUrl' expected a string value");
79
+ }
80
+
81
+ if (!(0, _common.isValidUrl)(options.contentUrl)) {
82
+ throw new Error("'options.contentUrl' expected a valid HTTP or HTTPS url.");
83
+ }
84
+
85
+ if (options.contentUrl.length > 512) {
86
+ throw new Error("'options.contentUrl' maximum length of a content URL is 512 characters.");
87
+ }
88
+
89
+ out.contentUrl = options.contentUrl;
90
+ }
91
+
92
+ if (options.location) {
93
+ const error = new Error("'options.location' expected an array value containing a latitude & longitude number value.");
94
+
95
+ if (!(0, _common.isArray)(options.location)) {
96
+ throw error;
97
+ }
98
+
99
+ const [latitude, longitude] = options.location;
100
+
101
+ if (!(0, _common.isNumber)(latitude) || !(0, _common.isNumber)(longitude)) {
102
+ throw error;
103
+ }
104
+
105
+ if (latitude < -90 || latitude > 90) {
106
+ throw new Error(`'options.location' latitude value must be a number between -90 and 90, but was: ${latitude}`);
107
+ }
108
+
109
+ if (longitude < -180 || longitude > 180) {
110
+ throw new Error(`'options.location' longitude value must be a number between -180 and 180, but was: ${latitude}`);
111
+ }
112
+
113
+ out.location = [latitude, longitude];
114
+ }
115
+
116
+ if ((0, _common.hasOwnProperty)(options, 'locationAccuracy')) {
117
+ if (!(0, _common.isNumber)(options.locationAccuracy)) {
118
+ throw new Error("'options.locationAccuracy' expected a number value.");
119
+ }
120
+
121
+ if ((0, _common.isNumber)(options.locationAccuracy) && options.locationAccuracy < 0) {
122
+ throw new Error("'options.locationAccuracy' expected a number greater than 0.");
123
+ }
124
+
125
+ out.locationAccuracy = options.locationAccuracy;
126
+ } else {
127
+ out.locationAccuracy = 5;
128
+ }
129
+
130
+ if (options.requestAgent) {
131
+ if (!(0, _common.isString)(options.requestAgent)) {
132
+ throw new Error("'options.requestAgent' expected a string value");
133
+ }
134
+
135
+ out.requestAgent = options.requestAgent;
136
+ }
137
+
138
+ if (options.serverSideVerificationOptions) {
139
+ if (!(0, _common.isObject)(options.serverSideVerificationOptions)) {
140
+ throw new Error("'options.serverSideVerificationOptions' expected an object of key/value pairs");
141
+ }
142
+
143
+ const ssvOptions = options.serverSideVerificationOptions;
144
+
145
+ if (ssvOptions.userId && !(0, _common.isString)(ssvOptions.userId)) {
146
+ throw new Error("'options.serverSideVerificationOptions.userId' expected a string value");
147
+ }
148
+
149
+ if (ssvOptions.customData && !(0, _common.isString)(ssvOptions.customData)) {
150
+ throw new Error("'options.serverSideVerificationOptions.customData' expected a string value");
151
+ }
152
+
153
+ out.serverSideVerificationOptions = options.serverSideVerificationOptions;
154
+ }
155
+
156
+ return out;
157
+ }
158
+ //# sourceMappingURL=validateAdRequestOptions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["validateAdRequestOptions.ts"],"names":["validateAdRequestOptions","options","out","Error","requestNonPersonalizedAdsOnly","networkExtras","Object","entries","forEach","key","value","keywords","i","length","keyword","contentUrl","location","error","latitude","longitude","locationAccuracy","requestAgent","serverSideVerificationOptions","ssvOptions","userId","customData"],"mappings":";;;;;;;AAiBA;;AAjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAcO,SAASA,wBAAT,CAAkCC,OAAlC,EAA4D;AACjE,QAAMC,GAAmB,GAAG,EAA5B;;AAEA,MAAI,yBAAYD,OAAZ,CAAJ,EAA0B;AACxB,WAAOC,GAAP;AACD;;AAED,MAAI,CAAC,sBAASD,OAAT,CAAL,EAAwB;AACtB,UAAM,IAAIE,KAAJ,CAAU,oCAAV,CAAN;AACD;;AAED,MAAI,4BAAeF,OA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AyC;AACvC,YAAM,IAAIjB,KAAJ,CAAU,qDAAV,CAAN;AACD;;AAED,QAAI,sBAASF,OAAO,CAACmB,gBAAjB,KAAsCnB,OAAO,CAACmB,gBAAR,GAA2B,CAArE,EAAwE;AACtE,YAAM,IAAIjB,KAAJ,CAAU,8DAAV,CAAN;AACD;;AAEDD,IAAAA,GAAG,CAACkB,gBAAJ,GAAuBnB,OAAO,CAACmB,gBAA/B;AACD,GAVD,MAUO;AACLlB,IAAAA,GAAG,CAACkB,gBAAJ,GAAuB,CAAvB;AACD;;AAED,MAAInB,OAAO,CAACoB,YAAZ,EAA0B;AACxB,QAAI,CAAC,sBAASpB,OAAO,CAACoB,YAAjB,CAAL,EAAqC;AACnC,YAAM,IAAIlB,KAAJ,CAAU,gDAAV,CAAN;AACD;;AAEDD,IAAAA,GAAG,CAACmB,YAAJ,GAAmBpB,OAAO,CAACoB,YAA3B;AACD;;AAED,MAAIpB,OAAO,CAACqB,6BAAZ,EAA2C;AACzC,QAAI,CAAC,sBAASrB,OAAO,CAACqB,6BAAjB,CAAL,EAAsD;AACpD,YAAM,IAAInB,KAAJ,CACJ,+EADI,CAAN;AAGD;;AAED,UAAMoB,UAAU,GAAGtB,OAAO,CAACqB,6BAA3B;;AAEA,QAAIC,UAAU,CAACC,MAAX,IAAqB,CAAC,sBAASD,UAAU,CAACC,MAApB,CAA1B,EAAuD;AACrD,YAAM,IAAIrB,KAAJ,CAAU,wEAAV,CAAN;AACD;;AAED,QAAIoB,UAAU,CAACE,UAAX,IAAyB,CAAC,sBAASF,UAAU,CAACE,UAApB,CAA9B,EAA+D;AAC7D,YAAM,IAAItB,KAAJ,CAAU,4EAAV,CAAN;AACD;;AAEDD,IAAAA,GAAG,CAACoB,6BAAJ,GAAoCrB,OAAO,CAACqB,6BAA5C;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 hasOwnProperty,\n isArray,\n isBoolean,\n isNumber,\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 (hasOwnProperty(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.location) {\n const error = new Error(\n \"'options.location' expected an array value containing a latitude & longitude number value.\",\n );\n\n if (!isArray(options.location)) {\n throw error;\n }\n\n const [latitude, longitude] = options.location;\n\n if (!isNumber(latitude) || !isNumber(longitude)) {\n throw error;\n }\n\n if (latitude < -90 || latitude > 90) {\n throw new Error(\n `'options.location' latitude value must be a number between -90 and 90, but was: ${latitude}`,\n );\n }\n\n if (longitude < -180 || longitude > 180) {\n throw new Error(\n `'options.location' longitude value must be a number between -180 and 180, but was: ${latitude}`,\n );\n }\n\n out.location = [latitude, longitude];\n }\n\n if (hasOwnProperty(options, 'locationAccuracy')) {\n if (!isNumber(options.locationAccuracy)) {\n throw new Error(\"'options.locationAccuracy' expected a number value.\");\n }\n\n if (isNumber(options.locationAccuracy) && options.locationAccuracy < 0) {\n throw new Error(\"'options.locationAccuracy' expected a number greater than 0.\");\n }\n\n out.locationAccuracy = options.locationAccuracy;\n } else {\n out.locationAccuracy = 5;\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 return out;\n}\n"]}
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.validateAdShowOptions = validateAdShowOptions;
7
+
8
+ var _common = require("./common");
9
+
10
+ /*
11
+ * Copyright (c) 2016-present Invertase Limited & Contributors
12
+ *
13
+ * Licensed under the Apache License, Version 2.0 (the "License");
14
+ * you may not use this library except in compliance with the License.
15
+ * You may obtain a copy of the License at
16
+ *
17
+ * http://www.apache.org/licenses/LICENSE-2.0
18
+ *
19
+ * Unless required by applicable law or agreed to in writing, software
20
+ * distributed under the License is distributed on an "AS IS" BASIS,
21
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22
+ * See the License for the specific language governing permissions and
23
+ * limitations under the License.
24
+ *
25
+ */
26
+ function validateAdShowOptions(options) {
27
+ const out = {};
28
+
29
+ if ((0, _common.isUndefined)(options)) {
30
+ return out;
31
+ }
32
+
33
+ if (!(0, _common.isObject)(options)) {
34
+ throw new Error("'options' expected an object value");
35
+ }
36
+
37
+ if ((0, _common.hasOwnProperty)(options, 'immersiveModeEnabled')) {
38
+ if (!(0, _common.isBoolean)(options.immersiveModeEnabled)) {
39
+ throw new Error("'options.immersiveModeEnabled' expected a boolean value");
40
+ }
41
+
42
+ out.immersiveModeEnabled = options.immersiveModeEnabled;
43
+ }
44
+
45
+ return out;
46
+ }
47
+ //# sourceMappingURL=validateAdShowOptions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["validateAdShowOptions.ts"],"names":["validateAdShowOptions","options","out","Error","immersiveModeEnabled"],"mappings":";;;;;;;AAiBA;;AAjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAKO,SAASA,qBAAT,CAA+BC,OAA/B,EAAwD;AAC7D,QAAMC,GAAkB,GAAG,EAA3B;;AAEA,MAAI,yBAAYD,OAAZ,CAAJ,EAA0B;AACxB,WAAOC,GAAP;AACD;;AAED,MAAI,CAAC,sBAASD,OAAT,CAAL,EAAwB;AACtB,UAAM,IAAIE,KAAJ,CAAU,oCAAV,CAAN;AACD;;AAED,MAAI,4BAAeF,OAAf,EAAwB,sBAAxB,CAAJ,EAAqD;AACnD,QAAI,CAAC,uBAAUA,OAAO,CAACG,oBAAlB,CAAL,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 { hasOwnProperty, 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 (hasOwnProperty(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"]}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.version = void 0;
7
+ // generated by genversion
8
+ const version = '4.1.0';
9
+ exports.version = version;
10
+ //# sourceMappingURL=version.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["version.ts"],"names":["version"],"mappings":";;;;;;AAAA;AACO,MAAMA,OAAO,GAAG,OAAhB","sourcesContent":["// generated by genversion\nexport const version = '4.1.0';\n"]}
@@ -0,0 +1,26 @@
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 let AdEventType;
18
+
19
+ (function (AdEventType) {
20
+ AdEventType["LOADED"] = "loaded";
21
+ AdEventType["ERROR"] = "error";
22
+ AdEventType["OPENED"] = "opened";
23
+ AdEventType["CLICKED"] = "clicked";
24
+ AdEventType["CLOSED"] = "closed";
25
+ })(AdEventType || (AdEventType = {}));
26
+ //# sourceMappingURL=AdEventType.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["AdEventType.ts"],"names":["AdEventType"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,WAAYA,WAAZ;;WAAYA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;GAAAA,W,KAAAA,W","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 enum AdEventType {\n /**\n * When an ad has loaded. At this point, the ad is ready to be shown to the user.\n *\n * #### Example\n *\n * ```js\n * import { AdEventType } from 'react-native-google-mobile-ads';\n *\n * advert.onAdEvent((type,error,data) => {\n * if (type === AdEventType.LOADED) {\n * advert.show();\n * }\n * });\n * ```\n */\n LOADED = 'loaded',\n\n /**\n * The ad has thrown an error. See the error parameter the listener callback for more information.\n *\n * #### Example\n *\n * ```js\n * import { AdEventType } from 'react-native-google-mobile-ads';\n *\n * advert.onAdEvent((type, error, data) => {\n * if (type === AdEventType.ERROR) {\n * console.log('Ad error:', error);\n * }\n * });\n * ```\n */\n ERROR = 'error',\n\n /**\n * The ad opened and is currently visible to the user. This event is fired after the `show()`\n * method has been called.\n */\n OPENED = 'opened',\n\n /**\n * The user clicked the advert.\n */\n CLICKED = 'clicked',\n\n /**\n * The user closed the ad and has returned back to your application.\n */\n CLOSED = 'closed',\n}\n"]}
@@ -0,0 +1,148 @@
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
+ import { hasOwnProperty, isArray, isBoolean, isObject, isString, isUndefined, isValidUrl } from './common';
18
+ import { NativeModules } from 'react-native';
19
+ import { AdsConsentDebugGeography } from './AdsConsentDebugGeography';
20
+ import { AdsConsentStatus } from './AdsConsentStatus';
21
+ const native = NativeModules.RNGoogleAdsConsentModule;
22
+ export const AdsConsent = {
23
+ /**
24
+ *
25
+ * @param publisherIds
26
+ * @returns {*}
27
+ */
28
+ requestInfoUpdate(publisherIds) {
29
+ if (!isArray(publisherIds)) {
30
+ throw new Error("AdsConsent.requestInfoUpdate(*) 'publisherIds' expected an array of string values.");
31
+ }
32
+
33
+ if (publisherIds.length === 0) {
34
+ throw new Error("AdsConsent.requestInfoUpdate(*) 'publisherIds' list of publisher IDs cannot be empty.");
35
+ }
36
+
37
+ for (let i = 0; i < publisherIds.length; i++) {
38
+ if (!isString(publisherIds[i])) {
39
+ throw new Error(`AdsConsent.requestInfoUpdate(*) 'publisherIds[${i}]' expected a string value.`);
40
+ }
41
+ }
42
+
43
+ return native.requestInfoUpdate(publisherIds);
44
+ },
45
+
46
+ /**
47
+ *
48
+ * @param options
49
+ * @returns {*}
50
+ */
51
+ showForm(options) {
52
+ if (!isUndefined(options) && !isObject(options)) {
53
+ throw new Error("AdsConsent.showForm(*) 'options' expected an object value.");
54
+ }
55
+
56
+ if (!isValidUrl(options.privacyPolicy)) {
57
+ throw new Error("AdsConsent.showForm(*) 'options.privacyPolicy' expected a valid HTTP or HTTPS URL.");
58
+ }
59
+
60
+ if (hasOwnProperty(options, 'withPersonalizedAds') && !isBoolean(options.withPersonalizedAds)) {
61
+ throw new Error("AdsConsent.showForm(*) 'options.withPersonalizedAds' expected a boolean value.");
62
+ }
63
+
64
+ if (hasOwnProperty(options, 'withNonPersonalizedAds') && !isBoolean(options.withNonPersonalizedAds)) {
65
+ throw new Error("AdsConsent.showForm(*) 'options.withNonPersonalizedAds' expected a boolean value.");
66
+ }
67
+
68
+ if (hasOwnProperty(options, 'withAdFree') && !isBoolean(options.withAdFree)) {
69
+ throw new Error("AdsConsent.showForm(*) 'options.withAdFree' expected a boolean value.");
70
+ }
71
+
72
+ if (!options.withPersonalizedAds && !options.withNonPersonalizedAds && !options.withAdFree) {
73
+ throw new Error("AdsConsent.showForm(*) 'options' form requires at least one option to be enabled.");
74
+ }
75
+
76
+ return native.showForm(options);
77
+ },
78
+
79
+ /**
80
+ *
81
+ */
82
+ getAdProviders() {
83
+ return native.getAdProviders();
84
+ },
85
+
86
+ /**
87
+ *
88
+ * @param geography
89
+ */
90
+ setDebugGeography(geography) {
91
+ if (geography !== AdsConsentDebugGeography.DISABLED && geography !== AdsConsentDebugGeography.EEA && geography !== AdsConsentDebugGeography.NOT_EEA) {
92
+ throw new Error("AdsConsent.setDebugGeography(*) 'geography' expected one of AdsConsentDebugGeography.DISABLED, AdsConsentDebugGeography.EEA or AdsConsentDebugGeography.NOT_EEA.");
93
+ }
94
+
95
+ return native.setDebugGeography(geography);
96
+ },
97
+
98
+ /**
99
+ *
100
+ */
101
+ getStatus() {
102
+ return native.getStatus();
103
+ },
104
+
105
+ /**
106
+ *
107
+ * @param status
108
+ */
109
+ setStatus(status) {
110
+ if (status !== AdsConsentStatus.UNKNOWN && status !== AdsConsentStatus.NON_PERSONALIZED && status !== AdsConsentStatus.PERSONALIZED) {
111
+ throw new Error("AdsConsent.setStatus(*) 'status' expected one of AdsConsentStatus.UNKNOWN, AdsConsentStatus.NON_PERSONALIZED or AdsConsentStatus.PERSONALIZED.");
112
+ }
113
+
114
+ return native.setStatus(status);
115
+ },
116
+
117
+ /**
118
+ *
119
+ * @param tag
120
+ */
121
+ setTagForUnderAgeOfConsent(tag) {
122
+ if (!isBoolean(tag)) {
123
+ throw new Error("AdsConsent.setTagForUnderAgeOfConsent(*) 'tag' expected a boolean value.");
124
+ }
125
+
126
+ return native.setTagForUnderAgeOfConsent(tag);
127
+ },
128
+
129
+ /**
130
+ *
131
+ * @param deviceIds
132
+ */
133
+ addTestDevices(deviceIds) {
134
+ if (!isArray(deviceIds)) {
135
+ throw new Error("AdsConsent.addTestDevices(*) 'deviceIds' expected an array of string values.");
136
+ }
137
+
138
+ for (let i = 0; i < deviceIds.length; i++) {
139
+ if (!isString(deviceIds[i])) {
140
+ throw new Error("AdsConsent.addTestDevices(*) 'deviceIds' expected an array of string values.");
141
+ }
142
+ }
143
+
144
+ return native.addTestDevices(deviceIds);
145
+ }
146
+
147
+ };
148
+ //# sourceMappingURL=AdsConsent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["AdsConsent.ts"],"names":["hasOwnProperty","isArray","isBoolean","isObject","isString","isUndefined","isValidUrl","NativeModules","AdsConsentDebugGeography","AdsConsentStatus","native","RNGoogleAdsConsentModule","AdsConsent","requestInfoUpdate","publisherIds","Error","length","i","showForm","options","privacyPolicy","withPersonalizedAds","withNonPersonalizedAds","withAdFree","getAdProviders","setDebugGeography","geography","DISABLED","EEA","NOT_EEA","getStatus","setStatus","status","UNKNOWN","NON_PERSONALIZED","PERSONALIZED","setTagForUnderAgeOfConsent","tag","addTestDevices","deviceIds"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,SACEA,cADF,EAEEC,OAFF,EAGEC,SAHF,EAIEC,QAJF,EAKEC,QALF,EAMEC,WANF,EAOEC,UAPF,QAQO,UARP;AASA,SAASC,aAAT,QAA8B,cAA9B;AACA,SAASC,wBAAT,QAAyC,4BAAzC;AACA,SAASC,gBAAT,QAAiC,oBAAjC;AAGA,MAAMC,MAAM,GAAGH,aAAa,CAACI,wBAA7B;AAEA,OAAO,MAAMC,UAA+B,GAAG;AAC7C;AACF;AACA;AACA;AACA;AACEC,EAAAA,iBAAiB,CAACC,YAAD,EAAe;AAC9B,QAAI,CAACb,OAAO,CAACa,YAAD,CAAZ,EAA4B;AAC1B,YAAM,IAAIC,KAAJ,CACJ,oFADI,CAAN;AAGD;;AAED,QAAID,YAAY,CAACE,MAAb,KAAwB,CAA5B,EAA+B;AAC7B,YAAM,IAAID,KAAJ,CACJ,uFADI,CAAN;AAGD;;AAED,SAAK,IAAIE,CAAC,GAAG,CAAb,EAAgBA,CAAC,GAAGH,YAAY,CAACE,MAAjC,EAAyCC,CAAC,EAA1C,EAA8C;AAC5C,UAAI,CAACb,QAAQ,CAACU,YAAY,CAACG,CAAD,CAAb,CAAb,EAAgC;AAC9B,cAAM,IAAIF,KAAJ,C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,MAA9B,EAAsCC,CAAC,EAAvC,EAA2C;AACzC,UAAI,CAACb,QAAQ,CAACmC,SAAS,CAACtB,CAAD,CAAV,CAAb,EAA6B;AAC3B,cAAM,IAAIF,KAAJ,CACJ,8EADI,CAAN;AAGD;AACF;;AAED,WAAOL,MAAM,CAAC4B,cAAP,CAAsBC,SAAtB,CAAP;AACD;;AA5J4C,CAAxC","sourcesContent":["/*\n * Copyright (c) 2016-present Invertase Limited & Contributors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this library except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\n\nimport {\n hasOwnProperty,\n isArray,\n isBoolean,\n isObject,\n isString,\n isUndefined,\n isValidUrl,\n} from './common';\nimport { NativeModules } from 'react-native';\nimport { AdsConsentDebugGeography } from './AdsConsentDebugGeography';\nimport { AdsConsentStatus } from './AdsConsentStatus';\nimport { AdsConsentInterface } from './types/AdsConsent.interface';\n\nconst native = NativeModules.RNGoogleAdsConsentModule;\n\nexport const AdsConsent: AdsConsentInterface = {\n /**\n *\n * @param publisherIds\n * @returns {*}\n */\n requestInfoUpdate(publisherIds) {\n if (!isArray(publisherIds)) {\n throw new Error(\n \"AdsConsent.requestInfoUpdate(*) 'publisherIds' expected an array of string values.\",\n );\n }\n\n if (publisherIds.length === 0) {\n throw new Error(\n \"AdsConsent.requestInfoUpdate(*) 'publisherIds' list of publisher IDs cannot be empty.\",\n );\n }\n\n for (let i = 0; i < publisherIds.length; i++) {\n if (!isString(publisherIds[i])) {\n throw new Error(\n `AdsConsent.requestInfoUpdate(*) 'publisherIds[${i}]' expected a string value.`,\n );\n }\n }\n\n return native.requestInfoUpdate(publisherIds);\n },\n\n /**\n *\n * @param options\n * @returns {*}\n */\n showForm(options) {\n if (!isUndefined(options) && !isObject(options)) {\n throw new Error(\"AdsConsent.showForm(*) 'options' expected an object value.\");\n }\n\n if (!isValidUrl(options.privacyPolicy)) {\n throw new Error(\n \"AdsConsent.showForm(*) 'options.privacyPolicy' expected a valid HTTP or HTTPS URL.\",\n );\n }\n\n if (hasOwnProperty(options, 'withPersonalizedAds') && !isBoolean(options.withPersonalizedAds)) {\n throw new Error(\n \"AdsConsent.showForm(*) 'options.withPersonalizedAds' expected a boolean value.\",\n );\n }\n\n if (\n hasOwnProperty(options, 'withNonPersonalizedAds') &&\n !isBoolean(options.withNonPersonalizedAds)\n ) {\n throw new Error(\n \"AdsConsent.showForm(*) 'options.withNonPersonalizedAds' expected a boolean value.\",\n );\n }\n\n if (hasOwnProperty(options, 'withAdFree') && !isBoolean(options.withAdFree)) {\n throw new Error(\"AdsConsent.showForm(*) 'options.withAdFree' expected a boolean value.\");\n }\n\n if (!options.withPersonalizedAds && !options.withNonPersonalizedAds && !options.withAdFree) {\n throw new Error(\n \"AdsConsent.showForm(*) 'options' form requires at least one option to be enabled.\",\n );\n }\n\n return native.showForm(options);\n },\n\n /**\n *\n */\n getAdProviders() {\n return native.getAdProviders();\n },\n\n /**\n *\n * @param geography\n */\n setDebugGeography(geography) {\n if (\n geography !== AdsConsentDebugGeography.DISABLED &&\n geography !== AdsConsentDebugGeography.EEA &&\n geography !== AdsConsentDebugGeography.NOT_EEA\n ) {\n throw new Error(\n \"AdsConsent.setDebugGeography(*) 'geography' expected one of AdsConsentDebugGeography.DISABLED, AdsConsentDebugGeography.EEA or AdsConsentDebugGeography.NOT_EEA.\",\n );\n }\n\n return native.setDebugGeography(geography);\n },\n\n /**\n *\n */\n getStatus() {\n return native.getStatus();\n },\n\n /**\n *\n * @param status\n */\n setStatus(status) {\n if (\n status !== AdsConsentStatus.UNKNOWN &&\n status !== AdsConsentStatus.NON_PERSONALIZED &&\n status !== AdsConsentStatus.PERSONALIZED\n ) {\n throw new Error(\n \"AdsConsent.setStatus(*) 'status' expected one of AdsConsentStatus.UNKNOWN, AdsConsentStatus.NON_PERSONALIZED or AdsConsentStatus.PERSONALIZED.\",\n );\n }\n\n return native.setStatus(status);\n },\n\n /**\n *\n * @param tag\n */\n setTagForUnderAgeOfConsent(tag) {\n if (!isBoolean(tag)) {\n throw new Error(\"AdsConsent.setTagForUnderAgeOfConsent(*) 'tag' expected a boolean value.\");\n }\n\n return native.setTagForUnderAgeOfConsent(tag);\n },\n\n /**\n *\n * @param deviceIds\n */\n addTestDevices(deviceIds) {\n if (!isArray(deviceIds)) {\n throw new Error(\n \"AdsConsent.addTestDevices(*) 'deviceIds' expected an array of string values.\",\n );\n }\n\n for (let i = 0; i < deviceIds.length; i++) {\n if (!isString(deviceIds[i])) {\n throw new Error(\n \"AdsConsent.addTestDevices(*) 'deviceIds' expected an array of string values.\",\n );\n }\n }\n\n return native.addTestDevices(deviceIds);\n },\n};\n"]}
@@ -0,0 +1,30 @@
1
+ /*
2
+ * Copyright (c) 2016-present Invertase Limited & Contributors
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this library except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ *
16
+ */
17
+
18
+ /**
19
+ * AdsConsentDebugGeography enum.
20
+ *
21
+ * Used to set a mock location when testing the `AdsConsent` helper.
22
+ */
23
+ export let AdsConsentDebugGeography;
24
+
25
+ (function (AdsConsentDebugGeography) {
26
+ AdsConsentDebugGeography[AdsConsentDebugGeography["DISABLED"] = 0] = "DISABLED";
27
+ AdsConsentDebugGeography[AdsConsentDebugGeography["EEA"] = 1] = "EEA";
28
+ AdsConsentDebugGeography[AdsConsentDebugGeography["NOT_EEA"] = 2] = "NOT_EEA";
29
+ })(AdsConsentDebugGeography || (AdsConsentDebugGeography = {}));
30
+ //# sourceMappingURL=AdsConsentDebugGeography.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["AdsConsentDebugGeography.ts"],"names":["AdsConsentDebugGeography"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAYA,wBAAZ;;WAAYA,wB;AAAAA,EAAAA,wB,CAAAA,wB;AAAAA,EAAAA,wB,CAAAA,wB;AAAAA,EAAAA,wB,CAAAA,wB;GAAAA,wB,KAAAA,wB","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/**\n * AdsConsentDebugGeography enum.\n *\n * Used to set a mock location when testing the `AdsConsent` helper.\n */\nexport enum AdsConsentDebugGeography {\n /**\n * Disable any debug geography.\n */\n DISABLED = 0,\n\n /**\n * Sets the location to within the EEA.\n */\n EEA = 1,\n\n /**\n * Sets the location to outside of the EEA.\n */\n NOT_EEA = 2,\n}\n"]}
@@ -0,0 +1,28 @@
1
+ /*
2
+ * Copyright (c) 2016-present Invertase Limited & Contributors
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this library except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ *
16
+ */
17
+
18
+ /**
19
+ * AdsConsentStatus enum.
20
+ */
21
+ export let AdsConsentStatus;
22
+
23
+ (function (AdsConsentStatus) {
24
+ AdsConsentStatus[AdsConsentStatus["UNKNOWN"] = 0] = "UNKNOWN";
25
+ AdsConsentStatus[AdsConsentStatus["NON_PERSONALIZED"] = 1] = "NON_PERSONALIZED";
26
+ AdsConsentStatus[AdsConsentStatus["PERSONALIZED"] = 2] = "PERSONALIZED";
27
+ })(AdsConsentStatus || (AdsConsentStatus = {}));
28
+ //# sourceMappingURL=AdsConsentStatus.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["AdsConsentStatus.ts"],"names":["AdsConsentStatus"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAYA,gBAAZ;;WAAYA,gB;AAAAA,EAAAA,gB,CAAAA,gB;AAAAA,EAAAA,gB,CAAAA,gB;AAAAA,EAAAA,gB,CAAAA,gB;GAAAA,gB,KAAAA,gB","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/**\n * AdsConsentStatus enum.\n */\nexport enum AdsConsentStatus {\n /**\n * The consent status is unknown and the user must provide consent to show ads if they are within the EEA or location is also unknown.\n */\n UNKNOWN = 0,\n\n /**\n * The user has accepted non-personalized ads.\n */\n NON_PERSONALIZED = 1,\n\n /**\n * The user has accepted personalized ads.\n */\n PERSONALIZED = 2,\n}\n"]}
@@ -0,0 +1,30 @@
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 let BannerAdSize;
19
+
20
+ (function (BannerAdSize) {
21
+ BannerAdSize["BANNER"] = "BANNER";
22
+ BannerAdSize["FULL_BANNER"] = "FULL_BANNER";
23
+ BannerAdSize["LARGE_BANNER"] = "LARGE_BANNER";
24
+ BannerAdSize["LEADERBOARD"] = "LEADERBOARD";
25
+ BannerAdSize["MEDIUM_RECTANGLE"] = "MEDIUM_RECTANGLE";
26
+ BannerAdSize["ADAPTIVE_BANNER"] = "ADAPTIVE_BANNER";
27
+ BannerAdSize["FLUID"] = "FLUID";
28
+ BannerAdSize["WIDE_SKYSCRAPER"] = "WIDE_SKYSCRAPER";
29
+ })(BannerAdSize || (BannerAdSize = {}));
30
+ //# sourceMappingURL=BannerAdSize.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["BannerAdSize.ts"],"names":["BannerAdSize"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,WAAYA,YAAZ;;WAAYA,Y;AAAAA,EAAAA,Y;AAAAA,EAAAA,Y;AAAAA,EAAAA,Y;AAAAA,EAAAA,Y;AAAAA,EAAAA,Y;AAAAA,EAAAA,Y;AAAAA,EAAAA,Y;AAAAA,EAAAA,Y;GAAAA,Y,KAAAA,Y","sourcesContent":["/*\n * Copyright (c) 2016-present Invertase Limited & Contributors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this library except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n *\n */\n\nexport enum BannerAdSize {\n /**\n * Mobile Marketing Association (MMA) banner ad size (320x50 density-independent pixels).\n */\n BANNER = 'BANNER',\n\n /**\n * Interactive Advertising Bureau (IAB) full banner ad size (468x60 density-independent pixels).\n */\n FULL_BANNER = 'FULL_BANNER',\n\n /**\n * Large banner ad size (320x100 density-independent pixels).\n */\n LARGE_BANNER = 'LARGE_BANNER',\n\n /**\n * Interactive Advertising Bureau (IAB) leaderboard ad size (728x90 density-independent pixels).\n */\n LEADERBOARD = 'LEADERBOARD',\n\n /**\n * Interactive Advertising Bureau (IAB) medium rectangle ad size (300x250 density-independent pixels).\n */\n MEDIUM_RECTANGLE = 'MEDIUM_RECTANGLE',\n\n /**\n * A (next generation) dynamically sized banner that is full-width and auto-height.\n */\n ADAPTIVE_BANNER = 'ADAPTIVE_BANNER',\n\n /**\n * A dynamically sized banner that matches its parent's width and expands/contracts its height to match the ad's content after loading completes.\n */\n FLUID = 'FLUID',\n\n /**\n * IAB wide skyscraper ad size (160x600 density-independent pixels). This size is currently not supported by the Google Mobile Ads network; this is intended for mediation ad networks only.\n */\n WIDE_SKYSCRAPER = 'WIDE_SKYSCRAPER',\n}\n"]}
@@ -0,0 +1,25 @@
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 let MaxAdContentRating;
18
+
19
+ (function (MaxAdContentRating) {
20
+ MaxAdContentRating["G"] = "G";
21
+ MaxAdContentRating["PG"] = "PG";
22
+ MaxAdContentRating["T"] = "T";
23
+ MaxAdContentRating["MA"] = "MA";
24
+ })(MaxAdContentRating || (MaxAdContentRating = {}));
25
+ //# sourceMappingURL=MaxAdContentRating.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["MaxAdContentRating.ts"],"names":["MaxAdContentRating"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,WAAYA,kBAAZ;;WAAYA,kB;AAAAA,EAAAA,kB;AAAAA,EAAAA,kB;AAAAA,EAAAA,kB;AAAAA,EAAAA,kB;GAAAA,kB,KAAAA,kB","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 enum MaxAdContentRating {\n /**\n * \"General audiences.\" Content suitable for all audiences, including families and children.\n */\n G = 'G',\n\n /**\n * \"Parental guidance.\" Content suitable for most audiences with parental guidance, including topics like non-realistic, cartoonish violence.\n */\n PG = 'PG',\n\n /**\n * T: \"Teen.\" Content suitable for teen and older audiences, including topics such as general health, social networks, scary imagery, and fight sports.\n */\n T = 'T',\n\n /**\n * \"Mature audiences.\" Content suitable only for mature audiences; includes topics such as alcohol, gambling, sexual content, and weapons.\n */\n MA = 'MA',\n}\n"]}
@@ -0,0 +1,53 @@
1
+ import { Module } from './internal';
2
+ import { validateAdRequestConfiguration } from './validateAdRequestConfiguration';
3
+ import { version } from './version';
4
+ const namespace = 'google_mobile_ads';
5
+ const nativeModuleName = ['RNGoogleMobileAdsModule', 'RNGoogleMobileAdsAppOpenModule', 'RNGoogleMobileAdsInterstitialModule', 'RNGoogleMobileAdsRewardedModule'];
6
+
7
+ class MobileAdsModule extends Module {
8
+ constructor(app, config) {
9
+ super(app, config);
10
+ this.emitter.addListener('google_mobile_ads_app_open_event', event => {
11
+ this.emitter.emit(`google_mobile_ads_app_open_event:${event.adUnitId}:${event.requestId}`, event);
12
+ });
13
+ this.emitter.addListener('google_mobile_ads_interstitial_event', event => {
14
+ this.emitter.emit(`google_mobile_ads_interstitial_event:${event.adUnitId}:${event.requestId}`, event);
15
+ });
16
+ this.emitter.addListener('google_mobile_ads_rewarded_event', event => {
17
+ this.emitter.emit(`google_mobile_ads_rewarded_event:${event.adUnitId}:${event.requestId}`, event);
18
+ });
19
+ }
20
+
21
+ initialize() {
22
+ return this.native.initialize();
23
+ }
24
+
25
+ setRequestConfiguration(requestConfiguration) {
26
+ let config;
27
+
28
+ try {
29
+ config = validateAdRequestConfiguration(requestConfiguration);
30
+ } catch (e) {
31
+ if (e instanceof Error) {
32
+ throw new Error(`googleMobileAds.setRequestConfiguration(*) ${e.message}`);
33
+ }
34
+ }
35
+
36
+ return this.native.setRequestConfiguration(config);
37
+ }
38
+
39
+ }
40
+
41
+ const MobileAdsInstance = new MobileAdsModule({
42
+ name: 'AppName'
43
+ }, {
44
+ version,
45
+ namespace,
46
+ nativeModuleName,
47
+ nativeEvents: ['google_mobile_ads_app_open_event', 'google_mobile_ads_interstitial_event', 'google_mobile_ads_rewarded_event']
48
+ });
49
+ export const MobileAds = () => {
50
+ return MobileAdsInstance;
51
+ };
52
+ export default MobileAds;
53
+ //# sourceMappingURL=MobileAds.js.map