Unity Plugin

Appnext Unity plugin

Download the Unity Plugin

You can download the Unity plugin from here

Android Unity Integration

Requirements

  • Google Play Services (Location and Basement) are mandatory in order to use this plugin, please make sure to add them to your Unity project before you begin
  • The Appnext Unity3D PlugIn supports Android API 23+ when building for Android.
  • The Appnext Unity3D PlugIn requires internet access to pull ads information for your game.

The process of integrating Appnext is fairly straightforward and does not require heavy programming. The required steps for using Appnext in your applications are outlined below:

  • Add the files to your assets folder
  • Show the ad unit

Step 1: Import the Files to Your Assets Folder

Click on Assets> Import Package > Custom Package…
And select the downloaded appnextUnitySDK.unitypackage file.

🚧

Important Note

  • If you have the mainTemplate.gradle file, please import all files except mainTemplate.gradle. In addition, please add 'implementation ‘com.appnext.sdk:unity-adapter:2.5.0.472’

  • For Interstitial, Full-Screen and Rewarded Ad-Units, please add 'implementation ‘com.appnext.sdk:ads:2.5.0.472’

  • For Banners, please add implementation ‘com.appnext.sdk:banners:2.5.0.472’

348

Otherwise import all.

Step 2: Add Google Play Services and Security-crypto to your mainTemplate.gradle.

implementation ‘com.google.android.gms:play-services-ads-identifier:17.0.0’
implementation 'androidx.security:security-crypto:1.0.0-alpha02'

Step 3: ProGuard (Optional)

Exclude Appnext from your ProGuard by using the line:

-keep class com.appnext.** { *; }
-dontwarn com.appnext.**

🚧

Important Note!

  • Each placement has a Placement ID. If you integrate multiple placements, you will need to use a different Placement ID for each.
  • The implementation should be tested on a device and not in a unity simulator.
  • Make sure to use Android Placement IDs in Android project and iOS Placement IDs in iOS project

iOS Unity Integration

Integrating Appnext with your iOS game or app

Requirements

  • The Appnext Unity3D PlugIn supports iOS 7.0 and higher when building for iOS.
  • The Appnext Unity3D PlugIn requires internet access to pull ads information for your game.

The process of integrating Appnext is fairly straightforward and does not require heavy programming. The required steps for using Appnext in your applications are outlined below:

  • Add the files to your assets folder
  • Edit the project settings and add frameworks
  • Show the ad unit

The actual code-level integration is described in the sections below. Should you have any problems integrating the product, log a ticket with us by emailing [email protected].

Step 1: Import the Files to Your Assets Folder

Click on Assets> Import Package > Custom Package…
And select the downloaded appnextUnitySDK.unitypackage file.

348

Otherwise import all.

Step 2: Edit the project settings

In the iOS player settings make sure to check the Allow downloads over HTTP.

588

Step 3: Add additional Frameworks

After building the project for iOS, in the xcode project add additional system frameworks to your project:
These frameworks are required for the work of the SDK.
Click on your project in the ‘Project navigator’->’Build Phases’->’Link Binary With Libraries’->’+’ and add the following frameworks if not included already:

  • ‘QuartzCore.framework’
  • ‘Security.framework’
  • ‘CFNetwork.framework’
  • ‘AVFoundation.framework’
  • ‘SystemConfiguration.framework’
  • ‘MobileCoreServices.framework’
  • ‘CoreGraphics.framework’
  • ‘CoreMedia.framework’
  • ‘AdSupport.framework’
  • ‘UIKit.framework’
  • ‘Foundation.framework’
  • ‘CoreTelephony.framework’

Step 4: Add additional Linker flags

Add ‘-ObjC’ linker flag. Go to ‘Build Settings’->‘Other Linker Flags’ and add ‘-ObjC’ flag

718

🚧

Important Note

  • Each placement has a Placement ID. If you integrate multiple placements, you will need to use a different Placement ID for each.
  • The implementation should be tested on a device and not in a unity simulator.
  • Make sure to use Android Placement IDs in Android project and iOS Placement IDs in iOS project

What’s Next

Integrate one of the following plugin's ad units