@javascriptcommon/react-native-google-mobile-ads 16.3.3
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 +181 -0
- package/RNGoogleMobileAds.podspec +74 -0
- package/__tests__/banner.test.tsx +53 -0
- package/__tests__/consent.test.ts +33 -0
- package/__tests__/googleMobileAds.test.ts +108 -0
- package/__tests__/interstitial.test.ts +140 -0
- package/__tests__/nativeEventEmitter.test.ts +72 -0
- package/__tests__/requestOptions.test.tsx +82 -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 +149 -0
- package/android/lint.xml +5 -0
- package/android/settings.gradle +1 -0
- package/android/src/main/AndroidManifest.xml +23 -0
- package/android/src/main/java/io/invertase/googlemobileads/OnNativeEvent.kt +23 -0
- package/android/src/main/java/io/invertase/googlemobileads/ReactNativeAppModule.java +152 -0
- package/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsAppOpenModule.kt +92 -0
- package/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsBannerAdViewManager.java +303 -0
- package/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsCommon.java +277 -0
- package/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsConsentModule.java +293 -0
- package/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsEvent.java +76 -0
- package/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsFullScreenAdModule.kt +201 -0
- package/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsInterstitialModule.kt +92 -0
- package/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsMediaViewManager.java +79 -0
- package/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsModule.kt +178 -0
- package/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsNativeAdViewManager.java +164 -0
- package/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsNativeModule.kt +172 -0
- package/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsPackage.kt +113 -0
- package/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsRewardedInterstitialModule.kt +127 -0
- package/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsRewardedModule.kt +121 -0
- package/android/src/main/java/io/invertase/googlemobileads/common/RCTConvert.java +111 -0
- package/android/src/main/java/io/invertase/googlemobileads/common/ReactNativeAdView.java +128 -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 +429 -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/android/src/oldarch/com/facebook/react/viewmanagers/RNGoogleMobileAdsMediaViewManagerDelegate.java +32 -0
- package/android/src/oldarch/com/facebook/react/viewmanagers/RNGoogleMobileAdsMediaViewManagerInterface.java +10 -0
- package/android/src/oldarch/com/facebook/react/viewmanagers/RNGoogleMobileAdsNativeViewManagerDelegate.java +36 -0
- package/android/src/oldarch/com/facebook/react/viewmanagers/RNGoogleMobileAdsNativeViewManagerInterface.java +10 -0
- package/android/src/oldarch/io/invertase/googlemobileads/NativeGoogleMobileAdsNativeModuleSpec.kt +18 -0
- package/app.plugin.js +1 -0
- package/babel.config.js +8 -0
- package/docs/ad-inspector.mdx +47 -0
- package/docs/common-reasons-for-ads-not-showing.mdx +111 -0
- package/docs/displaying-ads-hook.mdx +103 -0
- package/docs/displaying-ads.mdx +512 -0
- package/docs/european-user-consent.mdx +315 -0
- package/docs/img/logo_admob_192px.svg +19 -0
- package/docs/impression-level-ad-revenue.mdx +41 -0
- package/docs/index.mdx +508 -0
- package/docs/mediation.mdx +323 -0
- package/docs/migrating-to-v15.mdx +7 -0
- package/docs/migrating-to-v5.mdx +63 -0
- package/docs/migrating-to-v6.mdx +111 -0
- package/docs/native-ads.mdx +385 -0
- package/docs/testing.mdx +17 -0
- package/docs/video-ad_volume-control.mdx +49 -0
- package/docs.json +36 -0
- package/ios/RNGoogleMobileAds/RNGoogleMobileAds-Bridging-Header.h +5 -0
- package/ios/RNGoogleMobileAds/RNGoogleMobileAdsAppOpenModule.h +36 -0
- package/ios/RNGoogleMobileAds/RNGoogleMobileAdsAppOpenModule.mm +104 -0
- package/ios/RNGoogleMobileAds/RNGoogleMobileAdsBannerComponent.h +44 -0
- package/ios/RNGoogleMobileAds/RNGoogleMobileAdsBannerComponent.m +221 -0
- package/ios/RNGoogleMobileAds/RNGoogleMobileAdsBannerView.h +34 -0
- package/ios/RNGoogleMobileAds/RNGoogleMobileAdsBannerView.mm +282 -0
- package/ios/RNGoogleMobileAds/RNGoogleMobileAdsBannerViewManager.mm +87 -0
- package/ios/RNGoogleMobileAds/RNGoogleMobileAdsCommon.h +72 -0
- package/ios/RNGoogleMobileAds/RNGoogleMobileAdsCommon.mm +248 -0
- package/ios/RNGoogleMobileAds/RNGoogleMobileAdsConsentModule.h +36 -0
- package/ios/RNGoogleMobileAds/RNGoogleMobileAdsConsentModule.mm +356 -0
- package/ios/RNGoogleMobileAds/RNGoogleMobileAdsFullScreenAd.h +53 -0
- package/ios/RNGoogleMobileAds/RNGoogleMobileAdsFullScreenAd.mm +220 -0
- package/ios/RNGoogleMobileAds/RNGoogleMobileAdsFullScreenContentDelegate.h +36 -0
- package/ios/RNGoogleMobileAds/RNGoogleMobileAdsFullScreenContentDelegate.mm +80 -0
- package/ios/RNGoogleMobileAds/RNGoogleMobileAdsInterstitialModule.h +36 -0
- package/ios/RNGoogleMobileAds/RNGoogleMobileAdsInterstitialModule.mm +106 -0
- package/ios/RNGoogleMobileAds/RNGoogleMobileAdsMediaView.h +52 -0
- package/ios/RNGoogleMobileAds/RNGoogleMobileAdsMediaView.mm +155 -0
- package/ios/RNGoogleMobileAds/RNGoogleMobileAdsModule.h +32 -0
- package/ios/RNGoogleMobileAds/RNGoogleMobileAdsModule.mm +180 -0
- package/ios/RNGoogleMobileAds/RNGoogleMobileAdsNativeModule.h +35 -0
- package/ios/RNGoogleMobileAds/RNGoogleMobileAdsNativeModule.mm +321 -0
- package/ios/RNGoogleMobileAds/RNGoogleMobileAdsNativeView.h +51 -0
- package/ios/RNGoogleMobileAds/RNGoogleMobileAdsNativeView.mm +251 -0
- package/ios/RNGoogleMobileAds/RNGoogleMobileAdsRewardedInterstitialModule.h +37 -0
- package/ios/RNGoogleMobileAds/RNGoogleMobileAdsRewardedInterstitialModule.mm +106 -0
- package/ios/RNGoogleMobileAds/RNGoogleMobileAdsRewardedModule.h +36 -0
- package/ios/RNGoogleMobileAds/RNGoogleMobileAdsRewardedModule.mm +104 -0
- package/ios/RNGoogleMobileAds/common/RNAppModule.h +24 -0
- package/ios/RNGoogleMobileAds/common/RNAppModule.mm +95 -0
- package/ios/RNGoogleMobileAds/common/RNRCTEventEmitter.h +73 -0
- package/ios/RNGoogleMobileAds/common/RNRCTEventEmitter.mm +150 -0
- package/ios/RNGoogleMobileAds/common/RNSharedUtils.h +43 -0
- package/ios/RNGoogleMobileAds/common/RNSharedUtils.mm +34 -0
- package/ios/RNGoogleMobileAds.xcodeproj/project.pbxproj +377 -0
- package/ios/RNGoogleMobileAds.xcodeproj/xcshareddata/IDETemplateMacros.plist +24 -0
- package/ios_config.sh +192 -0
- package/jest.config.js +7 -0
- package/jest.setup.ts +92 -0
- package/lib/commonjs/AdEventType.js +72 -0
- package/lib/commonjs/AdEventType.js.map +1 -0
- package/lib/commonjs/AdsConsent.js +117 -0
- package/lib/commonjs/AdsConsent.js.map +1 -0
- package/lib/commonjs/AdsConsentPurposes.js +180 -0
- package/lib/commonjs/AdsConsentPurposes.js.map +1 -0
- package/lib/commonjs/AdsConsentSpecialFeatures.js +54 -0
- package/lib/commonjs/AdsConsentSpecialFeatures.js.map +1 -0
- package/lib/commonjs/BannerAdSize.js +75 -0
- package/lib/commonjs/BannerAdSize.js.map +1 -0
- package/lib/commonjs/GAMAdEventType.js +44 -0
- package/lib/commonjs/GAMAdEventType.js.map +1 -0
- package/lib/commonjs/MaxAdContentRating.js +42 -0
- package/lib/commonjs/MaxAdContentRating.js.map +1 -0
- package/lib/commonjs/MobileAds.js +63 -0
- package/lib/commonjs/MobileAds.js.map +1 -0
- package/lib/commonjs/NativeAdEventType.js +50 -0
- package/lib/commonjs/NativeAdEventType.js.map +1 -0
- package/lib/commonjs/RewardedAdEventType.js +66 -0
- package/lib/commonjs/RewardedAdEventType.js.map +1 -0
- package/lib/commonjs/TestIds.js +66 -0
- package/lib/commonjs/TestIds.js.map +1 -0
- package/lib/commonjs/ads/AppOpenAd.js +54 -0
- package/lib/commonjs/ads/AppOpenAd.js.map +1 -0
- package/lib/commonjs/ads/BannerAd.js +45 -0
- package/lib/commonjs/ads/BannerAd.js.map +1 -0
- package/lib/commonjs/ads/BaseAd.js +155 -0
- package/lib/commonjs/ads/BaseAd.js.map +1 -0
- package/lib/commonjs/ads/GAMBannerAd.js +49 -0
- package/lib/commonjs/ads/GAMBannerAd.js.map +1 -0
- package/lib/commonjs/ads/GAMInterstitialAd.js +42 -0
- package/lib/commonjs/ads/GAMInterstitialAd.js.map +1 -0
- package/lib/commonjs/ads/InterstitialAd.js +115 -0
- package/lib/commonjs/ads/InterstitialAd.js.map +1 -0
- package/lib/commonjs/ads/MobileAd.js +153 -0
- package/lib/commonjs/ads/MobileAd.js.map +1 -0
- package/lib/commonjs/ads/RewardedAd.js +128 -0
- package/lib/commonjs/ads/RewardedAd.js.map +1 -0
- package/lib/commonjs/ads/RewardedInterstitialAd.js +128 -0
- package/lib/commonjs/ads/RewardedInterstitialAd.js.map +1 -0
- package/lib/commonjs/ads/native-ad/NativeAd.js +123 -0
- package/lib/commonjs/ads/native-ad/NativeAd.js.map +1 -0
- package/lib/commonjs/ads/native-ad/NativeAdContext.js +26 -0
- package/lib/commonjs/ads/native-ad/NativeAdContext.js.map +1 -0
- package/lib/commonjs/ads/native-ad/NativeAdView.js +52 -0
- package/lib/commonjs/ads/native-ad/NativeAdView.js.map +1 -0
- package/lib/commonjs/ads/native-ad/NativeAsset.js +70 -0
- package/lib/commonjs/ads/native-ad/NativeAsset.js.map +1 -0
- package/lib/commonjs/ads/native-ad/NativeMediaView.js +61 -0
- package/lib/commonjs/ads/native-ad/NativeMediaView.js.map +1 -0
- package/lib/commonjs/common/constants.js +17 -0
- package/lib/commonjs/common/constants.js.map +1 -0
- package/lib/commonjs/common/debounce.js +18 -0
- package/lib/commonjs/common/debounce.js.map +1 -0
- package/lib/commonjs/common/index.js +47 -0
- package/lib/commonjs/common/index.js.map +1 -0
- package/lib/commonjs/common/ref.js +46 -0
- package/lib/commonjs/common/ref.js.map +1 -0
- package/lib/commonjs/common/validate.js +132 -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/hooks/useAppOpenAd.js +44 -0
- package/lib/commonjs/hooks/useAppOpenAd.js.map +1 -0
- package/lib/commonjs/hooks/useForeground.js +45 -0
- package/lib/commonjs/hooks/useForeground.js.map +1 -0
- package/lib/commonjs/hooks/useFullScreenAd.js +121 -0
- package/lib/commonjs/hooks/useFullScreenAd.js.map +1 -0
- package/lib/commonjs/hooks/useInterstitialAd.js +44 -0
- package/lib/commonjs/hooks/useInterstitialAd.js.map +1 -0
- package/lib/commonjs/hooks/useRewardedAd.js +44 -0
- package/lib/commonjs/hooks/useRewardedAd.js.map +1 -0
- package/lib/commonjs/hooks/useRewardedInterstitialAd.js +44 -0
- package/lib/commonjs/hooks/useRewardedInterstitialAd.js.map +1 -0
- package/lib/commonjs/index.js +337 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/internal/GoogleMobileAdsNativeEventEmitter.js +54 -0
- package/lib/commonjs/internal/GoogleMobileAdsNativeEventEmitter.js.map +1 -0
- package/lib/commonjs/internal/NativeError.js +53 -0
- package/lib/commonjs/internal/NativeError.js.map +1 -0
- package/lib/commonjs/internal/SharedEventEmitter.js +27 -0
- package/lib/commonjs/internal/SharedEventEmitter.js.map +1 -0
- package/lib/commonjs/package.json +1 -0
- package/lib/commonjs/specs/components/GoogleMobileAdsBannerViewNativeComponent.ts +62 -0
- package/lib/commonjs/specs/components/GoogleMobileAdsMediaViewNativeComponent.ts +30 -0
- package/lib/commonjs/specs/components/GoogleMobileAdsNativeViewNativeComponent.ts +45 -0
- package/lib/commonjs/specs/modules/NativeAppModule.js +24 -0
- package/lib/commonjs/specs/modules/NativeAppModule.js.map +1 -0
- package/lib/commonjs/specs/modules/NativeAppOpenModule.js +25 -0
- package/lib/commonjs/specs/modules/NativeAppOpenModule.js.map +1 -0
- package/lib/commonjs/specs/modules/NativeConsentModule.js +105 -0
- package/lib/commonjs/specs/modules/NativeConsentModule.js.map +1 -0
- package/lib/commonjs/specs/modules/NativeGoogleMobileAdsModule.js +25 -0
- package/lib/commonjs/specs/modules/NativeGoogleMobileAdsModule.js.map +1 -0
- package/lib/commonjs/specs/modules/NativeGoogleMobileAdsNativeModule.js +25 -0
- package/lib/commonjs/specs/modules/NativeGoogleMobileAdsNativeModule.js.map +1 -0
- package/lib/commonjs/specs/modules/NativeInterstitialModule.js +25 -0
- package/lib/commonjs/specs/modules/NativeInterstitialModule.js.map +1 -0
- package/lib/commonjs/specs/modules/NativeRewardedInterstitialModule.js +25 -0
- package/lib/commonjs/specs/modules/NativeRewardedInterstitialModule.js.map +1 -0
- package/lib/commonjs/specs/modules/NativeRewardedModule.js +25 -0
- package/lib/commonjs/specs/modules/NativeRewardedModule.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/AdEventsListener.js +6 -0
- package/lib/commonjs/types/AdEventsListener.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/AdStates.js +6 -0
- package/lib/commonjs/types/AdStates.js.map +1 -0
- package/lib/commonjs/types/AdapterStatus.js +21 -0
- package/lib/commonjs/types/AdapterStatus.js.map +1 -0
- package/lib/commonjs/types/AppEvent.js +2 -0
- package/lib/commonjs/types/AppEvent.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/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/NativeAdRequestOptions.js +37 -0
- package/lib/commonjs/types/NativeAdRequestOptions.js.map +1 -0
- package/lib/commonjs/types/PaidEventListener.js +6 -0
- package/lib/commonjs/types/PaidEventListener.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/types/index.js +138 -0
- package/lib/commonjs/types/index.js.map +1 -0
- package/lib/commonjs/validateAdRequestConfiguration.js +57 -0
- package/lib/commonjs/validateAdRequestConfiguration.js.map +1 -0
- package/lib/commonjs/validateAdRequestOptions.js +121 -0
- package/lib/commonjs/validateAdRequestOptions.js.map +1 -0
- package/lib/commonjs/validateAdShowOptions.js +41 -0
- package/lib/commonjs/validateAdShowOptions.js.map +1 -0
- package/lib/commonjs/validateNativeAdRequestOptions.js +51 -0
- package/lib/commonjs/validateNativeAdRequestOptions.js.map +1 -0
- package/lib/commonjs/version.js +9 -0
- package/lib/commonjs/version.js.map +1 -0
- package/lib/module/AdEventType.js +69 -0
- package/lib/module/AdEventType.js.map +1 -0
- package/lib/module/AdsConsent.js +113 -0
- package/lib/module/AdsConsent.js.map +1 -0
- package/lib/module/AdsConsentPurposes.js +177 -0
- package/lib/module/AdsConsentPurposes.js.map +1 -0
- package/lib/module/AdsConsentSpecialFeatures.js +51 -0
- package/lib/module/AdsConsentSpecialFeatures.js.map +1 -0
- package/lib/module/BannerAdSize.js +72 -0
- package/lib/module/BannerAdSize.js.map +1 -0
- package/lib/module/GAMAdEventType.js +41 -0
- package/lib/module/GAMAdEventType.js.map +1 -0
- package/lib/module/MaxAdContentRating.js +39 -0
- package/lib/module/MaxAdContentRating.js.map +1 -0
- package/lib/module/MobileAds.js +57 -0
- package/lib/module/MobileAds.js.map +1 -0
- package/lib/module/NativeAdEventType.js +46 -0
- package/lib/module/NativeAdEventType.js.map +1 -0
- package/lib/module/RewardedAdEventType.js +63 -0
- package/lib/module/RewardedAdEventType.js.map +1 -0
- package/lib/module/TestIds.js +62 -0
- package/lib/module/TestIds.js.map +1 -0
- package/lib/module/ads/AppOpenAd.js +48 -0
- package/lib/module/ads/AppOpenAd.js.map +1 -0
- package/lib/module/ads/BannerAd.js +39 -0
- package/lib/module/ads/BannerAd.js.map +1 -0
- package/lib/module/ads/BaseAd.js +149 -0
- package/lib/module/ads/BaseAd.js.map +1 -0
- package/lib/module/ads/GAMBannerAd.js +43 -0
- package/lib/module/ads/GAMBannerAd.js.map +1 -0
- package/lib/module/ads/GAMInterstitialAd.js +37 -0
- package/lib/module/ads/GAMInterstitialAd.js.map +1 -0
- package/lib/module/ads/InterstitialAd.js +110 -0
- package/lib/module/ads/InterstitialAd.js.map +1 -0
- package/lib/module/ads/MobileAd.js +148 -0
- package/lib/module/ads/MobileAd.js.map +1 -0
- package/lib/module/ads/RewardedAd.js +123 -0
- package/lib/module/ads/RewardedAd.js.map +1 -0
- package/lib/module/ads/RewardedInterstitialAd.js +123 -0
- package/lib/module/ads/RewardedInterstitialAd.js.map +1 -0
- package/lib/module/ads/native-ad/NativeAd.js +117 -0
- package/lib/module/ads/native-ad/NativeAd.js.map +1 -0
- package/lib/module/ads/native-ad/NativeAdContext.js +22 -0
- package/lib/module/ads/native-ad/NativeAdContext.js.map +1 -0
- package/lib/module/ads/native-ad/NativeAdView.js +45 -0
- package/lib/module/ads/native-ad/NativeAdView.js.map +1 -0
- package/lib/module/ads/native-ad/NativeAsset.js +65 -0
- package/lib/module/ads/native-ad/NativeAsset.js.map +1 -0
- package/lib/module/ads/native-ad/NativeMediaView.js +54 -0
- package/lib/module/ads/native-ad/NativeMediaView.js.map +1 -0
- package/lib/module/common/constants.js +13 -0
- package/lib/module/common/constants.js.map +1 -0
- package/lib/module/common/debounce.js +13 -0
- package/lib/module/common/debounce.js.map +1 -0
- package/lib/module/common/index.js +28 -0
- package/lib/module/common/index.js.map +1 -0
- package/lib/module/common/ref.js +41 -0
- package/lib/module/common/ref.js.map +1 -0
- package/lib/module/common/validate.js +119 -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/hooks/useAppOpenAd.js +40 -0
- package/lib/module/hooks/useAppOpenAd.js.map +1 -0
- package/lib/module/hooks/useForeground.js +42 -0
- package/lib/module/hooks/useForeground.js.map +1 -0
- package/lib/module/hooks/useFullScreenAd.js +117 -0
- package/lib/module/hooks/useFullScreenAd.js.map +1 -0
- package/lib/module/hooks/useInterstitialAd.js +40 -0
- package/lib/module/hooks/useInterstitialAd.js.map +1 -0
- package/lib/module/hooks/useRewardedAd.js +40 -0
- package/lib/module/hooks/useRewardedAd.js.map +1 -0
- package/lib/module/hooks/useRewardedInterstitialAd.js +40 -0
- package/lib/module/hooks/useRewardedInterstitialAd.js.map +1 -0
- package/lib/module/index.js +54 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/internal/GoogleMobileAdsNativeEventEmitter.js +49 -0
- package/lib/module/internal/GoogleMobileAdsNativeEventEmitter.js.map +1 -0
- package/lib/module/internal/NativeError.js +48 -0
- package/lib/module/internal/NativeError.js.map +1 -0
- package/lib/module/internal/SharedEventEmitter.js +22 -0
- package/lib/module/internal/SharedEventEmitter.js.map +1 -0
- package/lib/module/specs/components/GoogleMobileAdsBannerViewNativeComponent.ts +62 -0
- package/lib/module/specs/components/GoogleMobileAdsMediaViewNativeComponent.ts +30 -0
- package/lib/module/specs/components/GoogleMobileAdsNativeViewNativeComponent.ts +45 -0
- package/lib/module/specs/modules/NativeAppModule.js +21 -0
- package/lib/module/specs/modules/NativeAppModule.js.map +1 -0
- package/lib/module/specs/modules/NativeAppOpenModule.js +22 -0
- package/lib/module/specs/modules/NativeAppOpenModule.js.map +1 -0
- package/lib/module/specs/modules/NativeConsentModule.js +108 -0
- package/lib/module/specs/modules/NativeConsentModule.js.map +1 -0
- package/lib/module/specs/modules/NativeGoogleMobileAdsModule.js +22 -0
- package/lib/module/specs/modules/NativeGoogleMobileAdsModule.js.map +1 -0
- package/lib/module/specs/modules/NativeGoogleMobileAdsNativeModule.js +22 -0
- package/lib/module/specs/modules/NativeGoogleMobileAdsNativeModule.js.map +1 -0
- package/lib/module/specs/modules/NativeInterstitialModule.js +22 -0
- package/lib/module/specs/modules/NativeInterstitialModule.js.map +1 -0
- package/lib/module/specs/modules/NativeRewardedInterstitialModule.js +22 -0
- package/lib/module/specs/modules/NativeRewardedInterstitialModule.js.map +1 -0
- package/lib/module/specs/modules/NativeRewardedModule.js +22 -0
- package/lib/module/specs/modules/NativeRewardedModule.js.map +1 -0
- package/lib/module/types/AdEventListener.js +4 -0
- package/lib/module/types/AdEventListener.js.map +1 -0
- package/lib/module/types/AdEventsListener.js +4 -0
- package/lib/module/types/AdEventsListener.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/AdStates.js +4 -0
- package/lib/module/types/AdStates.js.map +1 -0
- package/lib/module/types/AdapterStatus.js +18 -0
- package/lib/module/types/AdapterStatus.js.map +1 -0
- package/lib/module/types/AppEvent.js +2 -0
- package/lib/module/types/AppEvent.js.map +1 -0
- package/lib/module/types/BannerAdProps.js +4 -0
- package/lib/module/types/BannerAdProps.js.map +1 -0
- package/lib/module/types/MobileAd.interface.js +4 -0
- package/lib/module/types/MobileAd.interface.js.map +1 -0
- package/lib/module/types/MobileAdsModule.interface.js +4 -0
- package/lib/module/types/MobileAdsModule.interface.js.map +1 -0
- package/lib/module/types/NativeAdRequestOptions.js +34 -0
- package/lib/module/types/NativeAdRequestOptions.js.map +1 -0
- package/lib/module/types/PaidEventListener.js +4 -0
- package/lib/module/types/PaidEventListener.js.map +1 -0
- package/lib/module/types/RequestConfiguration.js +4 -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/types/index.js +32 -0
- package/lib/module/types/index.js.map +1 -0
- package/lib/module/validateAdRequestConfiguration.js +53 -0
- package/lib/module/validateAdRequestConfiguration.js.map +1 -0
- package/lib/module/validateAdRequestOptions.js +117 -0
- package/lib/module/validateAdRequestOptions.js.map +1 -0
- package/lib/module/validateAdShowOptions.js +37 -0
- package/lib/module/validateAdShowOptions.js.map +1 -0
- package/lib/module/validateNativeAdRequestOptions.js +47 -0
- package/lib/module/validateNativeAdRequestOptions.js.map +1 -0
- package/lib/module/version.js +5 -0
- package/lib/module/version.js.map +1 -0
- package/lib/typescript/AdEventType.d.ts +49 -0
- package/lib/typescript/AdEventType.d.ts.map +1 -0
- package/lib/typescript/AdsConsent.d.ts +3 -0
- package/lib/typescript/AdsConsent.d.ts.map +1 -0
- package/lib/typescript/AdsConsentPurposes.d.ts +149 -0
- package/lib/typescript/AdsConsentPurposes.d.ts.map +1 -0
- package/lib/typescript/AdsConsentSpecialFeatures.d.ts +23 -0
- package/lib/typescript/AdsConsentSpecialFeatures.d.ts.map +1 -0
- package/lib/typescript/BannerAdSize.d.ts +91 -0
- package/lib/typescript/BannerAdSize.d.ts.map +1 -0
- package/lib/typescript/GAMAdEventType.d.ts +21 -0
- package/lib/typescript/GAMAdEventType.d.ts.map +1 -0
- package/lib/typescript/MaxAdContentRating.d.ts +19 -0
- package/lib/typescript/MaxAdContentRating.d.ts.map +1 -0
- package/lib/typescript/MobileAds.d.ts +15 -0
- package/lib/typescript/MobileAds.d.ts.map +1 -0
- package/lib/typescript/NativeAdEventType.d.ts +43 -0
- package/lib/typescript/NativeAdEventType.d.ts.map +1 -0
- package/lib/typescript/RewardedAdEventType.d.ts +43 -0
- package/lib/typescript/RewardedAdEventType.d.ts.map +1 -0
- package/lib/typescript/TestIds.d.ts +19 -0
- package/lib/typescript/TestIds.d.ts.map +1 -0
- package/lib/typescript/ads/AppOpenAd.d.ts +12 -0
- package/lib/typescript/ads/AppOpenAd.d.ts.map +1 -0
- package/lib/typescript/ads/BannerAd.d.ts +8 -0
- package/lib/typescript/ads/BannerAd.d.ts.map +1 -0
- package/lib/typescript/ads/BaseAd.d.ts +4 -0
- package/lib/typescript/ads/BaseAd.d.ts.map +1 -0
- package/lib/typescript/ads/GAMBannerAd.d.ts +9 -0
- package/lib/typescript/ads/GAMBannerAd.d.ts.map +1 -0
- package/lib/typescript/ads/GAMInterstitialAd.d.ts +34 -0
- package/lib/typescript/ads/GAMInterstitialAd.d.ts.map +1 -0
- package/lib/typescript/ads/InterstitialAd.d.ts +73 -0
- package/lib/typescript/ads/InterstitialAd.d.ts.map +1 -0
- package/lib/typescript/ads/MobileAd.d.ts +54 -0
- package/lib/typescript/ads/MobileAd.d.ts.map +1 -0
- package/lib/typescript/ads/RewardedAd.d.ts +83 -0
- package/lib/typescript/ads/RewardedAd.d.ts.map +1 -0
- package/lib/typescript/ads/RewardedInterstitialAd.d.ts +83 -0
- package/lib/typescript/ads/RewardedInterstitialAd.d.ts.map +1 -0
- package/lib/typescript/ads/native-ad/NativeAd.d.ts +48 -0
- package/lib/typescript/ads/native-ad/NativeAd.d.ts.map +1 -0
- package/lib/typescript/ads/native-ad/NativeAdContext.d.ts +10 -0
- package/lib/typescript/ads/native-ad/NativeAdContext.d.ts.map +1 -0
- package/lib/typescript/ads/native-ad/NativeAdView.d.ts +8 -0
- package/lib/typescript/ads/native-ad/NativeAdView.d.ts.map +1 -0
- package/lib/typescript/ads/native-ad/NativeAsset.d.ts +18 -0
- package/lib/typescript/ads/native-ad/NativeAsset.d.ts.map +1 -0
- package/lib/typescript/ads/native-ad/NativeMediaView.d.ts +7 -0
- package/lib/typescript/ads/native-ad/NativeMediaView.d.ts.map +1 -0
- package/lib/typescript/common/constants.d.ts +7 -0
- package/lib/typescript/common/constants.d.ts.map +1 -0
- package/lib/typescript/common/debounce.d.ts +2 -0
- package/lib/typescript/common/debounce.d.ts.map +1 -0
- package/lib/typescript/common/index.d.ts +4 -0
- package/lib/typescript/common/index.d.ts.map +1 -0
- package/lib/typescript/common/ref.d.ts +13 -0
- package/lib/typescript/common/ref.d.ts.map +1 -0
- package/lib/typescript/common/validate.d.ts +62 -0
- package/lib/typescript/common/validate.d.ts.map +1 -0
- package/lib/typescript/hooks/useAppOpenAd.d.ts +10 -0
- package/lib/typescript/hooks/useAppOpenAd.d.ts.map +1 -0
- package/lib/typescript/hooks/useForeground.d.ts +7 -0
- package/lib/typescript/hooks/useForeground.d.ts.map +1 -0
- package/lib/typescript/hooks/useFullScreenAd.d.ts +7 -0
- package/lib/typescript/hooks/useFullScreenAd.d.ts.map +1 -0
- package/lib/typescript/hooks/useInterstitialAd.d.ts +10 -0
- package/lib/typescript/hooks/useInterstitialAd.d.ts.map +1 -0
- package/lib/typescript/hooks/useRewardedAd.d.ts +10 -0
- package/lib/typescript/hooks/useRewardedAd.d.ts.map +1 -0
- package/lib/typescript/hooks/useRewardedInterstitialAd.d.ts +10 -0
- package/lib/typescript/hooks/useRewardedInterstitialAd.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +32 -0
- package/lib/typescript/index.d.ts.map +1 -0
- package/lib/typescript/internal/GoogleMobileAdsNativeEventEmitter.d.ts +13 -0
- package/lib/typescript/internal/GoogleMobileAdsNativeEventEmitter.d.ts.map +1 -0
- package/lib/typescript/internal/NativeError.d.ts +27 -0
- package/lib/typescript/internal/NativeError.d.ts.map +1 -0
- package/lib/typescript/internal/SharedEventEmitter.d.ts +3 -0
- package/lib/typescript/internal/SharedEventEmitter.d.ts.map +1 -0
- package/lib/typescript/specs/components/GoogleMobileAdsBannerViewNativeComponent.d.ts +35 -0
- package/lib/typescript/specs/components/GoogleMobileAdsBannerViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/specs/components/GoogleMobileAdsMediaViewNativeComponent.d.ts +9 -0
- package/lib/typescript/specs/components/GoogleMobileAdsMediaViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/specs/components/GoogleMobileAdsNativeViewNativeComponent.d.ts +14 -0
- package/lib/typescript/specs/components/GoogleMobileAdsNativeViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/specs/modules/NativeAppModule.d.ts +23 -0
- package/lib/typescript/specs/modules/NativeAppModule.d.ts.map +1 -0
- package/lib/typescript/specs/modules/NativeAppOpenModule.d.ts +25 -0
- package/lib/typescript/specs/modules/NativeAppOpenModule.d.ts.map +1 -0
- package/lib/typescript/specs/modules/NativeConsentModule.d.ts +498 -0
- package/lib/typescript/specs/modules/NativeConsentModule.d.ts.map +1 -0
- package/lib/typescript/specs/modules/NativeGoogleMobileAdsModule.d.ts +14 -0
- package/lib/typescript/specs/modules/NativeGoogleMobileAdsModule.d.ts.map +1 -0
- package/lib/typescript/specs/modules/NativeGoogleMobileAdsNativeModule.d.ts +42 -0
- package/lib/typescript/specs/modules/NativeGoogleMobileAdsNativeModule.d.ts.map +1 -0
- package/lib/typescript/specs/modules/NativeInterstitialModule.d.ts +25 -0
- package/lib/typescript/specs/modules/NativeInterstitialModule.d.ts.map +1 -0
- package/lib/typescript/specs/modules/NativeRewardedInterstitialModule.d.ts +25 -0
- package/lib/typescript/specs/modules/NativeRewardedInterstitialModule.d.ts.map +1 -0
- package/lib/typescript/specs/modules/NativeRewardedModule.d.ts +25 -0
- package/lib/typescript/specs/modules/NativeRewardedModule.d.ts.map +1 -0
- package/lib/typescript/types/AdEventListener.d.ts +8 -0
- package/lib/typescript/types/AdEventListener.d.ts.map +1 -0
- package/lib/typescript/types/AdEventsListener.d.ts +9 -0
- package/lib/typescript/types/AdEventsListener.d.ts.map +1 -0
- package/lib/typescript/types/AdShowOptions.d.ts +13 -0
- package/lib/typescript/types/AdShowOptions.d.ts.map +1 -0
- package/lib/typescript/types/AdStates.d.ts +91 -0
- package/lib/typescript/types/AdStates.d.ts.map +1 -0
- package/lib/typescript/types/AdapterStatus.d.ts +19 -0
- package/lib/typescript/types/AdapterStatus.d.ts.map +1 -0
- package/lib/typescript/types/AppEvent.d.ts +14 -0
- package/lib/typescript/types/AppEvent.d.ts.map +1 -0
- package/lib/typescript/types/BannerAdProps.d.ts +175 -0
- package/lib/typescript/types/BannerAdProps.d.ts.map +1 -0
- package/lib/typescript/types/MobileAd.interface.d.ts +90 -0
- package/lib/typescript/types/MobileAd.interface.d.ts.map +1 -0
- package/lib/typescript/types/MobileAdsModule.interface.d.ts +75 -0
- package/lib/typescript/types/MobileAdsModule.interface.d.ts.map +1 -0
- package/lib/typescript/types/NativeAdRequestOptions.d.ts +36 -0
- package/lib/typescript/types/NativeAdRequestOptions.d.ts.map +1 -0
- package/lib/typescript/types/PaidEventListener.d.ts +8 -0
- package/lib/typescript/types/PaidEventListener.d.ts.map +1 -0
- package/lib/typescript/types/RequestConfiguration.d.ts +37 -0
- package/lib/typescript/types/RequestConfiguration.d.ts.map +1 -0
- package/lib/typescript/types/RequestOptions.d.ts +133 -0
- package/lib/typescript/types/RequestOptions.d.ts.map +1 -0
- package/lib/typescript/types/RewardedAdReward.d.ts +14 -0
- package/lib/typescript/types/RewardedAdReward.d.ts.map +1 -0
- package/lib/typescript/types/index.d.ts +13 -0
- package/lib/typescript/types/index.d.ts.map +1 -0
- package/lib/typescript/validateAdRequestConfiguration.d.ts +3 -0
- package/lib/typescript/validateAdRequestConfiguration.d.ts.map +1 -0
- package/lib/typescript/validateAdRequestOptions.d.ts +3 -0
- package/lib/typescript/validateAdRequestOptions.d.ts.map +1 -0
- package/lib/typescript/validateAdShowOptions.d.ts +3 -0
- package/lib/typescript/validateAdShowOptions.d.ts.map +1 -0
- package/lib/typescript/validateNativeAdRequestOptions.d.ts +3 -0
- package/lib/typescript/validateNativeAdRequestOptions.d.ts.map +1 -0
- package/lib/typescript/version.d.ts +2 -0
- package/lib/typescript/version.d.ts.map +1 -0
- package/package.json +176 -0
- package/plugin/__tests__/__snapshots__/plugin.test.ts.snap +739 -0
- package/plugin/__tests__/fixtures/app.config.js +24 -0
- package/plugin/__tests__/fixtures/app.config.ts +24 -0
- package/plugin/__tests__/fixtures/app.json +24 -0
- package/plugin/__tests__/fixtures/package.json +19 -0
- package/plugin/__tests__/fixtures/without-params/app.config.js +11 -0
- package/plugin/__tests__/fixtures/without-params/app.config.ts +11 -0
- package/plugin/__tests__/fixtures/without-params/app.json +11 -0
- package/plugin/__tests__/plugin.test.ts +115 -0
- package/plugin/build/index.d.ts +12 -0
- package/plugin/build/index.js +109 -0
- package/plugin/jest.config.js +1 -0
- package/plugin/src/index.ts +205 -0
- package/plugin/tsconfig.json +9 -0
- package/plugin/tsconfig.tsbuildinfo +1 -0
- package/react-native.config.js +19 -0
- package/src/AdEventType.ts +70 -0
- package/src/AdsConsent.ts +170 -0
- package/src/AdsConsentPurposes.ts +182 -0
- package/src/AdsConsentSpecialFeatures.ts +48 -0
- package/src/BannerAdSize.ts +78 -0
- package/src/GAMAdEventType.ts +37 -0
- package/src/MaxAdContentRating.ts +38 -0
- package/src/MobileAds.ts +77 -0
- package/src/NativeAdEventType.ts +51 -0
- package/src/RewardedAdEventType.ts +60 -0
- package/src/TestIds.ts +60 -0
- package/src/ads/AppOpenAd.ts +62 -0
- package/src/ads/BannerAd.tsx +37 -0
- package/src/ads/BaseAd.tsx +185 -0
- package/src/ads/GAMBannerAd.tsx +43 -0
- package/src/ads/GAMInterstitialAd.ts +45 -0
- package/src/ads/InterstitialAd.ts +122 -0
- package/src/ads/MobileAd.ts +227 -0
- package/src/ads/RewardedAd.ts +142 -0
- package/src/ads/RewardedInterstitialAd.ts +144 -0
- package/src/ads/native-ad/NativeAd.ts +159 -0
- package/src/ads/native-ad/NativeAdContext.ts +26 -0
- package/src/ads/native-ad/NativeAdView.tsx +43 -0
- package/src/ads/native-ad/NativeAsset.tsx +66 -0
- package/src/ads/native-ad/NativeMediaView.tsx +44 -0
- package/src/common/constants.ts +9 -0
- package/src/common/debounce.ts +15 -0
- package/src/common/index.ts +30 -0
- package/src/common/ref.ts +46 -0
- package/src/common/validate.ts +116 -0
- package/src/declarations.d.ts +3 -0
- package/src/hooks/useAppOpenAd.ts +46 -0
- package/src/hooks/useForeground.ts +41 -0
- package/src/hooks/useFullScreenAd.ts +112 -0
- package/src/hooks/useInterstitialAd.ts +46 -0
- package/src/hooks/useRewardedAd.ts +46 -0
- package/src/hooks/useRewardedInterstitialAd.ts +47 -0
- package/src/index.ts +60 -0
- package/src/internal/GoogleMobileAdsNativeEventEmitter.ts +58 -0
- package/src/internal/NativeError.ts +56 -0
- package/src/internal/SharedEventEmitter.ts +20 -0
- package/src/specs/components/GoogleMobileAdsBannerViewNativeComponent.ts +62 -0
- package/src/specs/components/GoogleMobileAdsMediaViewNativeComponent.ts +30 -0
- package/src/specs/components/GoogleMobileAdsNativeViewNativeComponent.ts +45 -0
- package/src/specs/modules/NativeAppModule.ts +57 -0
- package/src/specs/modules/NativeAppOpenModule.ts +26 -0
- package/src/specs/modules/NativeConsentModule.ts +532 -0
- package/src/specs/modules/NativeGoogleMobileAdsModule.ts +33 -0
- package/src/specs/modules/NativeGoogleMobileAdsNativeModule.ts +70 -0
- package/src/specs/modules/NativeInterstitialModule.ts +26 -0
- package/src/specs/modules/NativeRewardedInterstitialModule.ts +32 -0
- package/src/specs/modules/NativeRewardedModule.ts +26 -0
- package/src/types/AdEventListener.ts +34 -0
- package/src/types/AdEventsListener.ts +24 -0
- package/src/types/AdShowOptions.ts +12 -0
- package/src/types/AdStates.ts +92 -0
- package/src/types/AdapterStatus.ts +20 -0
- package/src/types/AppEvent.ts +14 -0
- package/src/types/BannerAdProps.ts +184 -0
- package/src/types/MobileAd.interface.ts +113 -0
- package/src/types/MobileAdsModule.interface.ts +80 -0
- package/src/types/NativeAdRequestOptions.ts +55 -0
- package/src/types/PaidEventListener.ts +9 -0
- package/src/types/RequestConfiguration.ts +40 -0
- package/src/types/RequestOptions.ts +137 -0
- package/src/types/RewardedAdReward.ts +14 -0
- package/src/types/index.ts +29 -0
- package/src/validateAdRequestConfiguration.ts +66 -0
- package/src/validateAdRequestOptions.ts +154 -0
- package/src/validateAdShowOptions.ts +41 -0
- package/src/validateNativeAdRequestOptions.ts +50 -0
- package/src/version.ts +2 -0
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
package com.facebook.react.viewmanagers;
|
|
2
|
+
|
|
3
|
+
import android.view.View;
|
|
4
|
+
import androidx.annotation.NonNull;
|
|
5
|
+
import androidx.annotation.Nullable;
|
|
6
|
+
import com.facebook.react.bridge.ReadableArray;
|
|
7
|
+
import com.facebook.react.uimanager.BaseViewManager;
|
|
8
|
+
import com.facebook.react.uimanager.BaseViewManagerDelegate;
|
|
9
|
+
import com.facebook.react.uimanager.LayoutShadowNode;
|
|
10
|
+
|
|
11
|
+
public class RNGoogleMobileAdsNativeViewManagerDelegate<
|
|
12
|
+
T extends View,
|
|
13
|
+
U extends
|
|
14
|
+
BaseViewManager<T, ? extends LayoutShadowNode>
|
|
15
|
+
& RNGoogleMobileAdsNativeViewManagerInterface<T>>
|
|
16
|
+
extends BaseViewManagerDelegate<T, U> {
|
|
17
|
+
public RNGoogleMobileAdsNativeViewManagerDelegate(U viewManager) {
|
|
18
|
+
super(viewManager);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
@Override
|
|
22
|
+
public void setProperty(@NonNull T view, String propName, @Nullable Object value) {
|
|
23
|
+
assert propName != null;
|
|
24
|
+
if (propName.equals("responseId")) {
|
|
25
|
+
mViewManager.setResponseId(view, value == null ? null : (String) value);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
@Override
|
|
30
|
+
public void receiveCommand(@NonNull T view, String commandName, ReadableArray args) {
|
|
31
|
+
assert commandName != null;
|
|
32
|
+
if (commandName.equals("registerAsset")) {
|
|
33
|
+
mViewManager.registerAsset(view, args.getString(0), args.getInt(1));
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
package com.facebook.react.viewmanagers;
|
|
2
|
+
|
|
3
|
+
import android.view.View;
|
|
4
|
+
import androidx.annotation.Nullable;
|
|
5
|
+
|
|
6
|
+
public interface RNGoogleMobileAdsNativeViewManagerInterface<T extends View> {
|
|
7
|
+
void setResponseId(T view, @Nullable String responseId);
|
|
8
|
+
|
|
9
|
+
void registerAsset(T view, String assetKey, int reactTag);
|
|
10
|
+
}
|
package/android/src/oldarch/io/invertase/googlemobileads/NativeGoogleMobileAdsNativeModuleSpec.kt
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
package io.invertase.googlemobileads
|
|
2
|
+
|
|
3
|
+
import com.facebook.react.bridge.Promise
|
|
4
|
+
import com.facebook.react.bridge.ReactApplicationContext
|
|
5
|
+
import com.facebook.react.bridge.ReactContextBaseJavaModule
|
|
6
|
+
import com.facebook.react.bridge.ReadableMap
|
|
7
|
+
import com.facebook.react.modules.core.DeviceEventManagerModule
|
|
8
|
+
|
|
9
|
+
abstract class NativeGoogleMobileAdsNativeModuleSpec(reactContext: ReactApplicationContext) : ReactContextBaseJavaModule(reactContext) {
|
|
10
|
+
abstract fun load(adUnitId: String, requestOptions: ReadableMap, promise: Promise)
|
|
11
|
+
abstract fun destroy(responseId: String)
|
|
12
|
+
|
|
13
|
+
fun emitOnAdEvent(params: ReadableMap) {
|
|
14
|
+
reactApplicationContext
|
|
15
|
+
.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter::class.java)
|
|
16
|
+
.emit("RNGMANativeAdEvent", params)
|
|
17
|
+
}
|
|
18
|
+
}
|
package/app.plugin.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('./plugin/build');
|
package/babel.config.js
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Debug-menu
|
|
2
|
+
|
|
3
|
+
The debug menu is a tool that allows you to test and debug your app's ad experience. It can be used to:
|
|
4
|
+
|
|
5
|
+
```js
|
|
6
|
+
await mobileAds().openDebugMenu(AD_UNIT_ID);
|
|
7
|
+
````
|
|
8
|
+
|
|
9
|
+
# Ad Inspector
|
|
10
|
+
|
|
11
|
+
Ad inspector is an in-app overlay that enables authorized devices to perform real-time analysis of test ad requests directly within a mobile app.
|
|
12
|
+
|
|
13
|
+
Using ad inspector, you can:
|
|
14
|
+
|
|
15
|
+
- Inspect your ad units
|
|
16
|
+
- Check whether your ads are filling as expected
|
|
17
|
+
- Identify errors and view details about how to resolve them
|
|
18
|
+
- View the details for each Open Bidding ad network per request
|
|
19
|
+
- View the mediation details for each ad network per request
|
|
20
|
+
- Test individual third-party Open Bidding or waterfall mediation ad sources
|
|
21
|
+
- Verify that you've correctly configured each ad unit for Open Bidding and waterfall mediation
|
|
22
|
+
|
|
23
|
+
To see more information about ad inspector, see the [official documentation](https://developers.google.com/admob/android/ad-inspector).
|
|
24
|
+
|
|
25
|
+
## Launch ad inspector
|
|
26
|
+
|
|
27
|
+
Ad inspector can be launched from anywhere in your app. There are three different ways to launch ad inspector.
|
|
28
|
+
|
|
29
|
+
1. Use the launch button from the debug menu.
|
|
30
|
+
2. Use the gesture that you selected in the ad inspector settings.
|
|
31
|
+
3. Programmatically using the provided API.
|
|
32
|
+
|
|
33
|
+
More information about laucnhing ad inspector is available in [official documentation](https://developers.google.com/admob/android/ad-inspector#launch_ad_inspector).
|
|
34
|
+
|
|
35
|
+
### Launch programmatically
|
|
36
|
+
|
|
37
|
+
Ad inspector can be launched programmatically with the `openAdInspector` method in the `MobileAds` instance.
|
|
38
|
+
|
|
39
|
+
```js
|
|
40
|
+
try {
|
|
41
|
+
await MobileAds().openAdInspector();
|
|
42
|
+
// The promise will resolve when the inspector is closed.
|
|
43
|
+
} catch (error) {
|
|
44
|
+
// The promise will reject if ad inspector is closed due to an error.
|
|
45
|
+
console.log(error);
|
|
46
|
+
}
|
|
47
|
+
```
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
# Common reasons for ads not showing
|
|
2
|
+
|
|
3
|
+
Use the following guide to understand common reasons why apps show few or no ads.
|
|
4
|
+
|
|
5
|
+
## Did you recently create your AdMob account?
|
|
6
|
+
|
|
7
|
+
Your account must be approved before ad requests will succeed.
|
|
8
|
+
When you first sign up for AdMob, your account is reviewed before it’s approved.
|
|
9
|
+
This typically takes less than 24 hours, but in rare cases can take up to 2 weeks.
|
|
10
|
+
You'll be notified of approval or rejection via email after review.
|
|
11
|
+
|
|
12
|
+
## Is your app or ad unit new?
|
|
13
|
+
|
|
14
|
+
New apps and ad units take some time to activate.
|
|
15
|
+
Here are common reasons you may not see live impressions immediately:
|
|
16
|
+
|
|
17
|
+
- It usually takes at least an hour after you create an app or ad unit
|
|
18
|
+
- Sometimes it can take a few days for ads to appear in new apps or ad units
|
|
19
|
+
- New iOS apps will not show Google ads until they’re listed in the Apple App Store
|
|
20
|
+
|
|
21
|
+
## Test ads not showing up
|
|
22
|
+
|
|
23
|
+
If you set up an app-ads.txt file for your app, you need to also include this line in your app-ads.txt file in order to load ads using the demo ad units:
|
|
24
|
+
`google.com, pub-3940256099942544, DIRECT, f08c47fec0942fa0`
|
|
25
|
+
|
|
26
|
+
- Set up app-ads.txt [iOS](https://developers.google.com/admob/ios/app-ads), [Android](https://developers.google.com/admob/android/app-ads)
|
|
27
|
+
- Enabling test ads [iOS](https://developers.google.com/admob/ios/test-ads), [Android](https://developers.google.com/admob/android/test-ads)
|
|
28
|
+
|
|
29
|
+
Alternatively, you can enable test devices and use your own ad unit IDs instead.
|
|
30
|
+
|
|
31
|
+
### Check Your ApplicationId
|
|
32
|
+
|
|
33
|
+
If you initiated your project with `react-native init`, the auto-generated `applicationId` might not fulfill the required structure or uniqueness needed for AdMob integration. This can lead to issues where the request was succesfull but no ads are shown. Here are common reasons and fixes related to `applicationId` issues:
|
|
34
|
+
|
|
35
|
+
- **Non-unique ApplicationId**: The default `applicationId` may clash with existing apps, especially if you haven't customized it. AdMob requires a unique identifier for each app to correctly manage ad requests and revenue.
|
|
36
|
+
|
|
37
|
+
- **Improperly Structured ApplicationId**: The `applicationId` should generally follow Java package name conventions, such as `com.companyname.appname`. It must start with a letter, and can only include letters (a-z, A-Z), numbers (0-9), and underscores (_).
|
|
38
|
+
|
|
39
|
+
Google documentation: [Configure the app module](https://developer.android.com/build/configure-app-module?hl=de)
|
|
40
|
+
|
|
41
|
+
**Important**: If you change the application ID of an already published app, Google Play Store treats the upload as a completely different app!
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
### Enable test devices
|
|
45
|
+
|
|
46
|
+
If you want to do more rigorous testing with production-looking ads, configure your device as a test device and use your own ad unit IDs that you've created in the AdMob UI.
|
|
47
|
+
Test devices can either be added in the AdMob UI or programmatically using the Google Mobile Ads SDK.
|
|
48
|
+
|
|
49
|
+
Follow the steps below to add your device as a test device.
|
|
50
|
+
|
|
51
|
+
#### Add your test device in the AdMob UI
|
|
52
|
+
|
|
53
|
+
For a simple, non-programmatic way to add a test device and test new or existing app builds, use the AdMob UI.
|
|
54
|
+
[Learn how](https://support.google.com/admob/answer/9691433).
|
|
55
|
+
|
|
56
|
+
#### Add your test device programmatically
|
|
57
|
+
|
|
58
|
+
If you want to test ads in your app as you're developing, follow the steps below to programmatically register your test device.
|
|
59
|
+
|
|
60
|
+
1. Load your ads-integrated app and make an ad request.
|
|
61
|
+
|
|
62
|
+
2. For **iOS** follow step 3, for **Android** skip to step 4.
|
|
63
|
+
|
|
64
|
+
3. Check the console for a message that looks like this:
|
|
65
|
+
|
|
66
|
+
```
|
|
67
|
+
GADMobileAds.sharedInstance.requestConfiguration.testDeviceIdentifiers =
|
|
68
|
+
@[ @"2077ef9a63d2b398840261c8221a0c9b" ]; // Sample device ID
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Copy your test device ID to your clipboard.
|
|
72
|
+
|
|
73
|
+
4. Check the logcat output for a message that looks like the one below, which shows you your device ID and how to add it as a test device:
|
|
74
|
+
|
|
75
|
+
```
|
|
76
|
+
I/Ads: Use RequestConfiguration.Builder.setTestDeviceIds(Arrays.asList("33BE2250B43518CCDA7DE426D04EE231"))
|
|
77
|
+
to get test ads on this device."
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Copy your test device ID to your clipboard.
|
|
81
|
+
|
|
82
|
+
5. Modify your code to set the test device ID through testDeviceIdentifiers
|
|
83
|
+
|
|
84
|
+
```js
|
|
85
|
+
import mobileAds from 'react-native-google-mobile-ads';
|
|
86
|
+
|
|
87
|
+
mobileAds()
|
|
88
|
+
.setRequestConfiguration({
|
|
89
|
+
// An array of test device IDs to add to the allow list.
|
|
90
|
+
testDeviceIdentifiers: ['2077ef9a63d2b398840261c8221a0c9b', 'EMULATOR'],
|
|
91
|
+
})
|
|
92
|
+
.then(() => {
|
|
93
|
+
// Request config successfully set!
|
|
94
|
+
});
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
6. Re-run your app. If the ad is a Google ad, you'll see a Test Ad label centered at the top of the ad.
|
|
98
|
+
Ads with this Test Ad label are safe to click. Requests, impressions, and clicks on test ads will not show up in your account's reports.
|
|
99
|
+
|
|
100
|
+
## Emulator vs real device
|
|
101
|
+
|
|
102
|
+
In some cases ads won't show up on an emulator but will show up while testing on a real device.
|
|
103
|
+
|
|
104
|
+
## Are you using a private DNS provider?
|
|
105
|
+
|
|
106
|
+
Some private DNS providers can block ads from displaying. If your device or emulator is using a private DNS, switch it to Automatic in the settings to ensure it is not blocking ads.
|
|
107
|
+
|
|
108
|
+
## Extra links
|
|
109
|
+
|
|
110
|
+
- Mobile Ads SDK [iOS](https://developers.google.com/admob/ios/quick-start), [Android](https://developers.google.com/admob/android/quick-start)
|
|
111
|
+
- [Common reasons for ads not showing](https://support.google.com/admob/answer/9469204)
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
# Hooks
|
|
2
|
+
|
|
3
|
+
The AdMob package provides hooks to help you to display ads in a functional component with tiny code. The supported ad formats are full-screen ads: App open, Interstitial, Rewarded, and Rewarded Interstitial.
|
|
4
|
+
|
|
5
|
+
## Load an ad
|
|
6
|
+
|
|
7
|
+
You can create a new ad by adding a corresponding ad type's hook to your component.
|
|
8
|
+
|
|
9
|
+
The first argument of the hook is the "Ad Unit ID".
|
|
10
|
+
For testing, we can use a Test ID, however for production the ID from the
|
|
11
|
+
Google AdMob dashboard under "Ad units" should be used:
|
|
12
|
+
|
|
13
|
+
```tsx {4-8}
|
|
14
|
+
import { useInterstitialAd, TestIds } from 'react-native-google-mobile-ads';
|
|
15
|
+
|
|
16
|
+
export default function App() {
|
|
17
|
+
const interstitialAd = useInterstitialAd(TestIds.Interstitial);
|
|
18
|
+
|
|
19
|
+
return <View>{/* ... */}</View>;
|
|
20
|
+
}
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
<Info>
|
|
24
|
+
The `adUnitid` parameter can also be used to manage creation and destruction of an ad instance.
|
|
25
|
+
If `adUnitid` is set or changed, new ad instance will be created and previous ad instance will be destroyed if exists.
|
|
26
|
+
If `adUnitid` is set to `null`, no ad instance will be created and previous ad instance will be destroyed if exists.
|
|
27
|
+
</Info>
|
|
28
|
+
|
|
29
|
+
The second argument is an additional optional request options object to be sent whilst loading an advert, such as keywords & location.
|
|
30
|
+
Setting additional request options helps AdMob choose better tailored ads from the network.
|
|
31
|
+
View the [`RequestOptions`](https://github.com/invertase/react-native-google-mobile-ads/blob/main/src/types/RequestOptions.ts) source code to see the full range of options available.
|
|
32
|
+
|
|
33
|
+
## Show the ad
|
|
34
|
+
|
|
35
|
+
The hook returns several states and functions to control ad.
|
|
36
|
+
|
|
37
|
+
```tsx
|
|
38
|
+
import { useInterstitialAd, TestIds } from 'react-native-google-mobile-ads';
|
|
39
|
+
|
|
40
|
+
export default function App({ navigation }) {
|
|
41
|
+
const { isLoaded, isClosed, load, show } = useInterstitialAd(TestIds.INTERSTITIAL);
|
|
42
|
+
|
|
43
|
+
useEffect(() => {
|
|
44
|
+
// Start loading the interstitial straight away
|
|
45
|
+
load();
|
|
46
|
+
}, [load]);
|
|
47
|
+
|
|
48
|
+
useEffect(() => {
|
|
49
|
+
if (isClosed) {
|
|
50
|
+
// Action after the ad is closed
|
|
51
|
+
navigation.navigate('NextScreen');
|
|
52
|
+
}
|
|
53
|
+
}, [isClosed, navigation]);
|
|
54
|
+
|
|
55
|
+
return (
|
|
56
|
+
<View>
|
|
57
|
+
<Button
|
|
58
|
+
title="Navigate to next screen"
|
|
59
|
+
onPress={() => {
|
|
60
|
+
if (isLoaded) {
|
|
61
|
+
show();
|
|
62
|
+
} else {
|
|
63
|
+
// No advert ready to show yet
|
|
64
|
+
navigation.navigate('NextScreen');
|
|
65
|
+
}
|
|
66
|
+
}}
|
|
67
|
+
/>
|
|
68
|
+
</View>
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
The code above immediately starts to load a new advert from the network (via `load()`).
|
|
74
|
+
When user presses button, it checks if the ad is loaded via `isLoaded` value,
|
|
75
|
+
then the `show` function is called and the advert is shown over-the-top of your application.
|
|
76
|
+
Otherwise, if the ad is not loaded, the `navigation.navigate` method is called to navigate to the next screen without showing the ad.
|
|
77
|
+
After the ad is closed, the `isClosed` value is set to `true` and the `navigation.navigate` method is called to navigate to the next screen.
|
|
78
|
+
|
|
79
|
+
If needed, you can reuse the existing hook to load more adverts and show them when required. The states are initialized when the `load` function is called.
|
|
80
|
+
|
|
81
|
+
Return values of the hook are:
|
|
82
|
+
|
|
83
|
+
| Name | Type | Description |
|
|
84
|
+
| :------------- | :--------------------------------- | :----------------------------------------------------------------------------------------------------------------- |
|
|
85
|
+
| isLoaded | boolean | Whether the ad is loaded and ready to to be shown to the user. Automatically set to false when the ad was shown. |
|
|
86
|
+
| isOpened | boolean | Whether the ad is opened. The value is remained `true` even after the ad is closed unless **new ad is requested**. |
|
|
87
|
+
| isClicked | boolean | Whether the ad is clicked. |
|
|
88
|
+
| isClosed | boolean | Whether your ad is dismissed. |
|
|
89
|
+
| isShowing | boolean | Whether your ad is showing. The value is equal with `isOpened && !isClosed`. |
|
|
90
|
+
| error | Error \| undefined | `Error` object throwed during ad load. |
|
|
91
|
+
| revenue | PaidEvent | See [Impression-level ad revenue] |
|
|
92
|
+
| reward | [RewardedAdReward](#) \| undefined | Loaded reward item of the Rewarded Ad. Available only in RewardedAd. |
|
|
93
|
+
| isEarnedReward | boolean | Whether the user earned the reward by Rewarded Ad. |
|
|
94
|
+
| load | Function | Start loading the advert with the provided RequestOptions. |
|
|
95
|
+
| show | Function | Show the loaded advert to the user. |
|
|
96
|
+
|
|
97
|
+
<Info>
|
|
98
|
+
Note that `isOpened` value remains `true` even after the ad is closed.
|
|
99
|
+
The value changes to `false` when ad is initialized via calling `load()`.
|
|
100
|
+
To determine whether the ad is currently showing, use `isShowing` value.
|
|
101
|
+
</Info>
|
|
102
|
+
|
|
103
|
+
[Impression-level ad revenue]: /impression-level-ad-revenue
|