th0th / react-native-unity-ads

React Native module for display ads from Unity Ads (uses the new SDK V2.0).

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

react-native-unity-ads

react-native-unity-ads enables you to show Unity ADS in your React Native based app using Unity Ads SDK 2.0 (Android, iOS).

Note: The library is Android-only for now. PRs for iOS are welcome.

## Installation

Quick

For quick installation, you can install the npm package and then let react-native do the hard work.

$ npm install --save react-native-unity-ads
$ react-native link

Manual

Android

android/settings.gradle
include ':app', ':react-native-unity-ads'
project(':react-native-unity-ads').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-unity-ads/android')
android/app/build.gradle
dependencies {
  compile project(':react-native-unity-ads')
  ...
}
android/app/src/main/java/YOUR/PACKAGE/PATH/MainApplication.java
// Add after other com.facebook imports
import me.th0th.rnunityads.RNUnityAdsPackage;

...
@Override
protected List<ReactPackage> getPackages() {
  return Arrays.<ReactPackage>asList(
    new MainReactPackage(),
    // The part that comes from your other native modules goes here.
    new RNUnityAdsPackage()
  );
}
...

Usage

Hopefully, a nice API documentation will be available soon, but until then, you can see the example application RNUnityAdsExample.

License

This library is made available under Apache License 2.0.

About

React Native module for display ads from Unity Ads (uses the new SDK V2.0).

License:Apache License 2.0


Languages

Language:Java 32.8%Language:JavaScript 32.8%Language:Objective-C 25.0%Language:Python 9.4%