react-native-appodeal
React Native package that adds Appodeal SDK support to your react-native application.
Getting started
$ npm install react-native-appodeal --save
Mostly automatic installation
$ react-native link react-native-appodeal
Manual installation
iOS
- In XCode, in the project navigator, right click
Libraries
➜Add Files to [your project's name]
- Go to
node_modules
➜react-native-appodeal
and addRNAppodeal.xcodeproj
- In XCode, in the project navigator, select your project. Add
libRNAppodeal.a
to your project'sBuild Phases
➜Link Binary With Libraries
- Run your project (
Cmd+R
)<
Android
- Open up
android/app/src/main/java/[...]/MainApplication.java
- Add
import com.reactlibrary.RNAppodealPackage;
to the imports at the top of the file - Add
new RNAppodealPackage()
to the list returned by thegetPackages()
method
- Append the following lines to
android/settings.gradle
:include ':react-native-appodeal' project(':react-native-appodeal').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-appodeal/android')
- Insert following lines inside the dependencies block in
android/app/build.gradle
:compile project(':react-native-appodeal')
After install Configuration
iOS Configuration
- Download Appodeal SDK and unzip it somewhere.
- Drag'n'drop it to the opened XCode project and select copy if needed or add it manually.
- Go to
Build Phases
, expandLink Binnary With Libraries
and add there following frameworks and libraries: AdSupport, AudioToolbox, AVFoundation, CFNetwork, CoreGraphics, CoreImage, CoreLocation, CoreMedia, CoreMotion, CoreTelephony, EventKitUI, GLKit, ImageIO, JavaScriptCore, libc++, libsqlite3.dylib, libxml2.2.dylib, libz.dylib, MediaPlayer, MessageUI, MobileCoreServices, QuartzCore, Security, StoreKit, SystemConfiguration, Twitter, UIKit, WebKit. - Set up the following keys in your app’s info.plist:
<key>NSAppTransportSecurity</key><dict> <key>NSAllowsArbitraryLoads</key> <true/></dict>
Android
- Insert following repository (to use AdColony ad network with Appodeal) inside repositories block in
android/app/build.gradle
:
maven { url "https://adcolony.bintray.com/AdColony" }
- Add Google Play Services Ads and Location into your gradle dependencies of
android/app/build.gradle
:
compile "com.google.android.gms:play-services-ads:9.8.0"compile "com.google.android.gms:play-services-location:9.8.0"
- Enable multiDex in your application. Follow this documentation to enable it.
Usage
; /*Available Ad Types:Appodeal.NONE = 0;Appodeal.INTERSTITIAL = 3;Appodeal.BANNER = 4;Appodeal.BANNER_BOTTOM = 8;Appodeal.BANNER_TOP = 16;Appodeal.REWARDED_VIDEO = 128;Appodeal.NON_SKIPPABLE_VIDEO = 256;*/ //additional configuration that should be used before initialization: //set ad auto caching enabled/disabled:Appodeal;//enable/disable tablet banners support:Appodeal;//enable/disable smart banners support:Appodeal;//enable/disable banner refresh animation:Appodeal;//enable/disable banner background:Appodeal;//set testing mode enabled/disabledAppodeal;/*enabled/disable additional logging from sdk for debugging:available constants: LogLevel.none | LogLevel.debug | LogLevel.verbose */Appodeal;//enable/disable child direct threatment:Appodeal;//enable/disable triggering show for precache ads:Appodeal;//disable network:Appodeal;//disable network for ad type:Appodeal;//disable location tracking:Appodeal;//disable write external permission warning on app start if its missing:Appodeal;//request Android M permissions on app start:Appodeal;//mute calls if calls muted on Android:Appodeal; //Initialize Appodeal SDK:Appodeal; //Display Ads, can return bool if ads was shown or not in a callback parameter:Appodeal;//orAppodeal; //Caching ad an if autocache was disabled before initialization:Appodeal; //Hiding banner ads:Appodeal; //Check if an ad was loaded:Appodeal; //Check if loaded ad is precache or not:Appodeal; //Check if ad can be shown for specified placement or default placement:Appodeal; //Show test Screen for testing network integrations:Appodeal; //Ad Events available with Appodeal React Native Module://Interstitial callbacksAppodeal;Appodeal;Appodeal;Appodeal;Appodeal; //Banner callbacksAppodeal;Appodeal;Appodeal;Appodeal; //Rewarded video callbacksAppodeal;Appodeal;Appodeal;Appodeal;Appodeal; //Rewarded video callbacksAppodeal;Appodeal;Appodeal;Appodeal;Appodeal;
Changelog
2.1.4
- release