⚠️ Please note, the master branch tracks development of version 2 of this library, which is currently in beta. For version 1 please check out the 1.x branch.
A react-native module for Google AdMob Banners, Interstitials, Rewarded Videos and also DFP Banners.
The banner types are implemented as components while the interstitial and rewarded video have an imperative API.
You can use npm or Yarn to install the latest beta version:
npm:
npm i --save react-native-admob@next
Yarn:
yarn add react-native-admob@next
In order to use this library, you have to link it to your project first. There's excellent documentation on how to do this in the React Native Docs.
Alternatively for iOS you can install the library with CocoaPods by adding a line to your Podfile
;
pod 'react-native-admob', path: '../node_modules/react-native-admob'
For iOS you will have to add the Google Mobile Ads SDK to your Xcode project.
On Android the AdMob library code is part of Play Services, which is automatically added when this library is linked.
But you still have to manually update your AndroidManifest.xml
, as described in the Google Mobile Ads SDK documentation.