Skip to content

melihmucuk/react-native-admob-sample

Repository files navigation

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

About

Admob sample for React Native.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published