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.
- package/LICENSE +32 -0
- package/README.md +65 -0
- package/RNGoogleMobileAds.podspec +42 -0
- package/__tests__/consent.test.ts +25 -0
- package/__tests__/googleMobileAds.test.ts +63 -0
- package/__tests__/interstitial.test.ts +53 -0
- package/__tests__/requestOptions.test.tsx +4 -0
- package/__tests__/rewarded.test.tsx +4 -0
- package/__tests__/showOptions.test.tsx +4 -0
- package/android/.editorconfig +10 -0
- package/android/app-json.gradle +69 -0
- package/android/build.gradle +98 -0
- package/android/lint.xml +5 -0
- package/android/settings.gradle +1 -0
- package/android/src/main/AndroidManifest.xml +17 -0
- package/android/src/main/java/io/invertase/googlemobileads/ReactNativeAppModule.java +169 -0
- package/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsAppOpenModule.java +161 -0
- package/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsBannerAdViewManager.java +209 -0
- package/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsCommon.java +256 -0
- package/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsConsentModule.java +226 -0
- package/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsEvent.java +72 -0
- package/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsInterstitialModule.java +159 -0
- package/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsModule.java +143 -0
- package/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsPackage.java +48 -0
- package/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsRewardedModule.java +177 -0
- package/android/src/main/java/io/invertase/googlemobileads/common/RCTConvert.java +111 -0
- package/android/src/main/java/io/invertase/googlemobileads/common/ReactNativeApp.java +34 -0
- package/android/src/main/java/io/invertase/googlemobileads/common/ReactNativeEvent.java +41 -0
- package/android/src/main/java/io/invertase/googlemobileads/common/ReactNativeEventEmitter.java +150 -0
- package/android/src/main/java/io/invertase/googlemobileads/common/ReactNativeInitProvider.java +77 -0
- package/android/src/main/java/io/invertase/googlemobileads/common/ReactNativeJSON.java +107 -0
- package/android/src/main/java/io/invertase/googlemobileads/common/ReactNativeMeta.java +92 -0
- package/android/src/main/java/io/invertase/googlemobileads/common/ReactNativeModule.java +96 -0
- package/android/src/main/java/io/invertase/googlemobileads/common/ReactNativePreferences.java +86 -0
- package/android/src/main/java/io/invertase/googlemobileads/common/SharedUtils.java +427 -0
- package/android/src/main/java/io/invertase/googlemobileads/common/TaskExecutorService.java +124 -0
- package/android/src/main/java/io/invertase/googlemobileads/interfaces/ContextProvider.java +30 -0
- package/android/src/main/java/io/invertase/googlemobileads/interfaces/NativeError.java +28 -0
- package/android/src/main/java/io/invertase/googlemobileads/interfaces/NativeEvent.java +26 -0
- package/babel.config.js +18 -0
- package/docs/displaying-ads.mdx +319 -0
- package/docs/european-user-consent.mdx +258 -0
- package/docs/img/logo_admob_192px.svg +19 -0
- package/docs/index.mdx +168 -0
- package/docs.json +9 -0
- package/ios/RNGoogleMobileAds/RNGoogleMobileAdsAppOpenModule.h +29 -0
- package/ios/RNGoogleMobileAds/RNGoogleMobileAdsAppOpenModule.m +98 -0
- package/ios/RNGoogleMobileAds/RNGoogleMobileAdsBannerViewManager.h +23 -0
- package/ios/RNGoogleMobileAds/RNGoogleMobileAdsBannerViewManager.m +153 -0
- package/ios/RNGoogleMobileAds/RNGoogleMobileAdsCommon.h +60 -0
- package/ios/RNGoogleMobileAds/RNGoogleMobileAdsCommon.m +201 -0
- package/ios/RNGoogleMobileAds/RNGoogleMobileAdsConsentModule.h +26 -0
- package/ios/RNGoogleMobileAds/RNGoogleMobileAdsConsentModule.m +179 -0
- package/ios/RNGoogleMobileAds/RNGoogleMobileAdsFullScreenContentDelegate.h +32 -0
- package/ios/RNGoogleMobileAds/RNGoogleMobileAdsFullScreenContentDelegate.m +57 -0
- package/ios/RNGoogleMobileAds/RNGoogleMobileAdsInterstitialModule.h +25 -0
- package/ios/RNGoogleMobileAds/RNGoogleMobileAdsInterstitialModule.m +124 -0
- package/ios/RNGoogleMobileAds/RNGoogleMobileAdsModule.h +24 -0
- package/ios/RNGoogleMobileAds/RNGoogleMobileAdsModule.m +104 -0
- package/ios/RNGoogleMobileAds/RNGoogleMobileAdsRewardedModule.h +25 -0
- package/ios/RNGoogleMobileAds/RNGoogleMobileAdsRewardedModule.m +173 -0
- package/ios/RNGoogleMobileAds/common/RNAppModule.h +24 -0
- package/ios/RNGoogleMobileAds/common/RNAppModule.m +158 -0
- package/ios/RNGoogleMobileAds/common/RNJSON.h +34 -0
- package/ios/RNGoogleMobileAds/common/RNJSON.m +93 -0
- package/ios/RNGoogleMobileAds/common/RNMeta.h +30 -0
- package/ios/RNGoogleMobileAds/common/RNMeta.m +61 -0
- package/ios/RNGoogleMobileAds/common/RNPreferences.h +44 -0
- package/ios/RNGoogleMobileAds/common/RNPreferences.m +94 -0
- package/ios/RNGoogleMobileAds/common/RNRCTEventEmitter.h +73 -0
- package/ios/RNGoogleMobileAds/common/RNRCTEventEmitter.m +150 -0
- package/ios/RNGoogleMobileAds/common/RNSharedUtils.h +48 -0
- package/ios/RNGoogleMobileAds/common/RNSharedUtils.m +56 -0
- package/ios/RNGoogleMobileAds.xcodeproj/project.pbxproj +377 -0
- package/ios/RNGoogleMobileAds.xcodeproj/xcshareddata/IDETemplateMacros.plist +24 -0
- package/ios_config.sh +140 -0
- package/jest.config.js +6 -0
- package/jest.setup.ts +29 -0
- package/lib/commonjs/AdEventType.js +34 -0
- package/lib/commonjs/AdEventType.js.map +1 -0
- package/lib/commonjs/AdsConsent.js +160 -0
- package/lib/commonjs/AdsConsent.js.map +1 -0
- package/lib/commonjs/AdsConsentDebugGeography.js +38 -0
- package/lib/commonjs/AdsConsentDebugGeography.js.map +1 -0
- package/lib/commonjs/AdsConsentStatus.js +36 -0
- package/lib/commonjs/AdsConsentStatus.js.map +1 -0
- package/lib/commonjs/BannerAdSize.js +38 -0
- package/lib/commonjs/BannerAdSize.js.map +1 -0
- package/lib/commonjs/MaxAdContentRating.js +33 -0
- package/lib/commonjs/MaxAdContentRating.js.map +1 -0
- package/lib/commonjs/MobileAds.js +67 -0
- package/lib/commonjs/MobileAds.js.map +1 -0
- package/lib/commonjs/RewardedAdEventType.js +31 -0
- package/lib/commonjs/RewardedAdEventType.js.map +1 -0
- package/lib/commonjs/TestIds.js +47 -0
- package/lib/commonjs/TestIds.js.map +1 -0
- package/lib/commonjs/ads/AppOpenAd.js +96 -0
- package/lib/commonjs/ads/AppOpenAd.js.map +1 -0
- package/lib/commonjs/ads/BannerAd.js +128 -0
- package/lib/commonjs/ads/BannerAd.js.map +1 -0
- package/lib/commonjs/ads/InterstitialAd.js +163 -0
- package/lib/commonjs/ads/InterstitialAd.js.map +1 -0
- package/lib/commonjs/ads/MobileAd.js +90 -0
- package/lib/commonjs/ads/MobileAd.js.map +1 -0
- package/lib/commonjs/ads/RewardedAd.js +169 -0
- package/lib/commonjs/ads/RewardedAd.js.map +1 -0
- package/lib/commonjs/common/Base64.js +121 -0
- package/lib/commonjs/common/Base64.js.map +1 -0
- package/lib/commonjs/common/MutatableParams.js +46 -0
- package/lib/commonjs/common/MutatableParams.js.map +1 -0
- package/lib/commonjs/common/ReferenceBase.js +59 -0
- package/lib/commonjs/common/ReferenceBase.js.map +1 -0
- package/lib/commonjs/common/deeps.js +101 -0
- package/lib/commonjs/common/deeps.js.map +1 -0
- package/lib/commonjs/common/id.js +82 -0
- package/lib/commonjs/common/id.js.map +1 -0
- package/lib/commonjs/common/index.js +212 -0
- package/lib/commonjs/common/index.js.map +1 -0
- package/lib/commonjs/common/path.js +144 -0
- package/lib/commonjs/common/path.js.map +1 -0
- package/lib/commonjs/common/promise.js +70 -0
- package/lib/commonjs/common/promise.js.map +1 -0
- package/lib/commonjs/common/serialize.js +52 -0
- package/lib/commonjs/common/serialize.js.map +1 -0
- package/lib/commonjs/common/validate.js +239 -0
- package/lib/commonjs/common/validate.js.map +1 -0
- package/lib/commonjs/declarations.d.js +2 -0
- package/lib/commonjs/declarations.d.js.map +1 -0
- package/lib/commonjs/index.js +143 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/internal/GoogleMobileAdsNativeEventEmitter.js +76 -0
- package/lib/commonjs/internal/GoogleMobileAdsNativeEventEmitter.js.map +1 -0
- package/lib/commonjs/internal/Module.js +60 -0
- package/lib/commonjs/internal/Module.js.map +1 -0
- package/lib/commonjs/internal/NativeError.js +70 -0
- package/lib/commonjs/internal/NativeError.js.map +1 -0
- package/lib/commonjs/internal/SharedEventEmitter.js +31 -0
- package/lib/commonjs/internal/SharedEventEmitter.js.map +1 -0
- package/lib/commonjs/internal/constants.js +30 -0
- package/lib/commonjs/internal/constants.js.map +1 -0
- package/lib/commonjs/internal/index.js +49 -0
- package/lib/commonjs/internal/index.js.map +1 -0
- package/lib/commonjs/internal/registry/nativeModule.js +231 -0
- package/lib/commonjs/internal/registry/nativeModule.js.map +1 -0
- package/lib/commonjs/types/AdEventListener.js +6 -0
- package/lib/commonjs/types/AdEventListener.js.map +1 -0
- package/lib/commonjs/types/AdShowOptions.js +2 -0
- package/lib/commonjs/types/AdShowOptions.js.map +1 -0
- package/lib/commonjs/types/AdapterStatus.js +18 -0
- package/lib/commonjs/types/AdapterStatus.js.map +1 -0
- package/lib/commonjs/types/AdsConsent.interface.js +6 -0
- package/lib/commonjs/types/AdsConsent.interface.js.map +1 -0
- package/lib/commonjs/types/BannerAdProps.js +6 -0
- package/lib/commonjs/types/BannerAdProps.js.map +1 -0
- package/lib/commonjs/types/GoogleMobileAdsNativeModule.js +6 -0
- package/lib/commonjs/types/GoogleMobileAdsNativeModule.js.map +1 -0
- package/lib/commonjs/types/MobileAd.interface.js +6 -0
- package/lib/commonjs/types/MobileAd.interface.js.map +1 -0
- package/lib/commonjs/types/MobileAdsModule.interface.js +6 -0
- package/lib/commonjs/types/MobileAdsModule.interface.js.map +1 -0
- package/lib/commonjs/types/Module.interface.js +2 -0
- package/lib/commonjs/types/Module.interface.js.map +1 -0
- package/lib/commonjs/types/RequestConfiguration.js +6 -0
- package/lib/commonjs/types/RequestConfiguration.js.map +1 -0
- package/lib/commonjs/types/RequestOptions.js +2 -0
- package/lib/commonjs/types/RequestOptions.js.map +1 -0
- package/lib/commonjs/types/RewardedAdReward.js +2 -0
- package/lib/commonjs/types/RewardedAdReward.js.map +1 -0
- package/lib/commonjs/validateAdRequestConfiguration.js +69 -0
- package/lib/commonjs/validateAdRequestConfiguration.js.map +1 -0
- package/lib/commonjs/validateAdRequestOptions.js +158 -0
- package/lib/commonjs/validateAdRequestOptions.js.map +1 -0
- package/lib/commonjs/validateAdShowOptions.js +47 -0
- package/lib/commonjs/validateAdShowOptions.js.map +1 -0
- package/lib/commonjs/version.js +10 -0
- package/lib/commonjs/version.js.map +1 -0
- package/lib/module/AdEventType.js +26 -0
- package/lib/module/AdEventType.js.map +1 -0
- package/lib/module/AdsConsent.js +148 -0
- package/lib/module/AdsConsent.js.map +1 -0
- package/lib/module/AdsConsentDebugGeography.js +30 -0
- package/lib/module/AdsConsentDebugGeography.js.map +1 -0
- package/lib/module/AdsConsentStatus.js +28 -0
- package/lib/module/AdsConsentStatus.js.map +1 -0
- package/lib/module/BannerAdSize.js +30 -0
- package/lib/module/BannerAdSize.js.map +1 -0
- package/lib/module/MaxAdContentRating.js +25 -0
- package/lib/module/MaxAdContentRating.js.map +1 -0
- package/lib/module/MobileAds.js +53 -0
- package/lib/module/MobileAds.js.map +1 -0
- package/lib/module/RewardedAdEventType.js +23 -0
- package/lib/module/RewardedAdEventType.js.map +1 -0
- package/lib/module/TestIds.js +38 -0
- package/lib/module/TestIds.js.map +1 -0
- package/lib/module/ads/AppOpenAd.js +81 -0
- package/lib/module/ads/AppOpenAd.js.map +1 -0
- package/lib/module/ads/BannerAd.js +108 -0
- package/lib/module/ads/BannerAd.js.map +1 -0
- package/lib/module/ads/InterstitialAd.js +149 -0
- package/lib/module/ads/InterstitialAd.js.map +1 -0
- package/lib/module/ads/MobileAd.js +94 -0
- package/lib/module/ads/MobileAd.js.map +1 -0
- package/lib/module/ads/RewardedAd.js +155 -0
- package/lib/module/ads/RewardedAd.js.map +1 -0
- package/lib/module/common/Base64.js +106 -0
- package/lib/module/common/Base64.js.map +1 -0
- package/lib/module/common/MutatableParams.js +52 -0
- package/lib/module/common/MutatableParams.js.map +1 -0
- package/lib/module/common/ReferenceBase.js +50 -0
- package/lib/module/common/ReferenceBase.js.map +1 -0
- package/lib/module/common/deeps.js +91 -0
- package/lib/module/common/deeps.js.map +1 -0
- package/lib/module/common/id.js +74 -0
- package/lib/module/common/id.js.map +1 -0
- package/lib/module/common/index.js +109 -0
- package/lib/module/common/index.js.map +1 -0
- package/lib/module/common/path.js +120 -0
- package/lib/module/common/path.js.map +1 -0
- package/lib/module/common/promise.js +60 -0
- package/lib/module/common/promise.js.map +1 -0
- package/lib/module/common/serialize.js +41 -0
- package/lib/module/common/serialize.js.map +1 -0
- package/lib/module/common/validate.js +197 -0
- package/lib/module/common/validate.js.map +1 -0
- package/lib/module/declarations.d.js +2 -0
- package/lib/module/declarations.d.js.map +1 -0
- package/lib/module/index.js +33 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/internal/GoogleMobileAdsNativeEventEmitter.js +83 -0
- package/lib/module/internal/GoogleMobileAdsNativeEventEmitter.js.map +1 -0
- package/lib/module/internal/Module.js +64 -0
- package/lib/module/internal/Module.js.map +1 -0
- package/lib/module/internal/NativeError.js +61 -0
- package/lib/module/internal/NativeError.js.map +1 -0
- package/lib/module/internal/SharedEventEmitter.js +20 -0
- package/lib/module/internal/SharedEventEmitter.js.map +1 -0
- package/lib/module/internal/constants.js +20 -0
- package/lib/module/internal/constants.js.map +1 -0
- package/lib/module/internal/index.js +21 -0
- package/lib/module/internal/index.js.map +1 -0
- package/lib/module/internal/registry/nativeModule.js +215 -0
- package/lib/module/internal/registry/nativeModule.js.map +1 -0
- package/lib/module/types/AdEventListener.js +2 -0
- package/lib/module/types/AdEventListener.js.map +1 -0
- package/lib/module/types/AdShowOptions.js +2 -0
- package/lib/module/types/AdShowOptions.js.map +1 -0
- package/lib/module/types/AdapterStatus.js +10 -0
- package/lib/module/types/AdapterStatus.js.map +1 -0
- package/lib/module/types/AdsConsent.interface.js +2 -0
- package/lib/module/types/AdsConsent.interface.js.map +1 -0
- package/lib/module/types/BannerAdProps.js +2 -0
- package/lib/module/types/BannerAdProps.js.map +1 -0
- package/lib/module/types/GoogleMobileAdsNativeModule.js +2 -0
- package/lib/module/types/GoogleMobileAdsNativeModule.js.map +1 -0
- package/lib/module/types/MobileAd.interface.js +2 -0
- package/lib/module/types/MobileAd.interface.js.map +1 -0
- package/lib/module/types/MobileAdsModule.interface.js +2 -0
- package/lib/module/types/MobileAdsModule.interface.js.map +1 -0
- package/lib/module/types/Module.interface.js +2 -0
- package/lib/module/types/Module.interface.js.map +1 -0
- package/lib/module/types/RequestConfiguration.js +2 -0
- package/lib/module/types/RequestConfiguration.js.map +1 -0
- package/lib/module/types/RequestOptions.js +2 -0
- package/lib/module/types/RequestOptions.js.map +1 -0
- package/lib/module/types/RewardedAdReward.js +2 -0
- package/lib/module/types/RewardedAdReward.js.map +1 -0
- package/lib/module/validateAdRequestConfiguration.js +60 -0
- package/lib/module/validateAdRequestConfiguration.js.map +1 -0
- package/lib/module/validateAdRequestOptions.js +150 -0
- package/lib/module/validateAdRequestOptions.js.map +1 -0
- package/lib/module/validateAdShowOptions.js +39 -0
- package/lib/module/validateAdShowOptions.js.map +1 -0
- package/lib/module/version.js +3 -0
- package/lib/module/version.js.map +1 -0
- package/lib/typescript/AdEventType.d.ts +47 -0
- package/lib/typescript/AdsConsent.d.ts +2 -0
- package/lib/typescript/AdsConsentDebugGeography.d.ts +19 -0
- package/lib/typescript/AdsConsentStatus.d.ts +17 -0
- package/lib/typescript/BannerAdSize.d.ts +34 -0
- package/lib/typescript/MaxAdContentRating.d.ts +18 -0
- package/lib/typescript/MobileAds.d.ts +11 -0
- package/lib/typescript/RewardedAdEventType.d.ts +46 -0
- package/lib/typescript/TestIds.d.ts +6 -0
- package/lib/typescript/ads/AppOpenAd.d.ts +11 -0
- package/lib/typescript/ads/BannerAd.d.ts +3 -0
- package/lib/typescript/ads/InterstitialAd.d.ts +78 -0
- package/lib/typescript/ads/MobileAd.d.ts +32 -0
- package/lib/typescript/ads/RewardedAd.d.ts +84 -0
- package/lib/typescript/common/Base64.d.ts +14 -0
- package/lib/typescript/common/MutatableParams.d.ts +9 -0
- package/lib/typescript/common/ReferenceBase.d.ts +11 -0
- package/lib/typescript/common/deeps.d.ts +18 -0
- package/lib/typescript/common/id.d.ts +11 -0
- package/lib/typescript/common/index.d.ts +28 -0
- package/lib/typescript/common/path.d.ts +43 -0
- package/lib/typescript/common/promise.d.ts +13 -0
- package/lib/typescript/common/serialize.d.ts +5 -0
- package/lib/typescript/common/validate.d.ts +90 -0
- package/lib/typescript/index.d.ts +14 -0
- package/lib/typescript/internal/GoogleMobileAdsNativeEventEmitter.d.ts +12 -0
- package/lib/typescript/internal/Module.d.ts +13 -0
- package/lib/typescript/internal/NativeError.d.ts +26 -0
- package/lib/typescript/internal/SharedEventEmitter.d.ts +2 -0
- package/lib/typescript/internal/constants.d.ts +3 -0
- package/lib/typescript/internal/index.d.ts +4 -0
- package/lib/typescript/internal/registry/nativeModule.d.ts +15 -0
- package/lib/typescript/types/AdEventListener.d.ts +11 -0
- package/lib/typescript/types/AdShowOptions.d.ts +12 -0
- package/lib/typescript/types/AdapterStatus.d.ts +18 -0
- package/lib/typescript/types/AdsConsent.interface.d.ts +286 -0
- package/lib/typescript/types/BannerAdProps.d.ts +66 -0
- package/lib/typescript/types/GoogleMobileAdsNativeModule.d.ts +14 -0
- package/lib/typescript/types/MobileAd.interface.d.ts +64 -0
- package/lib/typescript/types/MobileAdsModule.interface.d.ts +38 -0
- package/lib/typescript/types/Module.interface.d.ts +14 -0
- package/lib/typescript/types/RequestConfiguration.d.ts +36 -0
- package/lib/typescript/types/RequestOptions.d.ts +106 -0
- package/lib/typescript/types/RewardedAdReward.d.ts +13 -0
- package/lib/typescript/validateAdRequestConfiguration.d.ts +2 -0
- package/lib/typescript/validateAdRequestOptions.d.ts +2 -0
- package/lib/typescript/validateAdShowOptions.d.ts +2 -0
- package/lib/typescript/version.d.ts +1 -0
- package/package.json +143 -0
- package/react-native.config.js +19 -0
- package/src/AdEventType.ts +68 -0
- package/src/AdsConsent.ts +191 -0
- package/src/AdsConsentDebugGeography.ts +38 -0
- package/src/AdsConsentStatus.ts +36 -0
- package/src/BannerAdSize.ts +59 -0
- package/src/MaxAdContentRating.ts +38 -0
- package/src/MobileAds.ts +84 -0
- package/src/RewardedAdEventType.ts +64 -0
- package/src/TestIds.ts +39 -0
- package/src/ads/AppOpenAd.ts +85 -0
- package/src/ads/BannerAd.tsx +126 -0
- package/src/ads/InterstitialAd.ts +156 -0
- package/src/ads/MobileAd.ts +101 -0
- package/src/ads/RewardedAd.ts +161 -0
- package/src/common/Base64.ts +114 -0
- package/src/common/MutatableParams.ts +50 -0
- package/src/common/ReferenceBase.ts +45 -0
- package/src/common/deeps.ts +88 -0
- package/src/common/id.ts +74 -0
- package/src/common/index.ts +103 -0
- package/src/common/path.ts +114 -0
- package/src/common/promise.ts +66 -0
- package/src/common/serialize.ts +43 -0
- package/src/common/validate.ts +205 -0
- package/src/declarations.d.ts +3 -0
- package/src/index.ts +35 -0
- package/src/internal/GoogleMobileAdsNativeEventEmitter.ts +81 -0
- package/src/internal/Module.ts +58 -0
- package/src/internal/NativeError.ts +56 -0
- package/src/internal/SharedEventEmitter.ts +22 -0
- package/src/internal/constants.ts +43 -0
- package/src/internal/index.ts +21 -0
- package/src/internal/registry/nativeModule.ts +226 -0
- package/src/types/AdEventListener.ts +16 -0
- package/src/types/AdShowOptions.ts +12 -0
- package/src/types/AdapterStatus.ts +20 -0
- package/src/types/AdsConsent.interface.ts +306 -0
- package/src/types/BannerAdProps.ts +73 -0
- package/src/types/GoogleMobileAdsNativeModule.ts +15 -0
- package/src/types/MobileAd.interface.ts +69 -0
- package/src/types/MobileAdsModule.interface.ts +43 -0
- package/src/types/Module.interface.ts +16 -0
- package/src/types/RequestConfiguration.ts +40 -0
- package/src/types/RequestOptions.ts +113 -0
- package/src/types/RewardedAdReward.ts +14 -0
- package/src/validateAdRequestConfiguration.ts +71 -0
- package/src/validateAdRequestOptions.ts +168 -0
- package/src/validateAdShowOptions.ts +41 -0
- package/src/version.ts +2 -0
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.isAlphaNumericUnderscore = isAlphaNumericUnderscore;
|
|
7
|
+
exports.isArray = isArray;
|
|
8
|
+
exports.isBoolean = isBoolean;
|
|
9
|
+
exports.isDate = isDate;
|
|
10
|
+
exports.isFinite = isFinite;
|
|
11
|
+
exports.isFunction = isFunction;
|
|
12
|
+
exports.isInteger = isInteger;
|
|
13
|
+
exports.isNull = isNull;
|
|
14
|
+
exports.isNumber = isNumber;
|
|
15
|
+
exports.isObject = isObject;
|
|
16
|
+
exports.isOneOf = isOneOf;
|
|
17
|
+
exports.isString = isString;
|
|
18
|
+
exports.isUndefined = isUndefined;
|
|
19
|
+
exports.isValidUrl = isValidUrl;
|
|
20
|
+
exports.noop = noop;
|
|
21
|
+
exports.objectKeyValuesAreStrings = objectKeyValuesAreStrings;
|
|
22
|
+
exports.validateOptionalNativeDependencyExists = validateOptionalNativeDependencyExists;
|
|
23
|
+
|
|
24
|
+
var _reactNative = require("react-native");
|
|
25
|
+
|
|
26
|
+
/*
|
|
27
|
+
* Copyright (c) 2016-present Invertase Limited & Contributors
|
|
28
|
+
*
|
|
29
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
30
|
+
* you may not use this library except in compliance with the License.
|
|
31
|
+
* You may obtain a copy of the License at
|
|
32
|
+
*
|
|
33
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
34
|
+
*
|
|
35
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
36
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
37
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
38
|
+
* See the License for the specific language governing permissions and
|
|
39
|
+
* limitations under the License.
|
|
40
|
+
*
|
|
41
|
+
*/
|
|
42
|
+
const AlphaNumericUnderscore = /^[a-zA-Z0-9_]+$/;
|
|
43
|
+
|
|
44
|
+
function objectKeyValuesAreStrings(object) {
|
|
45
|
+
if (!isObject(object)) {
|
|
46
|
+
return false;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const entries = Object.entries(object);
|
|
50
|
+
|
|
51
|
+
for (let i = 0; i < entries.length; i++) {
|
|
52
|
+
const [key, value] = entries[i];
|
|
53
|
+
|
|
54
|
+
if (!isString(key) || !isString(value)) {
|
|
55
|
+
return false;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return true;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Simple is null check.
|
|
63
|
+
*
|
|
64
|
+
* @param value
|
|
65
|
+
* @returns {boolean}
|
|
66
|
+
*/
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
function isNull(value) {
|
|
70
|
+
return value === null;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Simple is object check.
|
|
74
|
+
*
|
|
75
|
+
* @param value
|
|
76
|
+
* @returns {boolean}
|
|
77
|
+
*/
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
function isObject(value) {
|
|
81
|
+
return value ? typeof value === 'object' && !Array.isArray(value) && !isNull(value) : false;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Simple is date check
|
|
85
|
+
* https://stackoverflow.com/a/44198641
|
|
86
|
+
* @param value
|
|
87
|
+
* @returns {boolean}
|
|
88
|
+
*/
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
function isDate(value) {
|
|
92
|
+
// use the global isNaN() and not Number.isNaN() since it will validate an Invalid Date
|
|
93
|
+
return value && Object.prototype.toString.call(value) === '[object Date]' && !isNaN(value);
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Simple is function check
|
|
97
|
+
*
|
|
98
|
+
* @param value
|
|
99
|
+
* @returns {*|boolean}
|
|
100
|
+
*/
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
function isFunction(value) {
|
|
104
|
+
return value ? typeof value === 'function' : false;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Simple is string check
|
|
108
|
+
* @param value
|
|
109
|
+
* @return {boolean}
|
|
110
|
+
*/
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
function isString(value) {
|
|
114
|
+
return typeof value === 'string';
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Simple is number check
|
|
118
|
+
* @param value
|
|
119
|
+
* @return {boolean}
|
|
120
|
+
*/
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
function isNumber(value) {
|
|
124
|
+
return typeof value === 'number';
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Simple finite check
|
|
128
|
+
* @param value
|
|
129
|
+
* @returns {boolean}
|
|
130
|
+
*/
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
function isFinite(value) {
|
|
134
|
+
return Number.isFinite(value);
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Simple integer check
|
|
138
|
+
* @param value
|
|
139
|
+
* @returns {boolean}
|
|
140
|
+
*/
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
function isInteger(value) {
|
|
144
|
+
return Number.isInteger(value);
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Simple is boolean check
|
|
148
|
+
*
|
|
149
|
+
* @param value
|
|
150
|
+
* @return {boolean}
|
|
151
|
+
*/
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
function isBoolean(value) {
|
|
155
|
+
return typeof value === 'boolean';
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
*
|
|
159
|
+
* @param value
|
|
160
|
+
* @returns {arg is Array<unknown>}
|
|
161
|
+
*/
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
function isArray(value) {
|
|
165
|
+
return Array.isArray(value);
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
*
|
|
169
|
+
* @param value
|
|
170
|
+
* @returns {boolean}
|
|
171
|
+
*/
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
function isUndefined(value) {
|
|
175
|
+
return typeof value === 'undefined';
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* /^[a-zA-Z0-9_]+$/
|
|
179
|
+
*
|
|
180
|
+
* @param value
|
|
181
|
+
* @returns {boolean}
|
|
182
|
+
*/
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
function isAlphaNumericUnderscore(value) {
|
|
186
|
+
return AlphaNumericUnderscore.test(value);
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* URL test
|
|
190
|
+
* @param url
|
|
191
|
+
* @returns {boolean}
|
|
192
|
+
*/
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
const IS_VALID_URL_REGEX = /^(http|https):\/\/[^ "]+$/;
|
|
196
|
+
|
|
197
|
+
function isValidUrl(url) {
|
|
198
|
+
return IS_VALID_URL_REGEX.test(url);
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* Array includes
|
|
202
|
+
*
|
|
203
|
+
* @param value
|
|
204
|
+
* @param oneOf
|
|
205
|
+
* @returns {boolean}
|
|
206
|
+
*/
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
function isOneOf(value) {
|
|
210
|
+
let oneOf = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
211
|
+
|
|
212
|
+
if (!isArray(oneOf)) {
|
|
213
|
+
return false;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
return oneOf.includes(value);
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
function noop() {// noop-🐈
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
function validateOptionalNativeDependencyExists(firebaseJsonKey, apiName, nativeFnExists) {
|
|
223
|
+
if (nativeFnExists) {
|
|
224
|
+
return;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
let errorMessage = "You attempted to use an optional API that's not enabled natively. \n\n To enable ";
|
|
228
|
+
errorMessage += apiName;
|
|
229
|
+
errorMessage += ` please set the 'react-native' -> '${firebaseJsonKey}' key to true in your firebase.json file`;
|
|
230
|
+
|
|
231
|
+
if (_reactNative.Platform.OS === 'android') {
|
|
232
|
+
errorMessage += ' and rebuild your Android app.';
|
|
233
|
+
} else {
|
|
234
|
+
errorMessage += ', re-run pod install and rebuild your iOS app. ' + "If you're not using Pods then make sure you've have downloaded the necessary Firebase iOS SDK dependencies for this API.";
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
throw new Error(errorMessage);
|
|
238
|
+
}
|
|
239
|
+
//# sourceMappingURL=validate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["validate.ts"],"names":["AlphaNumericUnderscore","objectKeyValuesAreStrings","object","isObject","entries","Object","i","length","key","value","isString","isNull","Array","isArray","isDate","prototype","toString","call","isNaN","isFunction","isNumber","isFinite","Number","isInteger","isBoolean","isUndefined","isAlphaNumericUnderscore","test","IS_VALID_URL_REGEX","isValidUrl","url","isOneOf","oneOf","includes","noop","validateOptionalNativeDependencyExists","firebaseJsonKey","apiName","nativeFnExists","errorMessage","Platform","OS","Error"],"mappings":"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","sourcesContent":["/*\n * Copyright (c) 2016-present Invertase Limited & Contributors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this library except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\n\nimport { Platform } from 'react-native';\n\nconst AlphaNumericUnderscore = /^[a-zA-Z0-9_]+$/;\n\nexport function objectKeyValuesAreStrings(object: Record<string, unknown>) {\n if (!isObject(object)) {\n return false;\n }\n\n const entries = Object.entries(object);\n\n for (let i = 0; i < entries.length; i++) {\n const [key, value] = entries[i];\n if (!isString(key) || !isString(value)) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Simple is null check.\n *\n * @param value\n * @returns {boolean}\n */\nexport function isNull(value: unknown) {\n return value === null;\n}\n\n/**\n * Simple is object check.\n *\n * @param value\n * @returns {boolean}\n */\nexport function isObject(value: unknown) {\n return value ? typeof value === 'object' && !Array.isArray(value) && !isNull(value) : false;\n}\n\n/**\n * Simple is date check\n * https://stackoverflow.com/a/44198641\n * @param value\n * @returns {boolean}\n */\nexport function isDate(value: number) {\n // use the global isNaN() and not Number.isNaN() since it will validate an Invalid Date\n return value && Object.prototype.toString.call(value) === '[object Date]' && !isNaN(value);\n}\n\n/**\n * Simple is function check\n *\n * @param value\n * @returns {*|boolean}\n */\nexport function isFunction(value: unknown) {\n return value ? typeof value === 'function' : false;\n}\n\n/**\n * Simple is string check\n * @param value\n * @return {boolean}\n */\nexport function isString(value: unknown) {\n return typeof value === 'string';\n}\n\n/**\n * Simple is number check\n * @param value\n * @return {boolean}\n */\nexport function isNumber(value: unknown): value is number {\n return typeof value === 'number';\n}\n\n/**\n * Simple finite check\n * @param value\n * @returns {boolean}\n */\nexport function isFinite(value: unknown) {\n return Number.isFinite(value);\n}\n\n/**\n * Simple integer check\n * @param value\n * @returns {boolean}\n */\nexport function isInteger(value: unknown) {\n return Number.isInteger(value);\n}\n\n/**\n * Simple is boolean check\n *\n * @param value\n * @return {boolean}\n */\nexport function isBoolean(value: unknown) {\n return typeof value === 'boolean';\n}\n\n/**\n *\n * @param value\n * @returns {arg is Array<unknown>}\n */\nexport function isArray(value: unknown) {\n return Array.isArray(value);\n}\n\n/**\n *\n * @param value\n * @returns {boolean}\n */\nexport function isUndefined(value: unknown): value is undefined {\n return typeof value === 'undefined';\n}\n\n/**\n * /^[a-zA-Z0-9_]+$/\n *\n * @param value\n * @returns {boolean}\n */\nexport function isAlphaNumericUnderscore(value: string) {\n return AlphaNumericUnderscore.test(value);\n}\n\n/**\n * URL test\n * @param url\n * @returns {boolean}\n */\nconst IS_VALID_URL_REGEX = /^(http|https):\\/\\/[^ \"]+$/;\nexport function isValidUrl(url: string) {\n return IS_VALID_URL_REGEX.test(url);\n}\n\n/**\n * Array includes\n *\n * @param value\n * @param oneOf\n * @returns {boolean}\n */\nexport function isOneOf(value: unknown, oneOf: unknown[] = []) {\n if (!isArray(oneOf)) {\n return false;\n }\n return oneOf.includes(value);\n}\n\nexport function noop() {\n // noop-🐈\n}\n\nexport function validateOptionalNativeDependencyExists(\n firebaseJsonKey: string,\n apiName: string,\n nativeFnExists: boolean,\n) {\n if (nativeFnExists) {\n return;\n }\n let errorMessage =\n \"You attempted to use an optional API that's not enabled natively. \\n\\n To enable \";\n\n errorMessage += apiName;\n errorMessage += ` please set the 'react-native' -> '${firebaseJsonKey}' key to true in your firebase.json file`;\n\n if (Platform.OS === 'android') {\n errorMessage += ' and rebuild your Android app.';\n } else {\n errorMessage +=\n ', re-run pod install and rebuild your iOS app. ' +\n \"If you're not using Pods then make sure you've have downloaded the necessary Firebase iOS SDK dependencies for this API.\";\n }\n\n throw new Error(errorMessage);\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "AdEventType", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _AdEventType.AdEventType;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "AdsConsent", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _AdsConsent.AdsConsent;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "AdsConsentDebugGeography", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () {
|
|
21
|
+
return _AdsConsentDebugGeography.AdsConsentDebugGeography;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
Object.defineProperty(exports, "AdsConsentStatus", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function () {
|
|
27
|
+
return _AdsConsentStatus.AdsConsentStatus;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
Object.defineProperty(exports, "AppOpenAd", {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
get: function () {
|
|
33
|
+
return _AppOpenAd.AppOpenAd;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
Object.defineProperty(exports, "BannerAd", {
|
|
37
|
+
enumerable: true,
|
|
38
|
+
get: function () {
|
|
39
|
+
return _BannerAd.BannerAd;
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
Object.defineProperty(exports, "BannerAdSize", {
|
|
43
|
+
enumerable: true,
|
|
44
|
+
get: function () {
|
|
45
|
+
return _BannerAdSize.BannerAdSize;
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
Object.defineProperty(exports, "InterstitialAd", {
|
|
49
|
+
enumerable: true,
|
|
50
|
+
get: function () {
|
|
51
|
+
return _InterstitialAd.InterstitialAd;
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
Object.defineProperty(exports, "MaxAdContentRating", {
|
|
55
|
+
enumerable: true,
|
|
56
|
+
get: function () {
|
|
57
|
+
return _MaxAdContentRating.MaxAdContentRating;
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
Object.defineProperty(exports, "MobileAds", {
|
|
61
|
+
enumerable: true,
|
|
62
|
+
get: function () {
|
|
63
|
+
return _MobileAds.MobileAds;
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
Object.defineProperty(exports, "RewardedAd", {
|
|
67
|
+
enumerable: true,
|
|
68
|
+
get: function () {
|
|
69
|
+
return _RewardedAd.RewardedAd;
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
Object.defineProperty(exports, "RewardedAdEventType", {
|
|
73
|
+
enumerable: true,
|
|
74
|
+
get: function () {
|
|
75
|
+
return _RewardedAdEventType.RewardedAdEventType;
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
exports.SDK_VERSION = void 0;
|
|
79
|
+
Object.defineProperty(exports, "TestIds", {
|
|
80
|
+
enumerable: true,
|
|
81
|
+
get: function () {
|
|
82
|
+
return _TestIds.TestIds;
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
Object.defineProperty(exports, "default", {
|
|
86
|
+
enumerable: true,
|
|
87
|
+
get: function () {
|
|
88
|
+
return _MobileAds.default;
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
var _version = require("./version");
|
|
93
|
+
|
|
94
|
+
var _MobileAds = _interopRequireWildcard(require("./MobileAds"));
|
|
95
|
+
|
|
96
|
+
var _AdsConsentDebugGeography = require("./AdsConsentDebugGeography");
|
|
97
|
+
|
|
98
|
+
var _AdsConsentStatus = require("./AdsConsentStatus");
|
|
99
|
+
|
|
100
|
+
var _MaxAdContentRating = require("./MaxAdContentRating");
|
|
101
|
+
|
|
102
|
+
var _TestIds = require("./TestIds");
|
|
103
|
+
|
|
104
|
+
var _AdEventType = require("./AdEventType");
|
|
105
|
+
|
|
106
|
+
var _BannerAdSize = require("./BannerAdSize");
|
|
107
|
+
|
|
108
|
+
var _RewardedAdEventType = require("./RewardedAdEventType");
|
|
109
|
+
|
|
110
|
+
var _AdsConsent = require("./AdsConsent");
|
|
111
|
+
|
|
112
|
+
var _AppOpenAd = require("./ads/AppOpenAd");
|
|
113
|
+
|
|
114
|
+
var _InterstitialAd = require("./ads/InterstitialAd");
|
|
115
|
+
|
|
116
|
+
var _RewardedAd = require("./ads/RewardedAd");
|
|
117
|
+
|
|
118
|
+
var _BannerAd = require("./ads/BannerAd");
|
|
119
|
+
|
|
120
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
121
|
+
|
|
122
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
123
|
+
|
|
124
|
+
/*
|
|
125
|
+
* Copyright (c) 2016-present Invertase Limited & Contributors
|
|
126
|
+
*
|
|
127
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
128
|
+
* you may not use this library except in compliance with the License.
|
|
129
|
+
* You may obtain a copy of the License at
|
|
130
|
+
*
|
|
131
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
132
|
+
*
|
|
133
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
134
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
135
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
136
|
+
* See the License for the specific language governing permissions and
|
|
137
|
+
* limitations under the License.
|
|
138
|
+
*
|
|
139
|
+
*/
|
|
140
|
+
// import { SDK_VERSION } from 'react-native-google-mobile-ads';
|
|
141
|
+
const SDK_VERSION = _version.version;
|
|
142
|
+
exports.SDK_VERSION = SDK_VERSION;
|
|
143
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["index.ts"],"names":["SDK_VERSION","version"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiBA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;AAlCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAIA;AACO,MAAMA,WAAW,GAAGC,gBAApB","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 { version } from './version';\n\n// import { SDK_VERSION } from 'react-native-google-mobile-ads';\nexport const SDK_VERSION = version;\n\nexport { default, MobileAds } from './MobileAds';\nexport { AdsConsentDebugGeography } from './AdsConsentDebugGeography';\nexport { AdsConsentStatus } from './AdsConsentStatus';\nexport { MaxAdContentRating } from './MaxAdContentRating';\nexport { TestIds } from './TestIds';\nexport { AdEventType } from './AdEventType';\nexport { BannerAdSize } from './BannerAdSize';\nexport { RewardedAdEventType } from './RewardedAdEventType';\nexport { AdsConsent } from './AdsConsent';\nexport { AppOpenAd } from './ads/AppOpenAd';\nexport { InterstitialAd } from './ads/InterstitialAd';\nexport { RewardedAd } from './ads/RewardedAd';\nexport { BannerAd } from './ads/BannerAd';\n"]}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.GoogleMobileAdsNativeEventEmitter = void 0;
|
|
7
|
+
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
|
|
10
|
+
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; }
|
|
11
|
+
|
|
12
|
+
const {
|
|
13
|
+
RNAppModule
|
|
14
|
+
} = _reactNative.NativeModules;
|
|
15
|
+
|
|
16
|
+
class GANativeEventEmitter extends _reactNative.NativeEventEmitter {
|
|
17
|
+
constructor() {
|
|
18
|
+
super(RNAppModule);
|
|
19
|
+
|
|
20
|
+
_defineProperty(this, "ready", void 0);
|
|
21
|
+
|
|
22
|
+
this.ready = false;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
addListener(eventType, listener, context) {
|
|
26
|
+
if (!this.ready) {
|
|
27
|
+
RNAppModule.eventsNotifyReady(true);
|
|
28
|
+
this.ready = true;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
RNAppModule.eventsAddListener(eventType);
|
|
32
|
+
const subscription = super.addListener(`rnapp_${eventType}`, listener, context); // React Native 0.65+ altered EventEmitter:
|
|
33
|
+
// - removeSubscription is gone
|
|
34
|
+
// - addListener returns an unsubscriber instead of a more complex object with eventType etc
|
|
35
|
+
// make sure eventType for backwards compatibility just in case
|
|
36
|
+
|
|
37
|
+
subscription.eventType = `rnapp_${eventType}`; // New style is to return a remove function on the object, just in csae people call that,
|
|
38
|
+
// we will modify it to do our native unsubscription then call the original
|
|
39
|
+
|
|
40
|
+
const originalRemove = subscription.remove;
|
|
41
|
+
|
|
42
|
+
const newRemove = () => {
|
|
43
|
+
RNAppModule.eventsRemoveListener(eventType, false);
|
|
44
|
+
|
|
45
|
+
if (super.removeSubscription != null) {
|
|
46
|
+
// This is for RN <= 0.64 - 65 and greater no longer have removeSubscription
|
|
47
|
+
super.removeSubscription(subscription);
|
|
48
|
+
} else if (originalRemove != null) {
|
|
49
|
+
// This is for RN >= 0.65
|
|
50
|
+
originalRemove();
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
subscription.remove = newRemove;
|
|
55
|
+
return subscription;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
removeAllListeners(eventType) {
|
|
59
|
+
RNAppModule.eventsRemoveListener(eventType, true);
|
|
60
|
+
super.removeAllListeners(`rnapp_${eventType}`);
|
|
61
|
+
} // This is likely no longer ever called, but it is here for backwards compatibility with RN <= 0.64
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
removeSubscription(subscription) {
|
|
65
|
+
RNAppModule.eventsRemoveListener(subscription.eventType.replace('rnapp_', ''), false);
|
|
66
|
+
|
|
67
|
+
if (super.removeSubscription != null) {
|
|
68
|
+
super.removeSubscription(subscription);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
const GoogleMobileAdsNativeEventEmitter = new GANativeEventEmitter();
|
|
75
|
+
exports.GoogleMobileAdsNativeEventEmitter = GoogleMobileAdsNativeEventEmitter;
|
|
76
|
+
//# sourceMappingURL=GoogleMobileAdsNativeEventEmitter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["GoogleMobileAdsNativeEventEmitter.ts"],"names":["RNAppModule","NativeModules","GANativeEventEmitter","NativeEventEmitter","constructor","ready","addListener","eventType","listener","context","eventsNotifyReady","eventsAddListener","subscription","originalRemove","remove","newRemove","eventsRemoveListener","removeSubscription","removeAllListeners","replace","GoogleMobileAdsNativeEventEmitter"],"mappings":";;;;;;;AAiBA;;;;AAEA,MAAM;AAAEA,EAAAA;AAAF,IAAkBC,0BAAxB;;AAEA,MAAMC,oBAAN,SAAmCC,+BAAnC,CAAsD;AAGpDC,EAAAA,WAAW,GAAG;AACZ,UAAMJ,WAAN;;AADY;;AAEZ,SAAKK,KAAL,GAAa,KAAb;AACD;;AAEDC,EAAAA,WAAW,CACTC,SADS,EAETC,QAFS,EAGTC,OAHS,EAIT;AACA,QAAI,CAAC,KAAKJ,KAAV,EAAiB;AACfL,MAAAA,WAAW,CAACU,iBAAZ,CAA8B,IAA9B;AACA,WAAKL,KAAL,GAAa,IAAb;AACD;;AACDL,IAAAA,WAAW,CAACW,iBAAZ,CAA8BJ,SAA9B;AAEA,UAAMK,YAAY,GAAG,MAAMN,WAAN,CAAmB,SAAQC,SAAU,EAArC,EAAwCC,QAAxC,EAAkDC,OAAlD,CAArB,CAPA,CASA;AACA;AACA;AAEA;;AACAG,IAAAA,YAAY,CAACL,SAAb,GAA0B,SAAQA,SAAU,EAA5C,CAdA,CAgBA;AACA;;AACA,UAAMM,cAAc,GAAGD,YAAY,CAACE,MAApC;;AACA,UAAMC,SAAS,GAAG,MAAM;AACtBf,MAAAA,WAAW,CAACgB,oBAAZ,CAAiCT,SAAjC,EAA4C,KAA5C;;AACA,UAAI,MAAMU,kBAAN,IAA4B,IAAhC,EAAsC;AACpC;AACA,cAAMA,kBAAN,CAAyBL,YAAzB;AACD,OAHD,MAGO,IAAIC,cAAc,IAAI,IAAtB,EAA4B;AACjC;AACAA,QAAAA,cAAc;AACf;AACF,KATD;;AAUAD,IAAAA,YAAY,CAACE,MAAb,GAAsBC,SAAtB;AACA,WAAOH,YAAP;AACD;;AAEDM,EAAAA,kBAAkB,CAACX,SAAD,EAAoB;AACpCP,IAAAA,WAAW,CAACgB,oBAAZ,CAAiCT,SAAjC,EAA4C,IAA5C;AACA,UAAMW,kBAAN,CAA0B,SAAQX,SAAU,EAA5C;AACD,GAhDmD,CAkDpD;;;AACAU,EAAAA,kBAAkB,CAACL,YAAD,EAAoC;AACpDZ,IAAAA,WAAW,CAACgB,oBAAZ,CAAiCJ,YAAY,CAACL,SAAb,CAAuBY,OAAvB,CAA+B,QAA/B,EAAyC,EAAzC,CAAjC,EAA+E,KAA/E;;AACA,QAAI,MAAMF,kBAAN,IAA4B,IAAhC,EAAsC;AACpC,YAAMA,kBAAN,CAAyBL,YAAzB;AACD;AACF;;AAxDmD;;AA2D/C,MAAMQ,iCAAiC,GAAG,IAAIlB,oBAAJ,EAA1C","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 { NativeEventEmitter, NativeModules, EmitterSubscription } from 'react-native';\n\nconst { RNAppModule } = NativeModules;\n\nclass GANativeEventEmitter extends NativeEventEmitter {\n ready: boolean;\n\n constructor() {\n super(RNAppModule);\n this.ready = false;\n }\n\n addListener(\n eventType: string,\n listener: (event: { appName?: string }) => void,\n context?: Record<string, unknown>,\n ) {\n if (!this.ready) {\n RNAppModule.eventsNotifyReady(true);\n this.ready = true;\n }\n RNAppModule.eventsAddListener(eventType);\n\n const subscription = super.addListener(`rnapp_${eventType}`, listener, context);\n\n // React Native 0.65+ altered EventEmitter:\n // - removeSubscription is gone\n // - addListener returns an unsubscriber instead of a more complex object with eventType etc\n\n // make sure eventType for backwards compatibility just in case\n subscription.eventType = `rnapp_${eventType}`;\n\n // New style is to return a remove function on the object, just in csae people call that,\n // we will modify it to do our native unsubscription then call the original\n const originalRemove = subscription.remove;\n const newRemove = () => {\n RNAppModule.eventsRemoveListener(eventType, false);\n if (super.removeSubscription != null) {\n // This is for RN <= 0.64 - 65 and greater no longer have removeSubscription\n super.removeSubscription(subscription);\n } else if (originalRemove != null) {\n // This is for RN >= 0.65\n originalRemove();\n }\n };\n subscription.remove = newRemove;\n return subscription;\n }\n\n removeAllListeners(eventType: string) {\n RNAppModule.eventsRemoveListener(eventType, true);\n super.removeAllListeners(`rnapp_${eventType}`);\n }\n\n // This is likely no longer ever called, but it is here for backwards compatibility with RN <= 0.64\n removeSubscription(subscription: EmitterSubscription) {\n RNAppModule.eventsRemoveListener(subscription.eventType.replace('rnapp_', ''), false);\n if (super.removeSubscription != null) {\n super.removeSubscription(subscription);\n }\n }\n}\n\nexport const GoogleMobileAdsNativeEventEmitter = new GANativeEventEmitter();\n"]}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.AppModule = void 0;
|
|
7
|
+
|
|
8
|
+
var _nativeModule = require("./registry/nativeModule");
|
|
9
|
+
|
|
10
|
+
var _SharedEventEmitter = require("./SharedEventEmitter");
|
|
11
|
+
|
|
12
|
+
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; }
|
|
13
|
+
|
|
14
|
+
class AppModule {
|
|
15
|
+
constructor(app, config) {
|
|
16
|
+
_defineProperty(this, "_app", void 0);
|
|
17
|
+
|
|
18
|
+
_defineProperty(this, "_nativeModule", void 0);
|
|
19
|
+
|
|
20
|
+
_defineProperty(this, "_config", void 0);
|
|
21
|
+
|
|
22
|
+
this._app = app;
|
|
23
|
+
this._nativeModule = null;
|
|
24
|
+
this._config = Object.assign({}, config);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
get app() {
|
|
28
|
+
return this._app;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
get emitter() {
|
|
32
|
+
return _SharedEventEmitter.SharedEventEmitter;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
eventNameForApp() {
|
|
36
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
37
|
+
args[_key] = arguments[_key];
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
return `${this.app.name}-${args.join('-')}`;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
get native() {
|
|
44
|
+
if (this._nativeModule) {
|
|
45
|
+
return this._nativeModule;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
this._nativeModule = (0, _nativeModule.getNativeModule)(this);
|
|
49
|
+
return this._nativeModule;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
} // Instance of checks don't work once compiled
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
exports.AppModule = AppModule;
|
|
56
|
+
|
|
57
|
+
_defineProperty(AppModule, "__extended__", {});
|
|
58
|
+
|
|
59
|
+
AppModule.__extended__ = {};
|
|
60
|
+
//# sourceMappingURL=Module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["Module.ts"],"names":["AppModule","constructor","app","config","_app","_nativeModule","_config","Object","assign","emitter","SharedEventEmitter","eventNameForApp","args","name","join","native","__extended__"],"mappings":";;;;;;;AAiBA;;AACA;;;;AAIO,MAAMA,SAAN,CAAgB;AAOrBC,EAAAA,WAAW,CAACC,GAAD,EAAWC,MAAX,EAA2B;AAAA;;AAAA;;AAAA;;AACpC,SAAKC,IAAL,GAAYF,GAAZ;AACA,SAAKG,aAAL,GAAqB,IAArB;AACA,SAAKC,OAAL,GAAeC,MAAM,CAACC,MAAP,CAAc,EAAd,EAAkBL,MAAlB,CAAf;AACD;;AAEM,MAAHD,GAAG,GAAG;AACR,WAAO,KAAKE,IAAZ;AACD;;AAEU,MAAPK,OAAO,GAAG;AACZ,WAAOC,sCAAP;AACD;;AAEDC,EAAAA,eAAe,GAAoB;AAAA,sCAAhBC,IAAgB;AAAhBA,MAAAA,IAAgB;AAAA;;AACjC,WAAQ,GAAE,KAAKV,GAAL,CAASW,IAAK,IAAGD,IAAI,CAACE,IAAL,CAAU,GAAV,CAAe,EAA1C;AACD;;AAES,MAANC,MAAM,GAAG;AACX,QAAI,KAAKV,aAAT,EAAwB;AACtB,aAAO,KAAKA,aAAZ;AACD;;AACD,SAAKA,aAAL,GAAqB,mCAAgB,IAAhB,CAArB;AACA,WAAO,KAAKA,aAAZ;AACD;;AA/BoB,C,CAkCvB;;;;;gBAlCaL,S,kBAKW,E;;AA8BxBA,SAAS,CAACgB,YAAV,GAAyB,EAAzB","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 { getNativeModule } from './registry/nativeModule';\nimport { SharedEventEmitter } from './SharedEventEmitter';\nimport { App, Config } from '../types/Module.interface';\nimport { GoogleMobileAdsNativeModule } from '../types/GoogleMobileAdsNativeModule';\n\nexport class AppModule {\n _app: App;\n _nativeModule: unknown;\n _config: Config;\n\n static __extended__ = {};\n\n constructor(app: App, config: Config) {\n this._app = app;\n this._nativeModule = null;\n this._config = Object.assign({}, config);\n }\n\n get app() {\n return this._app;\n }\n\n get emitter() {\n return SharedEventEmitter;\n }\n\n eventNameForApp(...args: string[]) {\n return `${this.app.name}-${args.join('-')}`;\n }\n\n get native() {\n if (this._nativeModule) {\n return this._nativeModule as GoogleMobileAdsNativeModule;\n }\n this._nativeModule = getNativeModule(this);\n return this._nativeModule as GoogleMobileAdsNativeModule;\n }\n}\n\n// Instance of checks don't work once compiled\nAppModule.__extended__ = {};\n"]}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.NativeError = void 0;
|
|
7
|
+
|
|
8
|
+
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; }
|
|
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
|
+
class NativeError extends Error {
|
|
27
|
+
static fromEvent(errorEvent, namespace, stack) {
|
|
28
|
+
return new NativeError({
|
|
29
|
+
userInfo: errorEvent
|
|
30
|
+
}, stack || new Error().stack || '', namespace);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
constructor(nativeError, jsStack, namespace) {
|
|
34
|
+
super();
|
|
35
|
+
|
|
36
|
+
_defineProperty(this, "namespace", void 0);
|
|
37
|
+
|
|
38
|
+
_defineProperty(this, "code", void 0);
|
|
39
|
+
|
|
40
|
+
_defineProperty(this, "message", void 0);
|
|
41
|
+
|
|
42
|
+
_defineProperty(this, "jsStack", void 0);
|
|
43
|
+
|
|
44
|
+
_defineProperty(this, "userInfo", void 0);
|
|
45
|
+
|
|
46
|
+
const {
|
|
47
|
+
userInfo
|
|
48
|
+
} = nativeError;
|
|
49
|
+
this.namespace = namespace;
|
|
50
|
+
this.code = `${this.namespace}/${userInfo.code || 'unknown'}`;
|
|
51
|
+
this.message = `[${this.code}] ${userInfo.message}`;
|
|
52
|
+
this.jsStack = jsStack;
|
|
53
|
+
this.userInfo = userInfo;
|
|
54
|
+
this.stack = NativeError.getStackWithMessage(`NativeError: ${this.message}`, this.jsStack);
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Build a stack trace that includes JS stack prior to calling the native method.
|
|
58
|
+
*
|
|
59
|
+
* @returns {string}
|
|
60
|
+
*/
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
static getStackWithMessage(message, jsStack) {
|
|
64
|
+
return [message, ...jsStack.split('\n').slice(2, 13)].join('\n');
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
exports.NativeError = NativeError;
|
|
70
|
+
//# sourceMappingURL=NativeError.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["NativeError.ts"],"names":["NativeError","Error","fromEvent","errorEvent","namespace","stack","userInfo","constructor","nativeError","jsStack","code","message","getStackWithMessage","split","slice","join"],"mappings":";;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEO,MAAMA,WAAN,SAA0BC,KAA1B,CAAgC;AAOrB,SAATC,SAAS,CACdC,UADc,EAEdC,SAFc,EAGdC,KAHc,EAId;AACA,WAAO,IAAIL,WAAJ,CAAgB;AAAEM,MAAAA,QAAQ,EAAEH;AAAZ,KAAhB,EAA0CE,KAAK,IAAI,IAAIJ,KAAJ,GAAYI,KAArB,IAA8B,EAAxE,EAA4ED,SAA5E,CAAP;AACD;;AAEDG,EAAAA,WAAW,CACTC,WADS,EAETC,OAFS,EAGTL,SAHS,EAIT;AACA;;AADA;;AAAA;;AAAA;;AAAA;;AAAA;;AAEA,UAAM;AAAEE,MAAAA;AAAF,QAAeE,WAArB;AACA,SAAKJ,SAAL,GAAiBA,SAAjB;AACA,SAAKM,IAAL,GAAa,GAAE,KAAKN,SAAU,IAAGE,QAAQ,CAACI,IAAT,IAAiB,SAAU,EAA5D;AACA,SAAKC,OAAL,GAAgB,IAAG,KAAKD,IAAK,KAAIJ,QAAQ,CAACK,OAAQ,EAAlD;AACA,SAAKF,OAAL,GAAeA,OAAf;AACA,SAAKH,QAAL,GAAgBA,QAAhB;AACA,SAAKD,KAAL,GAAaL,WAAW,CAACY,mBAAZ,CAAiC,gBAAe,KAAKD,OAAQ,EAA7D,EAAgE,KAAKF,OAArE,CAAb;AACD;AAED;AACF;AACA;AACA;AACA;;;AAC4B,SAAnBG,mBAAmB,CAACD,OAAD,EAAkBF,OAAlB,EAAmC;AAC3D,WAAO,CAACE,OAAD,EAAU,GAAGF,OAAO,CAACI,KAAR,CAAc,IAAd,EAAoBC,KAApB,CAA0B,CAA1B,EAA6B,EAA7B,CAAb,EAA+CC,IAA/C,CAAoD,IAApD,CAAP;AACD;;AArCoC","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 class NativeError extends Error {\n namespace: string;\n code: string;\n message: string;\n jsStack: string;\n userInfo: { code: string; message: string };\n\n static fromEvent(\n errorEvent: { code: string; message: string },\n namespace: string,\n stack?: string,\n ) {\n return new NativeError({ userInfo: errorEvent }, stack || new Error().stack || '', namespace);\n }\n\n constructor(\n nativeError: { userInfo: { code: string; message: string } },\n jsStack: string,\n namespace: string,\n ) {\n super();\n const { userInfo } = nativeError;\n this.namespace = namespace;\n this.code = `${this.namespace}/${userInfo.code || 'unknown'}`;\n this.message = `[${this.code}] ${userInfo.message}`;\n this.jsStack = jsStack;\n this.userInfo = userInfo;\n this.stack = NativeError.getStackWithMessage(`NativeError: ${this.message}`, this.jsStack);\n }\n\n /**\n * Build a stack trace that includes JS stack prior to calling the native method.\n *\n * @returns {string}\n */\n static getStackWithMessage(message: string, jsStack: string) {\n return [message, ...jsStack.split('\\n').slice(2, 13)].join('\\n');\n }\n}\n"]}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.SharedEventEmitter = void 0;
|
|
7
|
+
|
|
8
|
+
var _EventEmitter = _interopRequireDefault(require("react-native/Libraries/vendor/emitter/EventEmitter"));
|
|
9
|
+
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
|
|
12
|
+
/*
|
|
13
|
+
* Copyright (c) 2016-present Invertase Limited & Contributors
|
|
14
|
+
*
|
|
15
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
16
|
+
* you may not use this library except in compliance with the License.
|
|
17
|
+
* You may obtain a copy of the License at
|
|
18
|
+
*
|
|
19
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
20
|
+
*
|
|
21
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
22
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
23
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
24
|
+
* See the License for the specific language governing permissions and
|
|
25
|
+
* limitations under the License.
|
|
26
|
+
*
|
|
27
|
+
*/
|
|
28
|
+
// @ts-ignore: Could not find a declaration file
|
|
29
|
+
const SharedEventEmitter = new _EventEmitter.default();
|
|
30
|
+
exports.SharedEventEmitter = SharedEventEmitter;
|
|
31
|
+
//# sourceMappingURL=SharedEventEmitter.js.map
|