Skip to content

Latest commit

History

19 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

react-native-startapp

React Native wrapper of Startapp ads SDK

Only Android is supported for now

Usage

importReactfrom"react";import{DeviceEventEmitter}from"react-native";importStartapp,{Banner,DISPLAY_EVENT,INTERSTITIAL_MODE,REWARDED_MODE,UNKNOWN_MODE,CLOSED_ACTION,CLICKED_ACTION}from"react-native-startapp";// SetupconstuseReturnAds=false;awaitStartapp.initialize(STARTAPP_APP_ID,useReturnAds);awaitStartapp.disableSplash();awaitStartapp.setTestAdsEnabled(true);awaitStartapp.setUserConsent(true);// RewardedStartapp.addRewardedListener(()=>console.log("rewarded watched!"));awaitStartapp.loadRewarded();awaitStartapp.showRewarded();// InterstitialawaitStartapp.loadInterstitial();awaitStartapp.showInterstitial();// Events: Native -> JSDeviceEventEmitter.addListener(DISPLAY_EVENT,({ mode, action })=>{if(mode===INTERSTITIAL_MODE){if(action===CLOSED_ACTION)console.log("Interstitial closed");elseif(action===CLICKED_ACTION)console.log("Interstitial clicked");}elseif(mode===REWARDED_MODE){if(action===CLOSED_ACTION)console.log("Rewarded closed");elseif(action===CLICKED_ACTION)console.log("Rewarded clicked");}elseif(mode===UNKNOWN_MODE){console.log("Unknown ad mode");}});// Banner<Bannerstyle={{width: 320,height: 50}}/>;

About

React Native implementation of Startapp ads SDK

Resources

Stars

5 stars

Watchers

3 watching

Forks

Releases

Packages

Used by

Contributors

Languages