Admob sample for React Native.
-
clone repo
git clone https://github.com/melihmucuk/react-native-admob-sample.git -
run
npm installcommand on root folder -
edit index.ios.js
var BannerAdUnitId = 'Your Banner Ad Unit ID'; var InterstitialAdUnitId = 'Your Interstitial Ad Unit ID';
- Please follow admob ios tutorial here Note: if you install admob via PodFile, then you will need to do the following: Add ‘$(inherited)’ to Build settings-> Other Linker Flags
- Copy
AdMobManager.handAdMobManager.mfiles to your project. - Then follow
Usagesection
-
require
NativeModulesvar AdMob = require('NativeModules').AdMobManager; -
for loading Interstitial Ad
AdMob.loadInterstitial(InterstitialAdUnitId); -
for showing Interstitial Ad
AdMob.showInterstitial(); -
for showing Banner Ad
AdMob.showBannerOnBottomOfTheView(BannerAdUnitId);
Before showing Interstitial Ads, you have to call loadInterstitial func.
react-native: 0.0.9
google admob ios sdk: 7.4.1

