react-native-google-mobile-ads 8.1.0 → 8.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (238) hide show
  1. package/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsAdHelper.kt +17 -42
  2. package/ios_config.sh +3 -3
  3. package/lib/commonjs/AdEventType.js +1 -4
  4. package/lib/commonjs/AdEventType.js.map +1 -1
  5. package/lib/commonjs/AdsConsent.js +2 -25
  6. package/lib/commonjs/AdsConsent.js.map +1 -1
  7. package/lib/commonjs/AdsConsentDebugGeography.js +0 -3
  8. package/lib/commonjs/AdsConsentDebugGeography.js.map +1 -1
  9. package/lib/commonjs/AdsConsentPurposes.js +1 -4
  10. package/lib/commonjs/AdsConsentPurposes.js.map +1 -1
  11. package/lib/commonjs/AdsConsentSpecialFeatures.js +1 -4
  12. package/lib/commonjs/AdsConsentSpecialFeatures.js.map +1 -1
  13. package/lib/commonjs/AdsConsentStatus.js +0 -3
  14. package/lib/commonjs/AdsConsentStatus.js.map +1 -1
  15. package/lib/commonjs/BannerAdSize.js +1 -4
  16. package/lib/commonjs/BannerAdSize.js.map +1 -1
  17. package/lib/commonjs/GAMAdEventType.js +1 -4
  18. package/lib/commonjs/GAMAdEventType.js.map +1 -1
  19. package/lib/commonjs/MaxAdContentRating.js +1 -4
  20. package/lib/commonjs/MaxAdContentRating.js.map +1 -1
  21. package/lib/commonjs/MobileAds.js +0 -14
  22. package/lib/commonjs/MobileAds.js.map +1 -1
  23. package/lib/commonjs/RewardedAdEventType.js +1 -4
  24. package/lib/commonjs/RewardedAdEventType.js.map +1 -1
  25. package/lib/commonjs/TestIds.js +1 -2
  26. package/lib/commonjs/TestIds.js.map +1 -1
  27. package/lib/commonjs/ads/AppOpenAd.js +0 -14
  28. package/lib/commonjs/ads/AppOpenAd.js.map +1 -1
  29. package/lib/commonjs/ads/BannerAd.js +1 -6
  30. package/lib/commonjs/ads/BannerAd.js.map +1 -1
  31. package/lib/commonjs/ads/BaseAd.js +1 -20
  32. package/lib/commonjs/ads/BaseAd.js.map +1 -1
  33. package/lib/commonjs/ads/GAMBannerAd.js +1 -14
  34. package/lib/commonjs/ads/GAMBannerAd.js.map +1 -1
  35. package/lib/commonjs/ads/GAMInterstitialAd.js +0 -6
  36. package/lib/commonjs/ads/GAMInterstitialAd.js.map +1 -1
  37. package/lib/commonjs/ads/InterstitialAd.js +0 -14
  38. package/lib/commonjs/ads/InterstitialAd.js.map +1 -1
  39. package/lib/commonjs/ads/MobileAd.js +2 -55
  40. package/lib/commonjs/ads/MobileAd.js.map +1 -1
  41. package/lib/commonjs/ads/RewardedAd.js +0 -16
  42. package/lib/commonjs/ads/RewardedAd.js.map +1 -1
  43. package/lib/commonjs/ads/RewardedInterstitialAd.js +0 -16
  44. package/lib/commonjs/ads/RewardedInterstitialAd.js.map +1 -1
  45. package/lib/commonjs/common/Base64.js +4 -23
  46. package/lib/commonjs/common/Base64.js.map +1 -1
  47. package/lib/commonjs/common/MutatableParams.js +2 -12
  48. package/lib/commonjs/common/MutatableParams.js.map +1 -1
  49. package/lib/commonjs/common/ReferenceBase.js +2 -10
  50. package/lib/commonjs/common/ReferenceBase.js.map +1 -1
  51. package/lib/commonjs/common/deeps.js +1 -17
  52. package/lib/commonjs/common/deeps.js.map +1 -1
  53. package/lib/commonjs/common/id.js +7 -17
  54. package/lib/commonjs/common/id.js.map +1 -1
  55. package/lib/commonjs/common/index.js +2 -34
  56. package/lib/commonjs/common/index.js.map +1 -1
  57. package/lib/commonjs/common/path.js +9 -28
  58. package/lib/commonjs/common/path.js.map +1 -1
  59. package/lib/commonjs/common/promise.js +1 -7
  60. package/lib/commonjs/common/promise.js.map +1 -1
  61. package/lib/commonjs/common/serialize.js +4 -8
  62. package/lib/commonjs/common/serialize.js.map +1 -1
  63. package/lib/commonjs/common/validate.js +17 -44
  64. package/lib/commonjs/common/validate.js.map +1 -1
  65. package/lib/commonjs/declarations.d.js.map +1 -1
  66. package/lib/commonjs/hooks/useAppOpenAd.js +0 -6
  67. package/lib/commonjs/hooks/useAppOpenAd.js.map +1 -1
  68. package/lib/commonjs/hooks/useFullScreenAd.js +5 -16
  69. package/lib/commonjs/hooks/useFullScreenAd.js.map +1 -1
  70. package/lib/commonjs/hooks/useInterstitialAd.js +0 -6
  71. package/lib/commonjs/hooks/useInterstitialAd.js.map +1 -1
  72. package/lib/commonjs/hooks/useRewardedAd.js +0 -6
  73. package/lib/commonjs/hooks/useRewardedAd.js.map +1 -1
  74. package/lib/commonjs/hooks/useRewardedInterstitialAd.js +0 -6
  75. package/lib/commonjs/hooks/useRewardedInterstitialAd.js.map +1 -1
  76. package/lib/commonjs/index.js +1 -29
  77. package/lib/commonjs/index.js.map +1 -1
  78. package/lib/commonjs/internal/GoogleMobileAdsNativeEventEmitter.js +8 -20
  79. package/lib/commonjs/internal/GoogleMobileAdsNativeEventEmitter.js.map +1 -1
  80. package/lib/commonjs/internal/Module.js +2 -18
  81. package/lib/commonjs/internal/Module.js.map +1 -1
  82. package/lib/commonjs/internal/NativeError.js +2 -13
  83. package/lib/commonjs/internal/NativeError.js.map +1 -1
  84. package/lib/commonjs/internal/SharedEventEmitter.js +2 -3
  85. package/lib/commonjs/internal/SharedEventEmitter.js.map +1 -1
  86. package/lib/commonjs/internal/constants.js +1 -1
  87. package/lib/commonjs/internal/constants.js.map +1 -1
  88. package/lib/commonjs/internal/index.js +0 -5
  89. package/lib/commonjs/internal/index.js.map +1 -1
  90. package/lib/commonjs/internal/registry/nativeModule.js +13 -44
  91. package/lib/commonjs/internal/registry/nativeModule.js.map +1 -1
  92. package/lib/commonjs/types/AdEventListener.js.map +1 -1
  93. package/lib/commonjs/types/AdEventsListener.js.map +1 -1
  94. package/lib/commonjs/types/AdShowOptions.js.map +1 -1
  95. package/lib/commonjs/types/AdStates.js.map +1 -1
  96. package/lib/commonjs/types/AdapterStatus.js +3 -6
  97. package/lib/commonjs/types/AdapterStatus.js.map +1 -1
  98. package/lib/commonjs/types/AdsConsent.interface.js.map +1 -1
  99. package/lib/commonjs/types/AppEvent.js.map +1 -1
  100. package/lib/commonjs/types/BannerAdProps.js.map +1 -1
  101. package/lib/commonjs/types/GoogleMobileAdsNativeModule.js.map +1 -1
  102. package/lib/commonjs/types/MobileAd.interface.js.map +1 -1
  103. package/lib/commonjs/types/MobileAdsModule.interface.js.map +1 -1
  104. package/lib/commonjs/types/Module.interface.js.map +1 -1
  105. package/lib/commonjs/types/RequestConfiguration.js.map +1 -1
  106. package/lib/commonjs/types/RequestOptions.js.map +1 -1
  107. package/lib/commonjs/types/RewardedAdReward.js.map +1 -1
  108. package/lib/commonjs/types/index.js +0 -22
  109. package/lib/commonjs/types/index.js.map +1 -1
  110. package/lib/commonjs/validateAdRequestConfiguration.js +1 -13
  111. package/lib/commonjs/validateAdRequestConfiguration.js.map +1 -1
  112. package/lib/commonjs/validateAdRequestOptions.js +1 -29
  113. package/lib/commonjs/validateAdRequestOptions.js.map +1 -1
  114. package/lib/commonjs/validateAdShowOptions.js +1 -7
  115. package/lib/commonjs/validateAdShowOptions.js.map +1 -1
  116. package/lib/commonjs/version.js +1 -1
  117. package/lib/commonjs/version.js.map +1 -1
  118. package/lib/module/AdEventType.js +1 -1
  119. package/lib/module/AdEventType.js.map +1 -1
  120. package/lib/module/AdsConsent.js +2 -18
  121. package/lib/module/AdsConsent.js.map +1 -1
  122. package/lib/module/AdsConsentDebugGeography.js +0 -1
  123. package/lib/module/AdsConsentDebugGeography.js.map +1 -1
  124. package/lib/module/AdsConsentPurposes.js +1 -1
  125. package/lib/module/AdsConsentPurposes.js.map +1 -1
  126. package/lib/module/AdsConsentSpecialFeatures.js +1 -1
  127. package/lib/module/AdsConsentSpecialFeatures.js.map +1 -1
  128. package/lib/module/AdsConsentStatus.js +0 -1
  129. package/lib/module/AdsConsentStatus.js.map +1 -1
  130. package/lib/module/BannerAdSize.js +1 -1
  131. package/lib/module/BannerAdSize.js.map +1 -1
  132. package/lib/module/GAMAdEventType.js +1 -1
  133. package/lib/module/GAMAdEventType.js.map +1 -1
  134. package/lib/module/MaxAdContentRating.js +1 -1
  135. package/lib/module/MaxAdContentRating.js.map +1 -1
  136. package/lib/module/MobileAds.js +0 -8
  137. package/lib/module/MobileAds.js.map +1 -1
  138. package/lib/module/RewardedAdEventType.js +1 -1
  139. package/lib/module/RewardedAdEventType.js.map +1 -1
  140. package/lib/module/TestIds.js +1 -0
  141. package/lib/module/TestIds.js.map +1 -1
  142. package/lib/module/ads/AppOpenAd.js +1 -8
  143. package/lib/module/ads/AppOpenAd.js.map +1 -1
  144. package/lib/module/ads/BannerAd.js +2 -2
  145. package/lib/module/ads/BannerAd.js.map +1 -1
  146. package/lib/module/ads/BaseAd.js +1 -9
  147. package/lib/module/ads/BaseAd.js.map +1 -1
  148. package/lib/module/ads/GAMBannerAd.js +2 -7
  149. package/lib/module/ads/GAMBannerAd.js.map +1 -1
  150. package/lib/module/ads/GAMInterstitialAd.js +0 -3
  151. package/lib/module/ads/GAMInterstitialAd.js.map +1 -1
  152. package/lib/module/ads/InterstitialAd.js +1 -9
  153. package/lib/module/ads/InterstitialAd.js.map +1 -1
  154. package/lib/module/ads/MobileAd.js +3 -47
  155. package/lib/module/ads/MobileAd.js.map +1 -1
  156. package/lib/module/ads/RewardedAd.js +1 -10
  157. package/lib/module/ads/RewardedAd.js.map +1 -1
  158. package/lib/module/ads/RewardedInterstitialAd.js +1 -10
  159. package/lib/module/ads/RewardedInterstitialAd.js.map +1 -1
  160. package/lib/module/common/Base64.js +4 -17
  161. package/lib/module/common/Base64.js.map +1 -1
  162. package/lib/module/common/MutatableParams.js +3 -9
  163. package/lib/module/common/MutatableParams.js.map +1 -1
  164. package/lib/module/common/ReferenceBase.js +2 -8
  165. package/lib/module/common/ReferenceBase.js.map +1 -1
  166. package/lib/module/common/deeps.js +3 -15
  167. package/lib/module/common/deeps.js.map +1 -1
  168. package/lib/module/common/id.js +7 -16
  169. package/lib/module/common/id.js.map +1 -1
  170. package/lib/module/common/index.js +2 -11
  171. package/lib/module/common/index.js.map +1 -1
  172. package/lib/module/common/path.js +9 -19
  173. package/lib/module/common/path.js.map +1 -1
  174. package/lib/module/common/promise.js +3 -5
  175. package/lib/module/common/promise.js.map +1 -1
  176. package/lib/module/common/serialize.js +4 -4
  177. package/lib/module/common/serialize.js.map +1 -1
  178. package/lib/module/common/validate.js +17 -24
  179. package/lib/module/common/validate.js.map +1 -1
  180. package/lib/module/declarations.d.js.map +1 -1
  181. package/lib/module/hooks/useAppOpenAd.js +2 -1
  182. package/lib/module/hooks/useAppOpenAd.js.map +1 -1
  183. package/lib/module/hooks/useFullScreenAd.js +5 -11
  184. package/lib/module/hooks/useFullScreenAd.js.map +1 -1
  185. package/lib/module/hooks/useInterstitialAd.js +2 -1
  186. package/lib/module/hooks/useInterstitialAd.js.map +1 -1
  187. package/lib/module/hooks/useRewardedAd.js +2 -1
  188. package/lib/module/hooks/useRewardedAd.js.map +1 -1
  189. package/lib/module/hooks/useRewardedInterstitialAd.js +2 -1
  190. package/lib/module/hooks/useRewardedInterstitialAd.js.map +1 -1
  191. package/lib/module/index.js +3 -1
  192. package/lib/module/index.js.map +1 -1
  193. package/lib/module/internal/GoogleMobileAdsNativeEventEmitter.js +9 -18
  194. package/lib/module/internal/GoogleMobileAdsNativeEventEmitter.js.map +1 -1
  195. package/lib/module/internal/Module.js +3 -13
  196. package/lib/module/internal/Module.js.map +1 -1
  197. package/lib/module/internal/NativeError.js +2 -11
  198. package/lib/module/internal/NativeError.js.map +1 -1
  199. package/lib/module/internal/SharedEventEmitter.js +1 -0
  200. package/lib/module/internal/SharedEventEmitter.js.map +1 -1
  201. package/lib/module/internal/constants.js +1 -0
  202. package/lib/module/internal/constants.js.map +1 -1
  203. package/lib/module/internal/index.js +1 -0
  204. package/lib/module/internal/index.js.map +1 -1
  205. package/lib/module/internal/registry/nativeModule.js +13 -35
  206. package/lib/module/internal/registry/nativeModule.js.map +1 -1
  207. package/lib/module/types/AdEventListener.js.map +1 -1
  208. package/lib/module/types/AdEventsListener.js.map +1 -1
  209. package/lib/module/types/AdShowOptions.js.map +1 -1
  210. package/lib/module/types/AdStates.js.map +1 -1
  211. package/lib/module/types/AdapterStatus.js +1 -1
  212. package/lib/module/types/AdapterStatus.js.map +1 -1
  213. package/lib/module/types/AdsConsent.interface.js.map +1 -1
  214. package/lib/module/types/AppEvent.js.map +1 -1
  215. package/lib/module/types/BannerAdProps.js.map +1 -1
  216. package/lib/module/types/GoogleMobileAdsNativeModule.js.map +1 -1
  217. package/lib/module/types/MobileAd.interface.js.map +1 -1
  218. package/lib/module/types/MobileAdsModule.interface.js.map +1 -1
  219. package/lib/module/types/Module.interface.js.map +1 -1
  220. package/lib/module/types/RequestConfiguration.js.map +1 -1
  221. package/lib/module/types/RequestOptions.js.map +1 -1
  222. package/lib/module/types/RewardedAdReward.js.map +1 -1
  223. package/lib/module/types/index.js +1 -0
  224. package/lib/module/types/index.js.map +1 -1
  225. package/lib/module/validateAdRequestConfiguration.js +1 -10
  226. package/lib/module/validateAdRequestConfiguration.js.map +1 -1
  227. package/lib/module/validateAdRequestOptions.js +1 -27
  228. package/lib/module/validateAdRequestOptions.js.map +1 -1
  229. package/lib/module/validateAdShowOptions.js +1 -5
  230. package/lib/module/validateAdShowOptions.js.map +1 -1
  231. package/lib/module/version.js +1 -1
  232. package/lib/module/version.js.map +1 -1
  233. package/lib/typescript/common/Base64.d.ts +0 -1
  234. package/lib/typescript/index.d.ts +1 -1
  235. package/lib/typescript/version.d.ts +1 -1
  236. package/package.json +35 -29
  237. package/src/internal/registry/nativeModule.ts +2 -0
  238. package/src/version.ts +1 -1
@@ -3,7 +3,6 @@ import { validateAdRequestConfiguration } from './validateAdRequestConfiguration
3
3
  import { version } from './version';
4
4
  const namespace = 'google_mobile_ads';
5
5
  const nativeModuleName = ['RNGoogleMobileAdsModule', 'RNGoogleMobileAdsAppOpenModule', 'RNGoogleMobileAdsInterstitialModule', 'RNGoogleMobileAdsRewardedModule', 'RNGoogleMobileAdsRewardedInterstitialModule'];
6
-
7
6
  class MobileAdsModule extends Module {
8
7
  constructor(app, config) {
9
8
  super(app, config);
@@ -20,14 +19,11 @@ class MobileAdsModule extends Module {
20
19
  this.emitter.emit(`google_mobile_ads_rewarded_interstitial_event:${event.adUnitId}:${event.requestId}`, event);
21
20
  });
22
21
  }
23
-
24
22
  initialize() {
25
23
  return this.native.initialize();
26
24
  }
27
-
28
25
  setRequestConfiguration(requestConfiguration) {
29
26
  let config;
30
-
31
27
  try {
32
28
  config = validateAdRequestConfiguration(requestConfiguration);
33
29
  } catch (e) {
@@ -35,16 +31,12 @@ class MobileAdsModule extends Module {
35
31
  throw new Error(`googleMobileAds.setRequestConfiguration(*) ${e.message}`);
36
32
  }
37
33
  }
38
-
39
34
  return this.native.setRequestConfiguration(config);
40
35
  }
41
-
42
36
  openAdInspector() {
43
37
  return this.native.openAdInspector();
44
38
  }
45
-
46
39
  }
47
-
48
40
  const MobileAdsInstance = new MobileAdsModule({
49
41
  name: 'AppName'
50
42
  }, {
@@ -1 +1 @@
1
- {"version":3,"sources":["MobileAds.ts"],"names":["Module","validateAdRequestConfiguration","version","namespace","nativeModuleName","MobileAdsModule","constructor","app","config","emitter","addListener","event","emit","adUnitId","requestId","initialize","native","setRequestConfiguration","requestConfiguration","e","Error","message","openAdInspector","MobileAdsInstance","name","nativeEvents","MobileAds"],"mappings":"AAAA,SAASA,MAAT,QAAuB,YAAvB;AACA,SAASC,8BAAT,QAA+C,kCAA/C;AACA,SAASC,OAAT,QAAwB,WAAxB;AAKA,MAAMC,SAAS,GAAG,mBAAlB;AAEA,MAAMC,gBAAgB,GAAG,CACvB,yBADuB,EAEvB,gCAFuB,EAGvB,qCAHuB,EAIvB,iCAJuB,EAKvB,6CALuB,CAAzB;;AAaA,MAAMC,eAAN,SAA8BL,MAA9B,CAAyE;AACvEM,EAAAA,WAAW,CAACC,GAAD,EAAWC,MAAX,EAA2B;AACpC,UAAMD,GAAN,EAAWC,MAAX;AA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B,WAAO,KAAKN,MAAL,CAAYM,eAAZ,EAAP;AACD;;AApDsE;;AAuDzE,MAAMC,iBAAiB,GAAG,IAAIlB,eAAJ,CACxB;AAAEmB,EAAAA,IAAI,EAAE;AAAR,CADwB,EAExB;AACEtB,EAAAA,OADF;AAEEC,EAAAA,SAFF;AAGEC,EAAAA,gBAHF;AAIEqB,EAAAA,YAAY,EAAE,CACZ,kCADY,EAEZ,sCAFY,EAGZ,kCAHY,EAIZ,+CAJY;AAJhB,CAFwB,CAA1B;AAeA,OAAO,MAAMC,SAAS,GAAG,MAAM;AAC7B,SAAOH,iBAAP;AACD,CAFM;AAIP,eAAeG,SAAf","sourcesContent":["import { Module } from './internal';\nimport { validateAdRequestConfiguration } from './validateAdRequestConfiguration';\nimport { version } from './version';\nimport { MobileAdsModuleInterface } from './types/MobileAdsModule.interface';\nimport { RequestConfiguration } from './types/RequestConfiguration';\nimport { App, Config } from './types/Module.interface';\n\nconst namespace = 'google_mobile_ads';\n\nconst nativeModuleName = [\n 'RNGoogleMobileAdsModule',\n 'RNGoogleMobileAdsAppOpenModule',\n 'RNGoogleMobileAdsInterstitialModule',\n 'RNGoogleMobileAdsRewardedModule',\n 'RNGoogleMobileAdsRewardedInterstitialModule',\n];\n\ntype Event = {\n adUnitId: string;\n requestId: number;\n};\n\nclass MobileAdsModule extends Module implements MobileAdsModuleInterface {\n constructor(app: App, config: Config) {\n super(app, config);\n\n this.emitter.addListener('google_mobile_ads_app_open_event', (event: Event) => {\n this.emitter.emit(\n `google_mobile_ads_app_open_event:${event.adUnitId}:${event.requestId}`,\n event,\n );\n });\n\n this.emitter.addListener('google_mobile_ads_interstitial_event', (event: Event) => {\n this.emitter.emit(\n `google_mobile_ads_interstitial_event:${event.adUnitId}:${event.requestId}`,\n event,\n );\n });\n\n this.emitter.addListener('google_mobile_ads_rewarded_event', (event: Event) => {\n this.emitter.emit(\n `google_mobile_ads_rewarded_event:${event.adUnitId}:${event.requestId}`,\n event,\n );\n });\n\n this.emitter.addListener('google_mobile_ads_rewarded_interstitial_event', (event: Event) => {\n this.emitter.emit(\n `google_mobile_ads_rewarded_interstitial_event:${event.adUnitId}:${event.requestId}`,\n event,\n );\n });\n }\n\n initialize() {\n return this.native.initialize();\n }\n\n setRequestConfiguration(requestConfiguration: RequestConfiguration) {\n let config;\n try {\n config = validateAdRequestConfiguration(requestConfiguration);\n } catch (e) {\n if (e instanceof Error) {\n throw new Error(`googleMobileAds.setRequestConfiguration(*) ${e.message}`);\n }\n }\n\n return this.native.setRequestConfiguration(config);\n }\n\n openAdInspector() {\n return this.native.openAdInspector();\n }\n}\n\nconst MobileAdsInstance = new MobileAdsModule(\n { name: 'AppName' },\n {\n version,\n namespace,\n nativeModuleName,\n nativeEvents: [\n 'google_mobile_ads_app_open_event',\n 'google_mobile_ads_interstitial_event',\n 'google_mobile_ads_rewarded_event',\n 'google_mobile_ads_rewarded_interstitial_event',\n ],\n },\n);\n\nexport const MobileAds = () => {\n return MobileAdsInstance;\n};\n\nexport default MobileAds;\n"]}
1
+ {"version":3,"names":["Module","validateAdRequestConfiguration","version","namespace","nativeModuleName","MobileAdsModule","constructor","app","config","emitter","addListener","event","emit","adUnitId","requestId","initialize","native","setRequestConfiguration","requestConfiguration","e","Error","message","openAdInspector","MobileAdsInstance","name","nativeEvents","MobileAds"],"sources":["MobileAds.ts"],"sourcesContent":["import { Module } from './internal';\nimport { validateAdRequestConfiguration } from './validateAdRequestConfiguration';\nimport { version } from './version';\nimport { MobileAdsModuleInterface } from './types/MobileAdsModule.interface';\nimport { RequestConfiguration } from './types/RequestConfiguration';\nimport { App, Config } from './types/Module.interface';\n\nconst namespace = 'google_mobile_ads';\n\nconst nativeModuleName = [\n 'RNGoogleMobileAdsModule',\n 'RNGoogleMobileAdsAppOpenModule',\n 'RNGoogleMobileAdsInterstitialModule',\n 'RNGoogleMobileAdsRewardedModule',\n 'RNGoogleMobileAdsRewardedInterstitialModule',\n];\n\ntype Event = {\n adUnitId: string;\n requestId: number;\n};\n\nclass MobileAdsModule extends Module implements MobileAdsModuleInterface {\n constructor(app: App, config: Config) {\n super(app, config);\n\n this.emitter.addListener('google_mobile_ads_app_open_event', (event: Event) => {\n this.emitter.emit(\n `google_mobile_ads_app_open_event:${event.adUnitId}:${event.requestId}`,\n event,\n );\n });\n\n this.emitter.addListener('google_mobile_ads_interstitial_event', (event: Event) => {\n this.emitter.emit(\n `google_mobile_ads_interstitial_event:${event.adUnitId}:${event.requestId}`,\n event,\n );\n });\n\n this.emitter.addListener('google_mobile_ads_rewarded_event', (event: Event) => {\n this.emitter.emit(\n `google_mobile_ads_rewarded_event:${event.adUnitId}:${event.requestId}`,\n event,\n );\n });\n\n this.emitter.addListener('google_mobile_ads_rewarded_interstitial_event', (event: Event) => {\n this.emitter.emit(\n `google_mobile_ads_rewarded_interstitial_event:${event.adUnitId}:${event.requestId}`,\n event,\n );\n });\n }\n\n initialize() {\n return this.native.initialize();\n }\n\n setRequestConfiguration(requestConfiguration: RequestConfiguration) {\n let config;\n try {\n config = validateAdRequestConfiguration(requestConfiguration);\n } catch (e) {\n if (e instanceof Error) {\n throw new Error(`googleMobileAds.setRequestConfiguration(*) ${e.message}`);\n }\n }\n\n return this.native.setRequestConfiguration(config);\n }\n\n openAdInspector() {\n return this.native.openAdInspector();\n }\n}\n\nconst MobileAdsInstance = new MobileAdsModule(\n { name: 'AppName' },\n {\n version,\n namespace,\n nativeModuleName,\n nativeEvents: [\n 'google_mobile_ads_app_open_event',\n 'google_mobile_ads_interstitial_event',\n 'google_mobile_ads_rewarded_event',\n 'google_mobile_ads_rewarded_interstitial_event',\n ],\n },\n);\n\nexport const MobileAds = () => {\n return MobileAdsInstance;\n};\n\nexport default MobileAds;\n"],"mappings":"AAAA,SAASA,MAAM,QAAQ,YAAY;AACnC,SAASC,8BAA8B,QAAQ,kCAAkC;AACjF,SAASC,OAAO,QAAQ,WAAW;AAKnC,MAAMC,SAAS,GAAG,mBAAmB;AAErC,MAAMC,gBAAgB,GAAG,CACvB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CAAC,OAAOC,CAAC,EAAE;MACV,IAAIA,CAAC,YAAYC,KAAK,EAAE;QACtB,MAAM,IAAIA,KAAK,CAAE,8CAA6CD,CAAC,CAACE,OAAQ,EAAC,CAAC;MAC5E;IACF;IAEA,OAAO,IAAI,CAACL,MAAM,CAACC,uBAAuB,CAACT,MAAM,CAAC;EACpD;EAEAc,eAAe,GAAG;IAChB,OAAO,IAAI,CAACN,MAAM,CAACM,eAAe,EAAE;EACtC;AACF;AAEA,MAAMC,iBAAiB,GAAG,IAAIlB,eAAe,CAC3C;EAAEmB,IAAI,EAAE;AAAU,CAAC,EACnB;EACEtB,OAAO;EACPC,SAAS;EACTC,gBAAgB;EAChBqB,YAAY,EAAE,CACZ,kCAAkC,EAClC,sCAAsC,EACtC,kCAAkC,EAClC,+CAA+C;AAEnD,CAAC,CACF;AAED,OAAO,MAAMC,SAAS,GAAG,MAAM;EAC7B,OAAOH,iBAAiB;AAC1B,CAAC;AAED,eAAeG,SAAS"}
@@ -14,8 +14,8 @@
14
14
  * limitations under the License.
15
15
  *
16
16
  */
17
- export let RewardedAdEventType;
18
17
 
18
+ export let RewardedAdEventType;
19
19
  (function (RewardedAdEventType) {
20
20
  RewardedAdEventType["LOADED"] = "rewarded_loaded";
21
21
  RewardedAdEventType["EARNED_REWARD"] = "rewarded_earned_reward";
@@ -1 +1 @@
1
- {"version":3,"sources":["RewardedAdEventType.ts"],"names":["RewardedAdEventType"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,WAAYA,mBAAZ;;WAAYA,mB;AAAAA,EAAAA,mB;AAAAA,EAAAA,mB;GAAAA,mB,KAAAA,mB","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 RewardedAdEventType {\n /**\n * An event fired when a rewarded ad has loaded.\n *\n * This type differs from `AdEventType.LOADED` as when a rewarded ad is loaded,\n * an additional data payload is provided to the event handler containing the ad reward\n * (assuming the user earns the reward).\n *\n * The reward contains a `type` and `amount`.\n *\n * #### Example\n *\n * ```js\n * import { RewardedAdEventType } from 'react-native-google-mobile-ads';\n *\n * rewardedAd.addEventListener(RewardedAdEventType.LOADED, (reward) => {\n * console.log(`Rewarded Ad loaded with ${data.amount} ${data.type} as reward`);\n * // E.g. \"Rewarded Ad loaded with 50 coins as reward\"\n * rewardedAd.show();\n * });\n * ```\n */\n LOADED = 'rewarded_loaded',\n\n /**\n * An event fired when the user earned the reward for the video. If the user does not earn a reward,\n * the `AdEventType.CLOSED` event will be fired with no rewarded event.\n *\n * The reward contains a `type` and `amount`.\n *\n * #### Example\n *\n * ```js\n * import { RewardedAdEventType } from 'react-native-google-mobile-ads';\n *\n * rewardedAd.addEventListener(RewardedAdEventType.EARNED_REWARD, (reward) => {\n * console.log(`User earned ${data.amount} ${data.type}`);\n * // E.g. \"User earned 50 coins\"\n * });\n * ```\n */\n EARNED_REWARD = 'rewarded_earned_reward',\n}\n"]}
1
+ {"version":3,"names":["RewardedAdEventType"],"sources":["RewardedAdEventType.ts"],"sourcesContent":["/*\n * Copyright (c) 2016-present Invertase Limited & Contributors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this library except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\n\nexport enum RewardedAdEventType {\n /**\n * An event fired when a rewarded ad has loaded.\n *\n * This type differs from `AdEventType.LOADED` as when a rewarded ad is loaded,\n * an additional data payload is provided to the event handler containing the ad reward\n * (assuming the user earns the reward).\n *\n * The reward contains a `type` and `amount`.\n *\n * #### Example\n *\n * ```js\n * import { RewardedAdEventType } from 'react-native-google-mobile-ads';\n *\n * rewardedAd.addEventListener(RewardedAdEventType.LOADED, (reward) => {\n * console.log(`Rewarded Ad loaded with ${data.amount} ${data.type} as reward`);\n * // E.g. \"Rewarded Ad loaded with 50 coins as reward\"\n * rewardedAd.show();\n * });\n * ```\n */\n LOADED = 'rewarded_loaded',\n\n /**\n * An event fired when the user earned the reward for the video. If the user does not earn a reward,\n * the `AdEventType.CLOSED` event will be fired with no rewarded event.\n *\n * The reward contains a `type` and `amount`.\n *\n * #### Example\n *\n * ```js\n * import { RewardedAdEventType } from 'react-native-google-mobile-ads';\n *\n * rewardedAd.addEventListener(RewardedAdEventType.EARNED_REWARD, (reward) => {\n * console.log(`User earned ${data.amount} ${data.type}`);\n * // E.g. \"User earned 50 coins\"\n * });\n * ```\n */\n EARNED_REWARD = 'rewarded_earned_reward',\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,WAAYA,mBAAmB;AA0C9B,WA1CWA,mBAAmB;EAAnBA,mBAAmB;EAAnBA,mBAAmB;AAAA,GAAnBA,mBAAmB,KAAnBA,mBAAmB"}
@@ -14,6 +14,7 @@
14
14
  * limitations under the License.
15
15
  *
16
16
  */
17
+
17
18
  import { Platform } from 'react-native';
18
19
  export const TestIds = {
19
20
  APP_OPEN: '',
@@ -1 +1 @@
1
- {"version":3,"sources":["TestIds.ts"],"names":["Platform","TestIds","APP_OPEN","BANNER","INTERSTITIAL","REWARDED","REWARDED_INTERSTITIAL","GAM_APP_OPEN","GAM_BANNER","GAM_INTERSTITIAL","GAM_REWARDED","GAM_REWARDED_INTERSTITIAL","GAM_NATIVE","select","android","ios"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,SAASA,QAAT,QAAyB,cAAzB;AAEA,OAAO,MAAMC,OAAO,GAAG;AACrBC,EAAAA,QAAQ,EAAE,EADW;AAErBC,EAAAA,MAAM,EAAE,EAFa;AAGrBC,EAAAA,YAAY,EAAE,EAHO;AAIrBC,EAAAA,QAAQ,EAAE,EAJW;AAKrBC,EAAAA,qBAAqB,EAAE,EALF;AAMrBC,EAAAA,YAAY,EAAE,wBANO;AAOrBC,EAAAA,UAAU,EAAE,sBAPS;AAQrBC,EAAAA,gBAAgB,EAAE,4BARG;AASrBC,EAAAA,YAAY,EAAE,wBATO;AAUrBC,EAAAA,yBAAyB,EAAE,4CAVN;AAWrBC,EAAAA,UAAU,EAAE,sBAXS;AAYrB,KAAGZ,QAAQ,CAACa,MAAT,CAAgB;AACjBC,IAAAA,OAAO,EAAE;AACPZ,MAAAA,QAAQ,EAAE,wCADH;AAEPC,MAAAA,MAAM,EAAE,wCAFD;AAGPC,MAAAA,YAAY,EAAE,wCAHP;AAIPC,MAAAA,QAAQ,EAAE,wCAJH;AAKPC,MAAAA,qBAAqB,EAAE;AALhB,KADQ;AAQjBS,IAAAA,GAAG,EAAE;AACHb,MAAAA,QAAQ,EAAE,wCADP;AAEHC,MAAAA,MAAM,EAAE,wCAFL;AAGHC,MAAAA,YAAY,EAAE,wCAHX;AAIHC,MAAAA,QAAQ,EAAE,wCAJP;AAKHC,MAAAA,qBAAqB,EAAE;AALpB;AARY,GAAhB;AAZkB,CAAhB","sourcesContent":["/*\n * Copyright (c) 2016-present Invertase Limited & Contributors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this library except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\n\nimport { Platform } from 'react-native';\n\nexport const TestIds = {\n APP_OPEN: '',\n BANNER: '',\n INTERSTITIAL: '',\n REWARDED: '',\n REWARDED_INTERSTITIAL: '',\n GAM_APP_OPEN: '/6499/example/app-open',\n GAM_BANNER: '/6499/example/banner',\n GAM_INTERSTITIAL: '/6499/example/interstitial',\n GAM_REWARDED: '/6499/example/rewarded',\n GAM_REWARDED_INTERSTITIAL: '/21775744923/example/rewarded_interstitial',\n GAM_NATIVE: '/6499/example/native',\n ...Platform.select({\n android: {\n APP_OPEN: 'ca-app-pub-3940256099942544/3419835294',\n BANNER: 'ca-app-pub-3940256099942544/6300978111',\n INTERSTITIAL: 'ca-app-pub-3940256099942544/1033173712',\n REWARDED: 'ca-app-pub-3940256099942544/5224354917',\n REWARDED_INTERSTITIAL: 'ca-app-pub-3940256099942544/5354046379',\n },\n ios: {\n APP_OPEN: 'ca-app-pub-3940256099942544/5662855259',\n BANNER: 'ca-app-pub-3940256099942544/2934735716',\n INTERSTITIAL: 'ca-app-pub-3940256099942544/4411468910',\n REWARDED: 'ca-app-pub-3940256099942544/1712485313',\n REWARDED_INTERSTITIAL: 'ca-app-pub-3940256099942544/6978759866',\n },\n }),\n};\n"]}
1
+ {"version":3,"names":["Platform","TestIds","APP_OPEN","BANNER","INTERSTITIAL","REWARDED","REWARDED_INTERSTITIAL","GAM_APP_OPEN","GAM_BANNER","GAM_INTERSTITIAL","GAM_REWARDED","GAM_REWARDED_INTERSTITIAL","GAM_NATIVE","select","android","ios"],"sources":["TestIds.ts"],"sourcesContent":["/*\n * Copyright (c) 2016-present Invertase Limited & Contributors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this library except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\n\nimport { Platform } from 'react-native';\n\nexport const TestIds = {\n APP_OPEN: '',\n BANNER: '',\n INTERSTITIAL: '',\n REWARDED: '',\n REWARDED_INTERSTITIAL: '',\n GAM_APP_OPEN: '/6499/example/app-open',\n GAM_BANNER: '/6499/example/banner',\n GAM_INTERSTITIAL: '/6499/example/interstitial',\n GAM_REWARDED: '/6499/example/rewarded',\n GAM_REWARDED_INTERSTITIAL: '/21775744923/example/rewarded_interstitial',\n GAM_NATIVE: '/6499/example/native',\n ...Platform.select({\n android: {\n APP_OPEN: 'ca-app-pub-3940256099942544/3419835294',\n BANNER: 'ca-app-pub-3940256099942544/6300978111',\n INTERSTITIAL: 'ca-app-pub-3940256099942544/1033173712',\n REWARDED: 'ca-app-pub-3940256099942544/5224354917',\n REWARDED_INTERSTITIAL: 'ca-app-pub-3940256099942544/5354046379',\n },\n ios: {\n APP_OPEN: 'ca-app-pub-3940256099942544/5662855259',\n BANNER: 'ca-app-pub-3940256099942544/2934735716',\n INTERSTITIAL: 'ca-app-pub-3940256099942544/4411468910',\n REWARDED: 'ca-app-pub-3940256099942544/1712485313',\n REWARDED_INTERSTITIAL: 'ca-app-pub-3940256099942544/6978759866',\n },\n }),\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,QAAQ,QAAQ,cAAc;AAEvC,OAAO,MAAMC,OAAO,GAAG;EACrBC,QAAQ,EAAE,EAAE;EACZC,MAAM,EAAE,EAAE;EACVC,YAAY,EAAE,EAAE;EAChBC,QAAQ,EAAE,EAAE;EACZC,qBAAqB,EAAE,EAAE;EACzBC,YAAY,EAAE,wBAAwB;EACtCC,UAAU,EAAE,sBAAsB;EAClCC,gBAAgB,EAAE,4BAA4B;EAC9CC,YAAY,EAAE,wBAAwB;EACtCC,yBAAyB,EAAE,4CAA4C;EACvEC,UAAU,EAAE,sBAAsB;EAClC,GAAGZ,QAAQ,CAACa,MAAM,CAAC;IACjBC,OAAO,EAAE;MACPZ,QAAQ,EAAE,wCAAwC;MAClDC,MAAM,EAAE,wCAAwC;MAChDC,YAAY,EAAE,wCAAwC;MACtDC,QAAQ,EAAE,wCAAwC;MAClDC,qBAAqB,EAAE;IACzB,CAAC;IACDS,GAAG,EAAE;MACHb,QAAQ,EAAE,wCAAwC;MAClDC,MAAM,EAAE,wCAAwC;MAChDC,YAAY,EAAE,wCAAwC;MACtDC,QAAQ,EAAE,wCAAwC;MAClDC,qBAAqB,EAAE;IACzB;EACF,CAAC;AACH,CAAC"}
@@ -1,5 +1,4 @@
1
1
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
-
3
2
  /*
4
3
  * Copyright (c) 2016-present Invertase Limited & Contributors
5
4
  *
@@ -16,6 +15,7 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
16
15
  * limitations under the License.
17
16
  *
18
17
  */
18
+
19
19
  import { isString } from '../common';
20
20
  import { MobileAds } from '../MobileAds';
21
21
  import { validateAdRequestOptions } from '../validateAdRequestOptions';
@@ -25,9 +25,7 @@ export class AppOpenAd extends MobileAd {
25
25
  if (!isString(adUnitId)) {
26
26
  throw new Error("AppOpenAd.createForAdRequest(*) 'adUnitId' expected an string value.");
27
27
  }
28
-
29
28
  let options = {};
30
-
31
29
  try {
32
30
  options = validateAdRequestOptions(requestOptions);
33
31
  } catch (e) {
@@ -35,20 +33,15 @@ export class AppOpenAd extends MobileAd {
35
33
  throw new Error(`AppOpenAd.createForAdRequest(_, *) ${e.message}.`);
36
34
  }
37
35
  }
38
-
39
36
  const requestId = AppOpenAd._appOpenRequest++;
40
37
  return new AppOpenAd('app_open', MobileAds(), requestId, adUnitId, options);
41
38
  }
42
-
43
39
  addAdEventsListener(listener) {
44
40
  return this._addAdEventsListener(listener);
45
41
  }
46
-
47
42
  addAdEventListener(type, listener) {
48
43
  return this._addAdEventListener(type, listener);
49
44
  }
50
-
51
45
  }
52
-
53
46
  _defineProperty(AppOpenAd, "_appOpenRequest", 0);
54
47
  //# sourceMappingURL=AppOpenAd.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["AppOpenAd.ts"],"names":["isString","MobileAds","validateAdRequestOptions","MobileAd","AppOpenAd","createForAdRequest","adUnitId","requestOptions","Error","options","e","message","requestId","_appOpenRequest","addAdEventsListener","listener","_addAdEventsListener","addAdEventListener","type","_addAdEventListener"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,SAASA,QAAT,QAAyB,WAAzB;AACA,SAASC,SAAT,QAA0B,cAA1B;AACA,SAASC,wBAAT,QAAyC,6BAAzC;AACA,SAASC,QAAT,QAAyB,YAAzB;AAMA,OAAO,MAAMC,SAAN,SAAwBD,QAAxB,CAAiC;AAGb,SAAlBE,kBAAkB,CAACC,QAAD,EAAmBC,cAAnB,EAAoD;AAC3E,QAAI,CAACP,QAAQ,CAACM,QAAD,CAAb,EAAyB;AACvB,YAAM,IAAIE,KAAJ,CAAU,sEAAV,CAAN;AACD;;AAED,QAAIC,OAAO,GAAG,EAAd;;AACA,QAAI;AACFA,MAAAA,OAAO,GAAGP,wBAAwB,CAACK,cAAD,CAAlC;AACD,KAFD,CAEE,OAAOG,CAAP,EAAU;AACV,UAAIA,CAAC,YAAYF,KAAjB,EAAwB;AACtB,cAAM,IAAIA,KAAJ,CAAW,sCAAqCE,CAAC,CAACC,OAAQ,GAA1D,CAAN;AACD;AACF;;AAED,UAAMC,SAAS,GAAGR,SAAS,CAACS,eAAV,EAAlB;AACA,WAAO,IAAIT,SAAJ,CAAc,UAAd,EAA0BH,SAAS,EAAnC,EAAuCW,SAAvC,EAAkDN,QAAlD,EAA4DG,OAA5D,CAAP;AACD;;AAEDK,EAAAA,mBAAmB,CAAwBC,QAAxB,EAAmE;AACpF,WAAO,KAAKC,oBAAL,CAA0BD,QAA1B,CAAP;AACD;;AAEDE,EAAAA,kBAAkB,CAAwBC,IAAxB,EAAiCH,QAAjC,EAA+D;AAC/E,WAAO,KAAKI,mBAAL,CAAyBD,IAAzB,EAA+BH,QAA/B,CAAP;AACD;;AA3BqC;;gBAA3BX,S,qBACwB,C","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 { isString } from '../common';\nimport { MobileAds } from '../MobileAds';\nimport { validateAdRequestOptions } from '../validateAdRequestOptions';\nimport { MobileAd } from './MobileAd';\nimport { AdEventType } from '../AdEventType';\nimport { AdEventListener } from '../types/AdEventListener';\nimport { AdEventsListener } from '../types/AdEventsListener';\nimport { RequestOptions } from '../types/RequestOptions';\n\nexport class AppOpenAd extends MobileAd {\n protected static _appOpenRequest = 0;\n\n static createForAdRequest(adUnitId: string, requestOptions?: RequestOptions) {\n if (!isString(adUnitId)) {\n throw new Error(\"AppOpenAd.createForAdRequest(*) 'adUnitId' expected an string value.\");\n }\n\n let options = {};\n try {\n options = validateAdRequestOptions(requestOptions);\n } catch (e) {\n if (e instanceof Error) {\n throw new Error(`AppOpenAd.createForAdRequest(_, *) ${e.message}.`);\n }\n }\n\n const requestId = AppOpenAd._appOpenRequest++;\n return new AppOpenAd('app_open', MobileAds(), requestId, adUnitId, options);\n }\n\n addAdEventsListener<T extends AdEventType>(listener: AdEventsListener<T>): () => void {\n return this._addAdEventsListener(listener);\n }\n\n addAdEventListener<T extends AdEventType>(type: T, listener: AdEventListener<T>) {\n return this._addAdEventListener(type, listener);\n }\n}\n"]}
1
+ {"version":3,"names":["isString","MobileAds","validateAdRequestOptions","MobileAd","AppOpenAd","createForAdRequest","adUnitId","requestOptions","Error","options","e","message","requestId","_appOpenRequest","addAdEventsListener","listener","_addAdEventsListener","addAdEventListener","type","_addAdEventListener"],"sources":["AppOpenAd.ts"],"sourcesContent":["/*\n * Copyright (c) 2016-present Invertase Limited & Contributors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this library except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\n\nimport { isString } from '../common';\nimport { MobileAds } from '../MobileAds';\nimport { validateAdRequestOptions } from '../validateAdRequestOptions';\nimport { MobileAd } from './MobileAd';\nimport { AdEventType } from '../AdEventType';\nimport { AdEventListener } from '../types/AdEventListener';\nimport { AdEventsListener } from '../types/AdEventsListener';\nimport { RequestOptions } from '../types/RequestOptions';\n\nexport class AppOpenAd extends MobileAd {\n protected static _appOpenRequest = 0;\n\n static createForAdRequest(adUnitId: string, requestOptions?: RequestOptions) {\n if (!isString(adUnitId)) {\n throw new Error(\"AppOpenAd.createForAdRequest(*) 'adUnitId' expected an string value.\");\n }\n\n let options = {};\n try {\n options = validateAdRequestOptions(requestOptions);\n } catch (e) {\n if (e instanceof Error) {\n throw new Error(`AppOpenAd.createForAdRequest(_, *) ${e.message}.`);\n }\n }\n\n const requestId = AppOpenAd._appOpenRequest++;\n return new AppOpenAd('app_open', MobileAds(), requestId, adUnitId, options);\n }\n\n addAdEventsListener<T extends AdEventType>(listener: AdEventsListener<T>): () => void {\n return this._addAdEventsListener(listener);\n }\n\n addAdEventListener<T extends AdEventType>(type: T, listener: AdEventListener<T>) {\n return this._addAdEventListener(type, listener);\n }\n}\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,QAAQ,QAAQ,WAAW;AACpC,SAASC,SAAS,QAAQ,cAAc;AACxC,SAASC,wBAAwB,QAAQ,6BAA6B;AACtE,SAASC,QAAQ,QAAQ,YAAY;AAMrC,OAAO,MAAMC,SAAS,SAASD,QAAQ,CAAC;EAGtC,OAAOE,kBAAkB,CAACC,QAAgB,EAAEC,cAA+B,EAAE;IAC3E,IAAI,CAACP,QAAQ,CAACM,QAAQ,CAAC,EAAE;MACvB,MAAM,IAAIE,KAAK,CAAC,sEAAsE,CAAC;IACzF;IAEA,IAAIC,OAAO,GAAG,CAAC,CAAC;IAChB,IAAI;MACFA,OAAO,GAAGP,wBAAwB,CAACK,cAAc,CAAC;IACpD,CAAC,CAAC,OAAOG,CAAC,EAAE;MACV,IAAIA,CAAC,YAAYF,KAAK,EAAE;QACtB,MAAM,IAAIA,KAAK,CAAE,sCAAqCE,CAAC,CAACC,OAAQ,GAAE,CAAC;MACrE;IACF;IAEA,MAAMC,SAAS,GAAGR,SAAS,CAACS,eAAe,EAAE;IAC7C,OAAO,IAAIT,SAAS,CAAC,UAAU,EAAEH,SAAS,EAAE,EAAEW,SAAS,EAAEN,QAAQ,EAAEG,OAAO,CAAC;EAC7E;EAEAK,mBAAmB,CAAwBC,QAA6B,EAAc;IACpF,OAAO,IAAI,CAACC,oBAAoB,CAACD,QAAQ,CAAC;EAC5C;EAEAE,kBAAkB,CAAwBC,IAAO,EAAEH,QAA4B,EAAE;IAC/E,OAAO,IAAI,CAACI,mBAAmB,CAACD,IAAI,EAAEH,QAAQ,CAAC;EACjD;AACF;AAAC,gBA5BYX,SAAS,qBACe,CAAC"}
@@ -1,5 +1,4 @@
1
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
-
1
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
3
2
  /*
4
3
  * Copyright (c) 2016-present Invertase Limited & Contributors
5
4
  *
@@ -16,6 +15,7 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
16
15
  * limitations under the License.
17
16
  *
18
17
  */
18
+
19
19
  import React from 'react';
20
20
  import { BaseAd } from './BaseAd';
21
21
  export function BannerAd(_ref) {
@@ -1 +1 @@
1
- {"version":3,"sources":["BannerAd.tsx"],"names":["React","BaseAd","BannerAd","size","props"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,OAAOA,KAAP,MAAkB,OAAlB;AAEA,SAASC,MAAT,QAAuB,UAAvB;AAEA,OAAO,SAASC,QAAT,OAAqD;AAAA,MAAnC;AAAEC,IAAAA,IAAF;AAAQ,OAAGC;AAAX,GAAmC;AAC1D,sBAAO,oBAAC,MAAD;AAAQ,IAAA,KAAK,EAAE,CAACD,IAAD;AAAf,KAA2BC,KAA3B,EAAP;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 React from 'react';\nimport { BannerAdProps } from '../types/BannerAdProps';\nimport { BaseAd } from './BaseAd';\n\nexport function BannerAd({ size, ...props }: BannerAdProps) {\n return <BaseAd sizes={[size]} {...props} />;\n}\n"]}
1
+ {"version":3,"names":["React","BaseAd","BannerAd","size","props"],"sources":["BannerAd.tsx"],"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 React from 'react';\nimport { BannerAdProps } from '../types/BannerAdProps';\nimport { BaseAd } from './BaseAd';\n\nexport function BannerAd({ size, ...props }: BannerAdProps) {\n return <BaseAd sizes={[size]} {...props} />;\n}\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SAASC,MAAM,QAAQ,UAAU;AAEjC,OAAO,SAASC,QAAQ,OAAoC;EAAA,IAAnC;IAAEC,IAAI;IAAE,GAAGC;EAAqB,CAAC;EACxD,oBAAO,oBAAC,MAAM;IAAC,KAAK,EAAE,CAACD,IAAI;EAAE,GAAKC,KAAK,EAAI;AAC7C"}
@@ -1,5 +1,4 @@
1
1
  /* eslint-disable react/prop-types */
2
-
3
2
  /*
4
3
  * Copyright (c) 2016-present Invertase Limited & Contributors
5
4
  *
@@ -16,6 +15,7 @@
16
15
  * limitations under the License.
17
16
  *
18
17
  */
18
+
19
19
  import React, { useState, useEffect } from 'react';
20
20
  import { requireNativeComponent } from 'react-native';
21
21
  import { isFunction } from '../common';
@@ -54,7 +54,6 @@ export const BaseAd = /*#__PURE__*/React.forwardRef((_ref, ref) => {
54
54
  }
55
55
  }
56
56
  }, [parsedRequestOptions]);
57
-
58
57
  function onNativeEvent(_ref2) {
59
58
  let {
60
59
  nativeEvent
@@ -62,10 +61,8 @@ export const BaseAd = /*#__PURE__*/React.forwardRef((_ref, ref) => {
62
61
  const {
63
62
  type
64
63
  } = nativeEvent;
65
-
66
64
  if (type !== 'onSizeChange' && isFunction(props[type])) {
67
65
  let eventHandler, eventPayload;
68
-
69
66
  switch (type) {
70
67
  case 'onAdLoaded':
71
68
  eventPayload = {
@@ -74,12 +71,10 @@ export const BaseAd = /*#__PURE__*/React.forwardRef((_ref, ref) => {
74
71
  };
75
72
  if (eventHandler = props[type]) eventHandler(eventPayload);
76
73
  break;
77
-
78
74
  case 'onAdFailedToLoad':
79
75
  eventPayload = NativeError.fromEvent(nativeEvent, 'googleMobileAds');
80
76
  if (eventHandler = props[type]) eventHandler(eventPayload);
81
77
  break;
82
-
83
78
  case 'onAppEvent':
84
79
  eventPayload = {
85
80
  name: nativeEvent.name,
@@ -87,12 +82,10 @@ export const BaseAd = /*#__PURE__*/React.forwardRef((_ref, ref) => {
87
82
  };
88
83
  if (eventHandler = props[type]) eventHandler(eventPayload);
89
84
  break;
90
-
91
85
  default:
92
86
  if (eventHandler = props[type]) eventHandler();
93
87
  }
94
88
  }
95
-
96
89
  if (type === 'onAdLoaded' || type === 'onSizeChange') {
97
90
  const {
98
91
  width,
@@ -101,7 +94,6 @@ export const BaseAd = /*#__PURE__*/React.forwardRef((_ref, ref) => {
101
94
  if (width && height) setDimensions([width, height]);
102
95
  }
103
96
  }
104
-
105
97
  const style = sizes.includes(BannerAdSize.FLUID) ? {
106
98
  width: '100%',
107
99
  height: dimensions[1]
@@ -1 +1 @@
1
- {"version":3,"sources":["BaseAd.tsx"],"names":["React","useState","useEffect","requireNativeComponent","isFunction","NativeError","BannerAdSize","validateAdRequestOptions","sizeRegex","BaseAd","forwardRef","ref","unitId","sizes","requestOptions","manualImpressionsEnabled","props","dimensions","setDimensions","Error","length","every","size","test","parsedRequestOptions","JSON","stringify","e","message","onNativeEvent","nativeEvent","type","eventHandler","eventPayload","width","height","fromEvent","name","data","style","includes","FLUID","displayName","GoogleMobileAdsBannerView"],"mappings":"AAAA;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,OAAOA,KAAP,IAAgBC,QAAhB,EAA0BC,SAA1B,QAA2C,OAA3C;AACA,SAAwBC,sBAAxB,QAAsD,cAAtD;AACA,SAASC,UAAT,QAA2B,WAA3B;AACA,SAASC,WAAT,QAA4B,yBAA5B;AACA,SAASC,YAAT,QAA6B,iBAA7B;AACA,SAASC,wBAAT,QAAyC,6BAAzC;AAsBA,MAAMC,SAAS,GAAG,mBAAlB;AAEA,OAAO,MAAMC,MAAM,gBAAGT,KAAK,CAACU,UAAN,CACpB,OAAwEC,GAAxE,KAAgF;AAAA,MAA/E;AAAEC,IAAAA,MAAF;AAAUC,IAAAA,KAAV;AAAiBC,IAAAA,cAAjB;AAAiCC,IAAAA,wBAAjC;AAA2D,OAAGC;AAA9D,GAA+E;AAC9E,QAAM,CAACC,UAAD,EAAaC,aAAb,IAA8BjB,QAAQ,CAAsB,CAAC,CAAD,EAAI,CAAJ,CAAtB,CAA5C;AAEAC,EAAAA,SAAS,CAAC,MAAM;AACd,QAAI,CAACU,MAAL,EAAa;AACX,YAAM,IAAIO,KAAJ,CAAU,qDAAV,CAAN;AACD;AACF,GAJQ,EAIN,CAACP,MAAD,CAJM,CAAT;AAMAV,EAAAA,SAAS,CAAC,MAAM;AACd,QACEW,KAAK,CAACO,MAAN,KAAiB,CAAjB,IACA,CAACP,KAAK,CAACQ,KAAN,CAAYC,IAAI,IAAIA,IAAI,IAAIhB,YAAR,IAAwBE,SAAS,CAACe,IAAV,CAAeD,IAAf,CAA5C,CAFH,EA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) 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 React, { useState, useEffect } from 'react';\nimport { NativeMethods, requireNativeComponent } from 'react-native';\nimport { isFunction } from '../common';\nimport { NativeError } from '../internal/NativeError';\nimport { BannerAdSize } from '../BannerAdSize';\nimport { validateAdRequestOptions } from '../validateAdRequestOptions';\nimport { GAMBannerAdProps } from '../types/BannerAdProps';\nimport { RequestOptions } from '../types/RequestOptions';\n\ntype NativeEvent =\n | {\n type: 'onAdLoaded' | 'onSizeChange';\n width: number;\n height: number;\n }\n | { type: 'onAdOpened' | 'onAdClosed' }\n | {\n type: 'onAdFailedToLoad';\n code: string;\n message: string;\n }\n | {\n type: 'onAppEvent';\n name: string;\n data?: string;\n };\n\nconst sizeRegex = /([0-9]+)x([0-9]+)/;\n\nexport const BaseAd = React.forwardRef<GoogleMobileAdsBannerView, GAMBannerAdProps>(\n ({ unitId, sizes, requestOptions, manualImpressionsEnabled, ...props }, ref) => {\n const [dimensions, setDimensions] = useState<(number | string)[]>([0, 0]);\n\n useEffect(() => {\n if (!unitId) {\n throw new Error(\"BannerAd: 'unitId' expected a valid string unit ID.\");\n }\n }, [unitId]);\n\n useEffect(() => {\n if (\n sizes.length === 0 ||\n !sizes.every(size => size in BannerAdSize || sizeRegex.test(size))\n ) {\n throw new Error(\"BannerAd: 'size(s)' expected a valid BannerAdSize or custom size string.\");\n }\n }, [sizes]);\n\n const parsedRequestOptions = JSON.stringify(requestOptions);\n\n useEffect(() => {\n if (requestOptions) {\n try {\n validateAdRequestOptions(requestOptions);\n } catch (e) {\n if (e instanceof Error) {\n throw new Error(`BannerAd: ${e.message}`);\n }\n }\n }\n }, [parsedRequestOptions]);\n\n function onNativeEvent({ nativeEvent }: { nativeEvent: NativeEvent }) {\n const { type } = nativeEvent;\n\n if (type !== 'onSizeChange' && isFunction(props[type])) {\n let eventHandler, eventPayload;\n switch (type) {\n case 'onAdLoaded':\n eventPayload = {\n width: nativeEvent.width,\n height: nativeEvent.height,\n };\n if ((eventHandler = props[type])) eventHandler(eventPayload);\n break;\n case 'onAdFailedToLoad':\n eventPayload = NativeError.fromEvent(nativeEvent, 'googleMobileAds');\n if ((eventHandler = props[type])) eventHandler(eventPayload);\n break;\n case 'onAppEvent':\n eventPayload = {\n name: nativeEvent.name,\n data: nativeEvent.data,\n };\n if ((eventHandler = props[type])) eventHandler(eventPayload);\n break;\n default:\n if ((eventHandler = props[type])) eventHandler();\n }\n }\n\n if (type === 'onAdLoaded' || type === 'onSizeChange') {\n const { width, height } = nativeEvent;\n if (width && height) setDimensions([width, height]);\n }\n }\n\n const style = sizes.includes(BannerAdSize.FLUID)\n ? {\n width: '100%',\n height: dimensions[1],\n }\n : {\n width: dimensions[0],\n height: dimensions[1],\n };\n\n return (\n <GoogleMobileAdsBannerView\n ref={ref}\n sizes={sizes}\n style={style}\n unitId={unitId}\n request={validateAdRequestOptions(requestOptions)}\n manualImpressionsEnabled={!!manualImpressionsEnabled}\n onNativeEvent={onNativeEvent}\n />\n );\n },\n);\nBaseAd.displayName = 'BaseAd';\n\ninterface NativeBannerProps {\n sizes: GAMBannerAdProps['sizes'];\n style: {\n width?: number | string;\n height?: number | string;\n };\n unitId: string;\n request: RequestOptions;\n manualImpressionsEnabled: boolean;\n onNativeEvent: (event: { nativeEvent: NativeEvent }) => void;\n}\n\nconst GoogleMobileAdsBannerView = requireNativeComponent<NativeBannerProps>(\n 'RNGoogleMobileAdsBannerView',\n);\nexport type GoogleMobileAdsBannerView = React.Component<NativeBannerProps> & NativeMethods;\n"]}
1
+ {"version":3,"names":["React","useState","useEffect","requireNativeComponent","isFunction","NativeError","BannerAdSize","validateAdRequestOptions","sizeRegex","BaseAd","forwardRef","ref","unitId","sizes","requestOptions","manualImpressionsEnabled","props","dimensions","setDimensions","Error","length","every","size","test","parsedRequestOptions","JSON","stringify","e","message","onNativeEvent","nativeEvent","type","eventHandler","eventPayload","width","height","fromEvent","name","data","style","includes","FLUID","displayName","GoogleMobileAdsBannerView"],"sources":["BaseAd.tsx"],"sourcesContent":["/* eslint-disable react/prop-types */\n/*\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 React, { useState, useEffect } from 'react';\nimport { NativeMethods, requireNativeComponent } from 'react-native';\nimport { isFunction } from '../common';\nimport { NativeError } from '../internal/NativeError';\nimport { BannerAdSize } from '../BannerAdSize';\nimport { validateAdRequestOptions } from '../validateAdRequestOptions';\nimport { GAMBannerAdProps } from '../types/BannerAdProps';\nimport { RequestOptions } from '../types/RequestOptions';\n\ntype NativeEvent =\n | {\n type: 'onAdLoaded' | 'onSizeChange';\n width: number;\n height: number;\n }\n | { type: 'onAdOpened' | 'onAdClosed' }\n | {\n type: 'onAdFailedToLoad';\n code: string;\n message: string;\n }\n | {\n type: 'onAppEvent';\n name: string;\n data?: string;\n };\n\nconst sizeRegex = /([0-9]+)x([0-9]+)/;\n\nexport const BaseAd = React.forwardRef<GoogleMobileAdsBannerView, GAMBannerAdProps>(\n ({ unitId, sizes, requestOptions, manualImpressionsEnabled, ...props }, ref) => {\n const [dimensions, setDimensions] = useState<(number | string)[]>([0, 0]);\n\n useEffect(() => {\n if (!unitId) {\n throw new Error(\"BannerAd: 'unitId' expected a valid string unit ID.\");\n }\n }, [unitId]);\n\n useEffect(() => {\n if (\n sizes.length === 0 ||\n !sizes.every(size => size in BannerAdSize || sizeRegex.test(size))\n ) {\n throw new Error(\"BannerAd: 'size(s)' expected a valid BannerAdSize or custom size string.\");\n }\n }, [sizes]);\n\n const parsedRequestOptions = JSON.stringify(requestOptions);\n\n useEffect(() => {\n if (requestOptions) {\n try {\n validateAdRequestOptions(requestOptions);\n } catch (e) {\n if (e instanceof Error) {\n throw new Error(`BannerAd: ${e.message}`);\n }\n }\n }\n }, [parsedRequestOptions]);\n\n function onNativeEvent({ nativeEvent }: { nativeEvent: NativeEvent }) {\n const { type } = nativeEvent;\n\n if (type !== 'onSizeChange' && isFunction(props[type])) {\n let eventHandler, eventPayload;\n switch (type) {\n case 'onAdLoaded':\n eventPayload = {\n width: nativeEvent.width,\n height: nativeEvent.height,\n };\n if ((eventHandler = props[type])) eventHandler(eventPayload);\n break;\n case 'onAdFailedToLoad':\n eventPayload = NativeError.fromEvent(nativeEvent, 'googleMobileAds');\n if ((eventHandler = props[type])) eventHandler(eventPayload);\n break;\n case 'onAppEvent':\n eventPayload = {\n name: nativeEvent.name,\n data: nativeEvent.data,\n };\n if ((eventHandler = props[type])) eventHandler(eventPayload);\n break;\n default:\n if ((eventHandler = props[type])) eventHandler();\n }\n }\n\n if (type === 'onAdLoaded' || type === 'onSizeChange') {\n const { width, height } = nativeEvent;\n if (width && height) setDimensions([width, height]);\n }\n }\n\n const style = sizes.includes(BannerAdSize.FLUID)\n ? {\n width: '100%',\n height: dimensions[1],\n }\n : {\n width: dimensions[0],\n height: dimensions[1],\n };\n\n return (\n <GoogleMobileAdsBannerView\n ref={ref}\n sizes={sizes}\n style={style}\n unitId={unitId}\n request={validateAdRequestOptions(requestOptions)}\n manualImpressionsEnabled={!!manualImpressionsEnabled}\n onNativeEvent={onNativeEvent}\n />\n );\n },\n);\nBaseAd.displayName = 'BaseAd';\n\ninterface NativeBannerProps {\n sizes: GAMBannerAdProps['sizes'];\n style: {\n width?: number | string;\n height?: number | string;\n };\n unitId: string;\n request: RequestOptions;\n manualImpressionsEnabled: boolean;\n onNativeEvent: (event: { nativeEvent: NativeEvent }) => void;\n}\n\nconst GoogleMobileAdsBannerView = requireNativeComponent<NativeBannerProps>(\n 'RNGoogleMobileAdsBannerView',\n);\nexport type GoogleMobileAdsBannerView = React.Component<NativeBannerProps> & NativeMethods;\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,KAAK,IAAIC,QAAQ,EAAEC,SAAS,QAAQ,OAAO;AAClD,SAAwBC,sBAAsB,QAAQ,cAAc;AACpE,SAASC,UAAU,QAAQ,WAAW;AACtC,SAASC,WAAW,QAAQ,yBAAyB;AACrD,SAASC,YAAY,QAAQ,iBAAiB;AAC9C,SAASC,wBAAwB,QAAQ,6BAA6B;AAsBtE,MAAMC,SAAS,GAAG,mBAAmB;AAErC,OAAO,MAAMC,MAAM,gBAAGT,KAAK,CAACU,UAAU,CACpC,OAAwEC,GAAG,KAAK;EAAA,IAA/E;IAAEC,MAAM;IAAEC,KAAK;IAAEC,cAAc;IAAEC,wBAAwB;IAAE,GAAGC;EAAM,CAAC;EACpE,MAAM,CAACC,UAAU,EAAEC,aAAa,CAAC,GAAGjB,QAAQ,CAAsB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;EAEzEC,SAAS,CAAC,MAAM;IACd,IAAI,CAACU,MAAM,EAAE;MACX,MAAM,IAAIO,KAAK,CAAC,qDAAqD,CAAC;IACxE;EACF,CAAC,EAAE,CAACP,MAAM,CAAC,CAAC;EAEZV,SAAS,CAAC,MAAM;IACd,IACEW,KAAK,CAACO,MAAM,KAAK,CAAC,IAClB,CAACP,KAAK,CAACQ,KAAK,CAACC,IAAI,IAAIA,IAAI,IAAIhB,YAAY,IAAIE,SAAS,CAACe,IAAI,CAACD,IAAI,CAAC,CAAC,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KN,YAAY,GAAGhB,KAAK,CAACe,IAAI,CAAC,EAAGC,YAAY,CAACC,YAAY,CAAC;UAC5D;QACF;UACE,IAAKD,YAAY,GAAGhB,KAAK,CAACe,IAAI,CAAC,EAAGC,YAAY,EAAE;MAAC;IAEvD;IAEA,IAAID,IAAI,KAAK,YAAY,IAAIA,IAAI,KAAK,cAAc,EAAE;MACpD,MAAM;QAAEG,KAAK;QAAEC;MAAO,CAAC,GAAGL,WAAW;MACrC,IAAII,KAAK,IAAIC,MAAM,EAAEjB,aAAa,CAAC,CAACgB,KAAK,EAAEC,MAAM,CAAC,CAAC;IACrD;EACF;EAEA,MAAMI,KAAK,GAAG1B,KAAK,CAAC2B,QAAQ,CAAClC,YAAY,CAACmC,KAAK,CAAC,GAC5C;IACEP,KAAK,EAAE,MAAM;IACbC,MAAM,EAAElB,UAAU,CAAC,CAAC;EACtB,CAAC,GACD;IACEiB,KAAK,EAAEjB,UAAU,CAAC,CAAC,CAAC;IACpBkB,MAAM,EAAElB,UAAU,CAAC,CAAC;EACtB,CAAC;EAEL,oBACE,oBAAC,yBAAyB;IACxB,GAAG,EAAEN,GAAI;IACT,KAAK,EAAEE,KAAM;IACb,KAAK,EAAE0B,KAAM;IACb,MAAM,EAAE3B,MAAO;IACf,OAAO,EAAEL,wBAAwB,CAACO,cAAc,CAAE;IAClD,wBAAwB,EAAE,CAAC,CAACC,wBAAyB;IACrD,aAAa,EAAEc;EAAc,EAC7B;AAEN,CAAC,CACF;AACDpB,MAAM,CAACiC,WAAW,GAAG,QAAQ;AAc7B,MAAMC,yBAAyB,GAAGxC,sBAAsB,CACtD,6BAA6B,CAC9B"}
@@ -1,7 +1,5 @@
1
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
-
1
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
3
2
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
4
-
5
3
  /*
6
4
  * Copyright (c) 2016-present Invertase Limited & Contributors
7
5
  *
@@ -18,25 +16,22 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
18
16
  * limitations under the License.
19
17
  *
20
18
  */
19
+
21
20
  import React, { createRef } from 'react';
22
21
  import { findNodeHandle, UIManager } from 'react-native';
23
22
  import { BaseAd } from './BaseAd';
24
23
  export class GAMBannerAd extends React.Component {
25
24
  constructor() {
26
25
  super(...arguments);
27
-
28
26
  _defineProperty(this, "ref", /*#__PURE__*/createRef());
29
27
  }
30
-
31
28
  recordManualImpression() {
32
29
  UIManager.dispatchViewManagerCommand(findNodeHandle(this.ref.current), 'recordManualImpression', undefined);
33
30
  }
34
-
35
31
  render() {
36
32
  return /*#__PURE__*/React.createElement(BaseAd, _extends({
37
33
  ref: this.ref
38
34
  }, this.props));
39
35
  }
40
-
41
36
  }
42
37
  //# sourceMappingURL=GAMBannerAd.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["GAMBannerAd.tsx"],"names":["React","createRef","findNodeHandle","UIManager","BaseAd","GAMBannerAd","Component","recordManualImpression","dispatchViewManagerCommand","ref","current","undefined","render","props"],"mappings":";;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,OAAOA,KAAP,IAAgBC,SAAhB,QAAiC,OAAjC;AACA,SAASC,cAAT,EAAyBC,SAAzB,QAA0C,cAA1C;AAEA,SAASC,MAAT,QAAkD,UAAlD;AAEA,OAAO,MAAMC,WAAN,SAA0BL,KAAK,CAACM,SAAhC,CAA4D;AAAA;AAAA;;AAAA,8CACnDL,SAAS,EAD0C;AAAA;;AAGjEM,EAAAA,sBAAsB,GAAG;AACvBJ,IAAAA,SAAS,CAACK,0BAAV,CACEN,cAAc,CAAC,KAAKO,GAAL,CAASC,OAAV,CADhB,EAEE,wBAFF,EAGEC,SAHF;AAKD;;AAEDC,EAAAA,MAAM,GAAG;AACP,wBAAO,oBAAC,MAAD;AAAQ,MAAA,GAAG,EAAE,KAAKH;AAAlB,OAA2B,KAAKI,KAAhC,EAAP;AACD;;AAbgE","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 React, { createRef } from 'react';\nimport { findNodeHandle, UIManager } from 'react-native';\nimport { GAMBannerAdProps } from '../types/BannerAdProps';\nimport { BaseAd, GoogleMobileAdsBannerView } from './BaseAd';\n\nexport class GAMBannerAd extends React.Component<GAMBannerAdProps> {\n private ref = createRef<GoogleMobileAdsBannerView>();\n\n recordManualImpression() {\n UIManager.dispatchViewManagerCommand(\n findNodeHandle(this.ref.current),\n 'recordManualImpression',\n undefined,\n );\n }\n\n render() {\n return <BaseAd ref={this.ref} {...this.props} />;\n }\n}\n"]}
1
+ {"version":3,"names":["React","createRef","findNodeHandle","UIManager","BaseAd","GAMBannerAd","Component","recordManualImpression","dispatchViewManagerCommand","ref","current","undefined","render","props"],"sources":["GAMBannerAd.tsx"],"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 React, { createRef } from 'react';\nimport { findNodeHandle, UIManager } from 'react-native';\nimport { GAMBannerAdProps } from '../types/BannerAdProps';\nimport { BaseAd, GoogleMobileAdsBannerView } from './BaseAd';\n\nexport class GAMBannerAd extends React.Component<GAMBannerAdProps> {\n private ref = createRef<GoogleMobileAdsBannerView>();\n\n recordManualImpression() {\n UIManager.dispatchViewManagerCommand(\n findNodeHandle(this.ref.current),\n 'recordManualImpression',\n undefined,\n );\n }\n\n render() {\n return <BaseAd ref={this.ref} {...this.props} />;\n }\n}\n"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,KAAK,IAAIC,SAAS,QAAQ,OAAO;AACxC,SAASC,cAAc,EAAEC,SAAS,QAAQ,cAAc;AAExD,SAASC,MAAM,QAAmC,UAAU;AAE5D,OAAO,MAAMC,WAAW,SAASL,KAAK,CAACM,SAAS,CAAmB;EAAA;IAAA;IAAA,0CACnDL,SAAS,EAA6B;EAAA;EAEpDM,sBAAsB,GAAG;IACvBJ,SAAS,CAACK,0BAA0B,CAClCN,cAAc,CAAC,IAAI,CAACO,GAAG,CAACC,OAAO,CAAC,EAChC,wBAAwB,EACxBC,SAAS,CACV;EACH;EAEAC,MAAM,GAAG;IACP,oBAAO,oBAAC,MAAM;MAAC,GAAG,EAAE,IAAI,CAACH;IAAI,GAAK,IAAI,CAACI,KAAK,EAAI;EAClD;AACF"}
@@ -25,14 +25,11 @@ export class GAMInterstitialAd extends InterstitialAd {
25
25
  static createForAdRequest(adUnitId, requestOptions) {
26
26
  return super.createForAdRequest(adUnitId, requestOptions);
27
27
  }
28
-
29
28
  addAdEventsListener(listener) {
30
29
  return this._addAdEventsListener(listener);
31
30
  }
32
-
33
31
  addAdEventListener(type, listener) {
34
32
  return this._addAdEventListener(type, listener);
35
33
  }
36
-
37
34
  }
38
35
  //# sourceMappingURL=GAMInterstitialAd.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["GAMInterstitialAd.ts"],"names":["InterstitialAd","GAMInterstitialAd","createForAdRequest","adUnitId","requestOptions","addAdEventsListener","listener","_addAdEventsListener","addAdEventListener","type","_addAdEventListener"],"mappings":"AAKA,SAASA,cAAT,QAA+B,kBAA/B;AAEA,OAAO,MAAMC,iBAAN,SAAgCD,cAAhC,CAA+C;AACpD;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC2B,SAAlBE,kBAAkB,CAACC,QAAD,EAAmBC,cAAnB,EAAoD;AAC3E,WAAO,MAAMF,kBAAN,CAAyBC,QAAzB,EAAmCC,cAAnC,CAAP;AACD;;AAEDC,EAAAA,mBAAmB,CAAyCC,QAAzC,EAAwE;AACzF,WAAO,KAAKC,oBAAL,CAA0BD,QAA1B,CAAP;AACD;;AAEDE,EAAAA,kBAAkB,CAChBC,IADgB,EAEhBH,QAFgB,EAGhB;AACA,WAAO,KAAKI,mBAAL,CAAyBD,IAAzB,EAA+BH,QAA/B,CAAP;AACD;;AApCmD","sourcesContent":["import { AdEventType } from '../AdEventType';\nimport { GAMAdEventType } from '../GAMAdEventType';\nimport { AdEventListener } from '../types/AdEventListener';\nimport { AdEventsListener } from '../types/AdEventsListener';\nimport { RequestOptions } from '../types/RequestOptions';\nimport { InterstitialAd } from './InterstitialAd';\n\nexport class GAMInterstitialAd extends InterstitialAd {\n /**\n * Creates a new GAMInterstitialAd instance.\n *\n * #### Example\n *\n * ```js\n * import { GAMInterstitialAd, AdEventType, TestIds } from 'react-native-google-mobile-ads';\n *\n * const interstitialAd = await GAMInterstitialAd.createForAdRequest(TestIds.GAM_INTERSTITIAL, {\n * requestAgent: 'CoolAds',\n * });\n *\n * interstitialAd.addAdEventListener(AdEventType.Loaded, () => {\n * interstitialAd.show();\n * });\n *\n * interstitialAd.load();\n * ```\n *\n * @param adUnitId The Ad Unit ID for the Interstitial. You can find this on your Google Mobile Ads dashboard.\n * @param requestOptions Optional RequestOptions used to load the ad.\n */\n static createForAdRequest(adUnitId: string, requestOptions?: RequestOptions) {\n return super.createForAdRequest(adUnitId, requestOptions) as GAMInterstitialAd;\n }\n\n addAdEventsListener<T extends AdEventType | GAMAdEventType>(listener: AdEventsListener<T>) {\n return this._addAdEventsListener(listener);\n }\n\n addAdEventListener<T extends AdEventType | GAMAdEventType>(\n type: T,\n listener: AdEventListener<T>,\n ) {\n return this._addAdEventListener(type, listener);\n }\n}\n"]}
1
+ {"version":3,"names":["InterstitialAd","GAMInterstitialAd","createForAdRequest","adUnitId","requestOptions","addAdEventsListener","listener","_addAdEventsListener","addAdEventListener","type","_addAdEventListener"],"sources":["GAMInterstitialAd.ts"],"sourcesContent":["import { AdEventType } from '../AdEventType';\nimport { GAMAdEventType } from '../GAMAdEventType';\nimport { AdEventListener } from '../types/AdEventListener';\nimport { AdEventsListener } from '../types/AdEventsListener';\nimport { RequestOptions } from '../types/RequestOptions';\nimport { InterstitialAd } from './InterstitialAd';\n\nexport class GAMInterstitialAd extends InterstitialAd {\n /**\n * Creates a new GAMInterstitialAd instance.\n *\n * #### Example\n *\n * ```js\n * import { GAMInterstitialAd, AdEventType, TestIds } from 'react-native-google-mobile-ads';\n *\n * const interstitialAd = await GAMInterstitialAd.createForAdRequest(TestIds.GAM_INTERSTITIAL, {\n * requestAgent: 'CoolAds',\n * });\n *\n * interstitialAd.addAdEventListener(AdEventType.Loaded, () => {\n * interstitialAd.show();\n * });\n *\n * interstitialAd.load();\n * ```\n *\n * @param adUnitId The Ad Unit ID for the Interstitial. You can find this on your Google Mobile Ads dashboard.\n * @param requestOptions Optional RequestOptions used to load the ad.\n */\n static createForAdRequest(adUnitId: string, requestOptions?: RequestOptions) {\n return super.createForAdRequest(adUnitId, requestOptions) as GAMInterstitialAd;\n }\n\n addAdEventsListener<T extends AdEventType | GAMAdEventType>(listener: AdEventsListener<T>) {\n return this._addAdEventsListener(listener);\n }\n\n addAdEventListener<T extends AdEventType | GAMAdEventType>(\n type: T,\n listener: AdEventListener<T>,\n ) {\n return this._addAdEventListener(type, listener);\n }\n}\n"],"mappings":"AAKA,SAASA,cAAc,QAAQ,kBAAkB;AAEjD,OAAO,MAAMC,iBAAiB,SAASD,cAAc,CAAC;EACpD;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACE,OAAOE,kBAAkB,CAACC,QAAgB,EAAEC,cAA+B,EAAE;IAC3E,OAAO,KAAK,CAACF,kBAAkB,CAACC,QAAQ,EAAEC,cAAc,CAAC;EAC3D;EAEAC,mBAAmB,CAAyCC,QAA6B,EAAE;IACzF,OAAO,IAAI,CAACC,oBAAoB,CAACD,QAAQ,CAAC;EAC5C;EAEAE,kBAAkB,CAChBC,IAAO,EACPH,QAA4B,EAC5B;IACA,OAAO,IAAI,CAACI,mBAAmB,CAACD,IAAI,EAAEH,QAAQ,CAAC;EACjD;AACF"}
@@ -1,5 +1,4 @@
1
1
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
-
3
2
  /*
4
3
  * Copyright (c) 2016-present Invertase Limited & Contributors
5
4
  *
@@ -16,11 +15,11 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
16
15
  * limitations under the License.
17
16
  *
18
17
  */
18
+
19
19
  import { isString } from '../common';
20
20
  import { MobileAds } from '../MobileAds';
21
21
  import { validateAdRequestOptions } from '../validateAdRequestOptions';
22
22
  import { MobileAd } from './MobileAd';
23
-
24
23
  /**
25
24
  * A class for interacting and showing Interstitial Ads.
26
25
  *
@@ -87,9 +86,7 @@ export class InterstitialAd extends MobileAd {
87
86
  if (!isString(adUnitId)) {
88
87
  throw new Error("InterstitialAd.createForAdRequest(*) 'adUnitId' expected an string value.");
89
88
  }
90
-
91
89
  let options = {};
92
-
93
90
  try {
94
91
  options = validateAdRequestOptions(requestOptions);
95
92
  } catch (e) {
@@ -97,20 +94,15 @@ export class InterstitialAd extends MobileAd {
97
94
  throw new Error(`InterstitialAd.createForAdRequest(_, *) ${e.message}.`);
98
95
  }
99
96
  }
100
-
101
97
  const requestId = InterstitialAd._interstitialRequest++;
102
98
  return new InterstitialAd('interstitial', MobileAds(), requestId, adUnitId, options);
103
99
  }
104
-
105
100
  addAdEventsListener(listener) {
106
101
  return this._addAdEventsListener(listener);
107
102
  }
108
-
109
103
  addAdEventListener(type, listener) {
110
104
  return this._addAdEventListener(type, listener);
111
105
  }
112
-
113
106
  }
114
-
115
107
  _defineProperty(InterstitialAd, "_interstitialRequest", 0);
116
108
  //# sourceMappingURL=InterstitialAd.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["InterstitialAd.ts"],"names":["isString","MobileAds","validateAdRequestOptions","MobileAd","InterstitialAd","createForAdRequest","adUnitId","requestOptions","Error","options","e","message","requestId","_interstitialRequest","addAdEventsListener","listener","_addAdEventsListener","addAdEventListener","type","_addAdEventListener"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,SAASA,QAAT,QAAyB,WAAzB;AACA,SAASC,SAAT,QAA0B,cAA1B;AACA,SAASC,wBAAT,QAAyC,6BAAzC;AACA,SAASC,QAAT,QAAyB,YAAzB;;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,cAAN,SAA6BD,QAA7B,CAAsC;AAE3C;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC2B,SAAlBE,kBAAkB,CAACC,QAAD,EAAmBC,cAAnB,EAAoD;AAC3E,QAAI,CAACP,QAAQ,CAACM,QAAD,CAAb,EAAyB;AACvB,YAAM,IAAIE,KAAJ,CAAU,2EAAV,CAAN;AACD;;AAED,QAAIC,OAAO,GAAG,EAAd;;AACA,QAAI;AACFA,MAAAA,OAAO,GAAGP,wBAAwB,CAACK,cAAD,CAAlC;AACD,KAFD,CAEE,OAAOG,CAAP,EAAU;AACV,UAAIA,CAAC,YAAYF,KAAjB,EAAwB;AACtB,cAAM,IAAIA,KAAJ,CAAW,2CAA0CE,CAAC,CAACC,OAAQ,GAA/D,CAAN;AACD;AACF;;AAED,UAAMC,SAAS,GAAGR,cAAc,CAACS,oBAAf,EAAlB;AACA,WAAO,IAAIT,cAAJ,CAAmB,cAAnB,EAAmCH,SAAS,EAA5C,EAAgDW,SAAhD,EAA2DN,QAA3D,EAAqEG,OAArE,CAAP;AACD;;AAEDK,EAAAA,mBAAmB,CAAwBC,QAAxB,EAAuD;AACxE,WAAO,KAAKC,oBAAL,CAA0BD,QAA1B,CAAP;AACD;;AAEDE,EAAAA,kBAAkB,CAAwBC,IAAxB,EAAiCH,QAAjC,EAA+D;AAC/E,WAAO,KAAKI,mBAAL,CAAyBD,IAAzB,EAA+BH,QAA/B,CAAP;AACD;;AAhD0C;;gBAAhCX,c,0BAC6B,C","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 { isString } from '../common';\nimport { MobileAds } from '../MobileAds';\nimport { validateAdRequestOptions } from '../validateAdRequestOptions';\nimport { MobileAd } from './MobileAd';\nimport { AdEventType } from '../AdEventType';\nimport { AdEventListener } from '../types/AdEventListener';\nimport { AdEventsListener } from '../types/AdEventsListener';\nimport { RequestOptions } from '../types/RequestOptions';\n\n/**\n * A class for interacting and showing Interstitial Ads.\n *\n * An Interstitial advert can be pre-loaded and shown at a suitable point in your apps flow, such as at the end of a level\n * in a game. An Interstitial is a full screen advert, laid on-top of your entire application which the user can interact with.\n * Interactions are passed back via events which should be handled accordingly inside of your app.\n *\n * #### Example\n *\n * First create a new Interstitial instance, passing in your Ad Unit ID from the Google Mobile Ads configuration console, and any additional\n * request options. The example below will present a test advert, and only request a non-personalized ad.\n *\n * ```js\n * import { InterstitialAd, TestIds } from 'react-native-google-mobile-ads';\n *\n * const interstitial = InterstitialAd.createForAdRequest(TestIds.INTERSTITIAL, {\n * requestNonPersonalizedAdsOnly: true,\n * });\n * ```\n *\n * Each advert needs to be loaded from Google Mobile Ads before being shown. It is recommended this is performed before the user\n * reaches the checkpoint to show the advert, so it's ready to go. Before loading the advert, we need to setup\n * event listeners to listen for updates from Google Mobile Ads, such as advert loaded or failed to load.\n *\n * Event types match the `AdEventType` interface. Once the advert has loaded, we can trigger it to show:\n *\n * ```js\n * import { AdEventType } from 'react-native-google-mobile-ads';\n *\n * interstitialAd.addAdEventListener(AdEventType.Loaded, () => {\n * interstitialAd.show();\n * });\n *\n * interstitial.load();\n * ```\n *\n * The advert will be presented to the user, and several more events can be triggered such as the user clicking the\n * advert or closing it.\n */\nexport class InterstitialAd extends MobileAd {\n protected static _interstitialRequest = 0;\n /**\n * Creates a new InterstitialAd instance.\n *\n * #### Example\n *\n * ```js\n * import { InterstitialAd, AdEventType, TestIds } from 'react-native-google-mobile-ads';\n *\n * const interstitialAd = await InterstitialAd.createForAdRequest(TestIds.INTERSTITIAL, {\n * requestAgent: 'CoolAds',\n * });\n *\n * interstitialAd.addAdEventListener(AdEventType.Loaded, () => {\n * interstitialAd.show();\n * });\n *\n * interstitialAd.load();\n * ```\n *\n * @param adUnitId The Ad Unit ID for the Interstitial. You can find this on your Google Mobile Ads dashboard.\n * @param requestOptions Optional RequestOptions used to load the ad.\n */\n static createForAdRequest(adUnitId: string, requestOptions?: RequestOptions) {\n if (!isString(adUnitId)) {\n throw new Error(\"InterstitialAd.createForAdRequest(*) 'adUnitId' expected an string value.\");\n }\n\n let options = {};\n try {\n options = validateAdRequestOptions(requestOptions);\n } catch (e) {\n if (e instanceof Error) {\n throw new Error(`InterstitialAd.createForAdRequest(_, *) ${e.message}.`);\n }\n }\n\n const requestId = InterstitialAd._interstitialRequest++;\n return new InterstitialAd('interstitial', MobileAds(), requestId, adUnitId, options);\n }\n\n addAdEventsListener<T extends AdEventType>(listener: AdEventsListener<T>) {\n return this._addAdEventsListener(listener);\n }\n\n addAdEventListener<T extends AdEventType>(type: T, listener: AdEventListener<T>) {\n return this._addAdEventListener(type, listener);\n }\n}\n"]}
1
+ {"version":3,"names":["isString","MobileAds","validateAdRequestOptions","MobileAd","InterstitialAd","createForAdRequest","adUnitId","requestOptions","Error","options","e","message","requestId","_interstitialRequest","addAdEventsListener","listener","_addAdEventsListener","addAdEventListener","type","_addAdEventListener"],"sources":["InterstitialAd.ts"],"sourcesContent":["/*\n * Copyright (c) 2016-present Invertase Limited & Contributors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this library except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\n\nimport { isString } from '../common';\nimport { MobileAds } from '../MobileAds';\nimport { validateAdRequestOptions } from '../validateAdRequestOptions';\nimport { MobileAd } from './MobileAd';\nimport { AdEventType } from '../AdEventType';\nimport { AdEventListener } from '../types/AdEventListener';\nimport { AdEventsListener } from '../types/AdEventsListener';\nimport { RequestOptions } from '../types/RequestOptions';\n\n/**\n * A class for interacting and showing Interstitial Ads.\n *\n * An Interstitial advert can be pre-loaded and shown at a suitable point in your apps flow, such as at the end of a level\n * in a game. An Interstitial is a full screen advert, laid on-top of your entire application which the user can interact with.\n * Interactions are passed back via events which should be handled accordingly inside of your app.\n *\n * #### Example\n *\n * First create a new Interstitial instance, passing in your Ad Unit ID from the Google Mobile Ads configuration console, and any additional\n * request options. The example below will present a test advert, and only request a non-personalized ad.\n *\n * ```js\n * import { InterstitialAd, TestIds } from 'react-native-google-mobile-ads';\n *\n * const interstitial = InterstitialAd.createForAdRequest(TestIds.INTERSTITIAL, {\n * requestNonPersonalizedAdsOnly: true,\n * });\n * ```\n *\n * Each advert needs to be loaded from Google Mobile Ads before being shown. It is recommended this is performed before the user\n * reaches the checkpoint to show the advert, so it's ready to go. Before loading the advert, we need to setup\n * event listeners to listen for updates from Google Mobile Ads, such as advert loaded or failed to load.\n *\n * Event types match the `AdEventType` interface. Once the advert has loaded, we can trigger it to show:\n *\n * ```js\n * import { AdEventType } from 'react-native-google-mobile-ads';\n *\n * interstitialAd.addAdEventListener(AdEventType.Loaded, () => {\n * interstitialAd.show();\n * });\n *\n * interstitial.load();\n * ```\n *\n * The advert will be presented to the user, and several more events can be triggered such as the user clicking the\n * advert or closing it.\n */\nexport class InterstitialAd extends MobileAd {\n protected static _interstitialRequest = 0;\n /**\n * Creates a new InterstitialAd instance.\n *\n * #### Example\n *\n * ```js\n * import { InterstitialAd, AdEventType, TestIds } from 'react-native-google-mobile-ads';\n *\n * const interstitialAd = await InterstitialAd.createForAdRequest(TestIds.INTERSTITIAL, {\n * requestAgent: 'CoolAds',\n * });\n *\n * interstitialAd.addAdEventListener(AdEventType.Loaded, () => {\n * interstitialAd.show();\n * });\n *\n * interstitialAd.load();\n * ```\n *\n * @param adUnitId The Ad Unit ID for the Interstitial. You can find this on your Google Mobile Ads dashboard.\n * @param requestOptions Optional RequestOptions used to load the ad.\n */\n static createForAdRequest(adUnitId: string, requestOptions?: RequestOptions) {\n if (!isString(adUnitId)) {\n throw new Error(\"InterstitialAd.createForAdRequest(*) 'adUnitId' expected an string value.\");\n }\n\n let options = {};\n try {\n options = validateAdRequestOptions(requestOptions);\n } catch (e) {\n if (e instanceof Error) {\n throw new Error(`InterstitialAd.createForAdRequest(_, *) ${e.message}.`);\n }\n }\n\n const requestId = InterstitialAd._interstitialRequest++;\n return new InterstitialAd('interstitial', MobileAds(), requestId, adUnitId, options);\n }\n\n addAdEventsListener<T extends AdEventType>(listener: AdEventsListener<T>) {\n return this._addAdEventsListener(listener);\n }\n\n addAdEventListener<T extends AdEventType>(type: T, listener: AdEventListener<T>) {\n return this._addAdEventListener(type, listener);\n }\n}\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,QAAQ,QAAQ,WAAW;AACpC,SAASC,SAAS,QAAQ,cAAc;AACxC,SAASC,wBAAwB,QAAQ,6BAA6B;AACtE,SAASC,QAAQ,QAAQ,YAAY;AAMrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,cAAc,SAASD,QAAQ,CAAC;EAE3C;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACE,OAAOE,kBAAkB,C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