Unity Plugin The AppLift Unity Plugin provides integration of the engagement interstitials. It is provided in the form of a unitypackage that you may simply include in your project. Our SDK is compatible with both iOS and Android platforms.
Contents 1.
Installation
2.
Configuration
3.
Deploying to Android
4.
Deploying to iOS
AppLift SDK 1.0 Unity Integration
Installation 1. Download the “AppLift_Unity_SDK.unitypackage” 2. Open your project in Unity, select the “Assets” menu, select “Import Package”
3. Make sure to select everything in the “Items to Import”
AppLift SDK 1.0 Unity Integration
Important for Android Games 1. Package Contents If you already have any imported android plugins in your Unity project, do not overwrite the content of your Assets/Plugins/Android/ folder with the stuff from the unitypackage we provide you. You should merge them instead. Carefully update your existing Manifest.xml, check if the next entries are presented:
2. Compatibility with Unity 4.0.x (< 4.1.x) If you are not using the Unity 3D SDK 4.1.x or higher, you will probably need to download and install Android SDK rev21 as the Android SDK rev22 conflicts with the older Unity versions. After installation do not forget to download the API platforms you need via Android SDK Manager.
At this point, the Unity interface to the AppLift SDK is imported in your game containing also the native AppLift SDK for Android. For iOS, the native AppLift SDK should be include in Xcode after you exported the project from Unity.
AppLift SDK 1.0 Unity Integration
Configuration 1. By default, the AppLift SDK is not active, to start it call: AppLiftSDKInterface.appliftStartForAppWithSecret("app_id", "app_secret");
Note: The
app_id
and app_secret are provided separately for iOS and Android. You can implement
multipurpose initialization block writing the code: #if UNITY_IPHONE AppLiftSDKInterface.appliftStartForAppWithSecret
"AndroidAppToken"); #endif For convenience call this line as early as possible in your game, to accomplish the initialization process before any Ad triggering. 2. To open an interstitial, your button should call: ApLiftSDKInteface.appliftRequestInterstitialViewOfType(AppLiftInterstitialType.AppL iftInterstitialTypeSmart );
The available
AppLiftInterstitialType
is:
AppLiftInterstitialTypeSmart
3. The AppLiftSDKInterface is implementing two callback methods: public void OnRequestSucceeded(string status); public void OnRequestFailed(string status);
and converting the callback string to the AppLiftStatus enum: AppLiftStatusAdDownloaded AppLiftStatusAdShown AppLiftStatusNoInterstitialAvailable AppLiftStatusNetworkError AppLiftStatusTimeoutError AppLiftStatusInvalidToken AppLiftStatusClosed AppLiftStatusNotInitialized AppLiftStatusInterstitialTypeNotActive AppLiftStatusResourceNotAvailable
You can use this statuses to put your game in pause, then restart it again.
AppLift SDK 1.0 Unity Integration
Deploying to Android In your Unity project go to File menu, select Build Settings, open Android section
Here you can specify your own android project’s settings and build or run your application with the AppLift SDK in it.
AppLift SDK 1.0 Unity Integration
Deploying to iOS In your Unity project go to File menu, select Build Settings, open iOS section
Once you have your Xcode project, follow the native iOS integration guideline.