Giter Club home page Giter Club logo

react-native-revmob's Introduction

RevMob React-Native package

Overview

It takes 3 simple steps to start monetizing:

  1. Add your app to our system and get your Media Id
  2. Add the package to your project
  3. Implement Start Session and Ad Unit code

You can find more details about RevMob's package integration at Official RevMob documentation

###Requirements react-native 0.25.0 or newer

To add the plugin to your existing React Native project:

Using rnpm:

  1. Using your terminal, go to your project directory and enter the command: npm install --save react-native-revmob
  2. react-native link
  3. Add the file RevMobAds.framework that is included inside the ios folder (yourProject/node_modules/react-native-revmob/ios) to your project.
  4. (Optional) Add RevMob's Fullscreen Activity to your AndroidManifest.xml:
<activity android:name="com.revmob.FullscreenActivity"
            android:theme="@android:style/Theme.Translucent"
            android:configChanges="keyboardHidden|orientation">
</activity>

Manually

iOS
  1. npm i react-native-revmob -S
  2. Add the file RevMobAds.framework that is included inside the ios folder (yourProject/node_modules/react-native-revmob/ios) to your project.
  3. Add react-native-revmob static library to your Xcode project: Official React Native guide (Step 3 not needed).
Android
  1. npm i react-native-admob -S
  2. Add the following lines to the given files:

android/settings.gradle

include ':react-native-revmob'
project(':react-native-revmob').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-revmob/android')

android/app/build.gradle

dependencies {
   ...
   compile project(':react-native-revmob')
}

MainActivity.java

import com.rctrevmob.RevMobPackage; // Add this import
...

	protected List<ReactPackage> getPackages() {
        return Arrays.<ReactPackage>asList(
            new MainReactPackage(),
            new RevMobPackage() // Add this line
        );
    }

Sample App

For more information, see the example project: Sample App

Basic Usage

import { RevMobManager } from 'react-native-revmob';

// Methods:
RevMobManager.startSession('YOUR-MEDIA-ID', callback);
RevMobManager.loadFullscreen();
RevMobManager.showPreLoadedFullscreen();
RevMobManager.showBanner();
RevMobManager.hideBanner();
RevMobManager.loadVideo();
RevMobManager.showVideo();
RevMobManager.loadRewardedVideo();
RevMobManager.showRewardedVideo();
RevMobManager.loadAdLink();
RevMobManager.openLoadedAdLink();

For more information, please refer to the official documentation

###Forum

Be sure to also join the developer community on our forum.

###License

License

react-native-revmob's People

Contributors

thiagomurakami avatar 7kfpun avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.