@premiumads/react-native-admob-adapter
v1.0.2
Published
PremiumAds AdMob mediation adapter for React Native (react-native-google-mobile-ads).
Downloads
347
Maintainers
Readme
@premiumads/react-native-admob-adapter
PremiumAds mediation adapter for react-native-google-mobile-ads.
Wires the PremiumAds AdMob custom-event adapter into your React Native app's Android and iOS builds so that Google Mobile Ads mediation can fill inventory from the PremiumAds network.
Installation
npm install @premiumads/react-native-admob-adapter react-native-google-mobile-adsiOS
Nothing extra to configure. PremiumAdsGoogleAdapter is published on CocoaPods trunk and is pulled in transitively by the wrapper podspec:
cd ios && pod installAndroid
Nothing extra to configure. The wrapper's build.gradle already adds the PremiumAds JFrog Maven repository (https://repo.premiumads.net/artifactory/mobile-ads-sdk/) and pulls in net.premiumads.sdk:admob-adapter-v2 via autolinking.
Usage
import mobileAds from 'react-native-google-mobile-ads';
import {setDebug} from '@premiumads/react-native-admob-adapter';
// Enable verbose logging from the PremiumAds adapter (dev only)
setDebug(__DEV__);
mobileAds().initialize().then(statuses => {
console.log('Adapters:', statuses);
});Once initialized, use the standard react-native-google-mobile-ads APIs (BannerAd, InterstitialAd, RewardedAd, AppOpenAd, etc.). The PremiumAds adapter will receive ad requests via AdMob mediation when your ad units are configured to mediate through PremiumAds in the AdMob console.
See the example/ folder for a full working example app.
Supported ad formats
- Banner
- Interstitial
- Rewarded
- Rewarded Interstitial
- App Open
- Native (via
react-native-google-mobile-adsnative ad support)
Versioning
This JS package is versioned independently from the native adapters. It pins:
- Android:
net.premiumads.sdk:admob-adapter-v2:1.0.9 - iOS:
PremiumAdsGoogleAdapter(1.0.6)
License
MIT © PremiumAds
