https://github.com/jerson/react-native-airpush
Airpush support for **Android**
https://github.com/jerson/react-native-airpush
Last synced: 9 months ago
JSON representation
Airpush support for **Android**
- Host: GitHub
- URL: https://github.com/jerson/react-native-airpush
- Owner: jerson
- Created: 2018-06-16T19:51:39.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-06-23T21:53:19.000Z (about 8 years ago)
- Last Synced: 2025-03-11T21:38:11.842Z (over 1 year ago)
- Language: Java
- Size: 16.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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
2. 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')
```
3. Insert the following lines inside the dependencies block in `android/app/build.gradle`:
```
compile project(':react-native-airpush')
```
4. Add `com-YOURPACKAGETOKEN.jar` to your `android/app/libs/airpush` dir
5. Replace `YOURPACKAGETOKEN` with your Airpush token in `node_modules/react-native-airpush/android/src/main/java/me/jerson/mobile/ads/airpush/*.java` dir
## Usage
```javascript
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);
;
```