From 3bd32531d98538e6dc552f536cbe5a0a57ca85f5 Mon Sep 17 00:00:00 2001 From: Koen Punt Date: Tue, 3 Oct 2017 22:21:58 +0200 Subject: [PATCH 1/2] alpha => beta --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8654be5c5..9917fecc6 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # react-native-admob [![npm version](https://badge.fury.io/js/react-native-admob.svg)](https://badge.fury.io/js/react-native-admob) -### ⚠️ Please note, the master branch tracks development of version 2 of this library, which is currently in alpha. For version 1 please check out the [1.x branch](https://github.com/sbugert/react-native-admob/tree/1.x). +### ⚠️ 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](https://github.com/sbugert/react-native-admob/tree/1.x). A react-native module for Google AdMob GADBanner, DFPBanner and GADInterstitial (react-native v0.19.0 or newer required). From 93e8c43284e674429ae10794b1be4e31c8bb8165 Mon Sep 17 00:00:00 2001 From: Koen Punt Date: Tue, 3 Oct 2017 22:41:50 +0200 Subject: [PATCH 2/2] remove linking specifics since there are no anomalies we can simply refer to the default linking guide if that might not be sufficient we can always opt for an additional wiki page dedicated to linking the library --- README.md | 56 ++++++++++++------------------------------------------- 1 file changed, 12 insertions(+), 44 deletions(-) diff --git a/README.md b/README.md index 9917fecc6..5074c719a 100644 --- a/README.md +++ b/README.md @@ -2,63 +2,31 @@ ### ⚠️ 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](https://github.com/sbugert/react-native-admob/tree/1.x). -A react-native module for Google AdMob GADBanner, DFPBanner and GADInterstitial (react-native v0.19.0 or newer required). +A react-native module for Google AdMob Banners, Interstitials, and Rewarded Videos, and also DFP Banners. -The banner is implemented as a component while the interstitial has an imperative API. +The banner types are implemented as components while the interstitial and rewarded video have an imperative API. ## Installation -### Automatic Installation (recommended) +You can use npm or Yarn to install the latest beta version: -1. `npm i react-native-admob -S` -2. `react-native link react-native-admob` -3. Add the [Google Mobile Ads SDK](https://developers.google.com/admob/ios/quick-start#import_the_mobile_ads_sdk) to your Xcode project with CocoaPods or manually. This is only needed for iOS and guarantees your app is using the newest AdMob version. +**npm:** -### Manual Installation + npm i --save react-native-admob@next -#### iOS +**Yarn:** -1. `npm i react-native-admob -S` -2. Add the [Google Mobile Ads SDK](https://developers.google.com/admob/ios/quick-start#import_the_mobile_ads_sdk) to your Xcode project with CocoaPods or manually. This is only needed for iOS and guarantees your app is using the newest AdMob version. -3. Add react-native-admob static library to your Xcode project like explained [here](http://facebook.github.io/react-native/docs/linking-libraries-ios.html#manual-linking). (Step 3 of this guide is not needed) + yarn add react-native-admob@next -#### Android +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](https://facebook.github.io/react-native/docs/linking-libraries-ios.html#content). -1. `npm i react-native-admob -S` -2. Make the following additions to the given files: +### iOS -**`android/settings.gradle`** +For iOS you will have to add the [Google Mobile Ads SDK](https://developers.google.com/admob/ios/quick-start#import_the_mobile_ads_sdk) to your Xcode project. -```groovy -include ':react-native-admob' -project(':react-native-admob').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-admob/android') -``` - -**`android/app/build.gradle`** - -```groovy -dependencies { - // ... - compile project(':react-native-admob') -} -``` - -**`MainApplication.java`** +### Android -In **MainAplication.java** on top, where imports are: - -```java -import com.sbugert.rnadmob.RNAdMobPackage; -``` - -Under `protected List getPackages() {`: - -```java - return Arrays.asList( - new MainReactPackage(), - new RNAdMobPackage() - ); -``` +On Android the AdMob library code is part of Play Services, which is automatically added when this library is linked. ## Usage