Admob sample for React Native.
Objective-C JavaScript C
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
AdMobSample.xcodeproj
AdMobSampleTests
GoogleMobileAds.framework
iOS
.flowconfig
.gitignore
.npmignore
README.md
index.ios.js
package.json

README.md

react-native-admob-sample

Admob sample for React Native.

banner Interstitial

Installation

  • clone repo git clone https://github.com/melihmucuk/react-native-admob-sample.git

  • run npm install command on root folder

  • edit index.ios.js

    var BannerAdUnitId = 'Your Banner Ad Unit ID';
     var InterstitialAdUnitId = 'Your Interstitial Ad Unit ID';

Use In Your App

  1. 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
  2. Copy AdMobManager.h and AdMobManager.m files to your project.
  3. Then follow Usage section

Usage

  • require NativeModules

    var AdMob = require('NativeModules').AdMobManager;

  • for loading Interstitial Ad

    AdMob.loadInterstitial(InterstitialAdUnitId);

  • for showing Interstitial Ad

    AdMob.showInterstitial();

  • for showing Banner Ad

    AdMob.showBannerOnBottomOfTheView(BannerAdUnitId);

Notes

Before showing Interstitial Ads, you have to call loadInterstitial func.

Versions

react-native: 0.0.9

google admob ios sdk: 7.4.1