0.1.0 • Published 1 year ago
react-native-appnext-bridge v0.1.0
react-native-appnext
AppNext using ads on react-native
Installation
npm install react-native-appnext
Usage
import { BannerView, FullScreen, Interstitial, Rewarded } from 'react-native-appnext';
Interstitial
import {Interstitial} from 'react-native-appnext';
Use the config params to set your preferences (See more options on main documentation) example:const config = {specificCategories:'SHOPPING' };
Interstitial.setConfig(config);
Add listeners for onAdLoaded (See more options on main documentation)
Interstitial.onAdLoaded((msg: String) => {
console.log(msg);
});
Load the ad Interstitial.load('placementID',
(err: String) => {
console.log(err);
},
(msg: String) => {
console.log(msg);
});
Finally show the ad
Interstitial.showAd();
FullScreen
import {FullScreen} from 'react-native-appnext';
Use the config params to set your preferences (See more options on main documentation) example:const config = {specificCategories:'SHOPPING' };
FullScreen.setConfig(config);
Add listeners for onAdLoaded (See more options on main documentation)
FullScreen.onAdLoaded((msg: String) => {
console.log(msg);
});
Load the ad FullScreen.load('placementID',
(err: String) => {
console.log(err);
},
(msg: String) => {
console.log(msg);
});
Finally show the ad
FullScreen.showAd();
Rewarded
import {Rewarded} from 'react-native-appnext';
Use the config params to set your preferences (See more options on main documentation) example:const config = {specificCategories:'SHOPPING' };
Rewarded.setConfig(config);
Add listeners for onAdLoaded (See more options on main documentation)
Rewarded.onAdLoaded((msg: String) => {
console.log(msg);
});
Load the ad Rewarded.load('placementID',
(err: String) => {
console.log(err);
},
(msg: String) => {
console.log(msg);
});
Finally show the ad
Rewarded.showAd();
Banner
import { BannerView } from 'react-native-appnext';
Place the view in the selected location on the screen by adding
<BannerView placementId="pid"/> (See more options on main documentation)
0.1.0
1 year ago