react-native-airpush

1.0.12 • Public • Published

react-native-airpush

Airpush support for Android

Getting started

$ npm install react-native-airpush --save

Mostly automatic installation

$ react-native link react-native-airpush

Manual installation

Android

  1. Open up android/app/src/main/java/[...]/MainActivity.java
  • Add import me.jerson.mobile.ads.airpush.RNAirpushPackage; to the imports at the top of the file
  • Add new RNAirpushPackage() to the list returned by the getPackages() method
  1. Append the following lines to android/settings.gradle:
    include ':react-native-airpush'
    project(':react-native-airpush').projectDir = new File(rootProject.projectDir, 	'../node_modules/react-native-airpush/android')
    
  2. Insert the following lines inside the dependencies block in android/app/build.gradle:
      compile project(':react-native-airpush')
    
  3. Add com-YOURPACKAGETOKEN.jar to your android/app/libs/airpush dir
  4. Replace YOURPACKAGETOKEN with your Airpush token in node_modules/react-native-airpush/android/src/main/java/me/jerson/mobile/ads/airpush/*.java dir

Usage

import Airpush, { BannerView } from "react-native-airpush";

type AdType =
  | "appwall"
  | "interstitial"
  | "landing_page"
  | "overlay"
  | "smartwall"
  | "video";

Airpush.setAppId(appId);
Airpush.setApiKey(apiKey);
Airpush.setEulaLanguage(language);
Airpush.setPlacementId(id);
Airpush.setTestMode(enabled);
Airpush.setCachingEnabled(enabled);
Airpush.setShowErrorDialog(enabled);
Airpush.startIconAd();
Airpush.startPushAd();
Airpush.start360BannerAd();
Airpush.startInterstitialAd(adType);

<BannerView width={320} height={50} />;

Readme

Keywords

Package Sidebar

Install

npm i react-native-airpush

Weekly Downloads

9

Version

1.0.12

License

MIT

Unpacked Size

27.6 kB

Total Files

14

Last publish

Collaborators

  • pardacho