Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Download the Appoxee Android Unity Plugin Zip file for the Download Page.
  2. Extract the zip file to path : UnityProjectName/Assets
  3. Replace in AndroidManifest.xml the "YOUR_PACKAGE_NAME" placeholder to your reverse-domain package name as you set in the Unity IDE
  4. This is the directory structure and content after extracting : 
    1. UnityProjectName/Assets/Plugins/AppoxeeAndroidBridge.cs 
    2. UnityProjectName/Assets/Plugins/IAppoxeeCallable.cs 
    3. UnityProjectName/Assets/Plugins/Android/appoxee-sdk.jar 
    4. UnityProjectName/Assets/Plugins/Android/appoxee-unity-plugin.jar 
    5. UnityProjectName/Assets/Plugins/Android/AppoxeeSDK/AndroidManifest.xml 
    6. UnityProjectName/Assets/Plugins/Android/AppoxeeSDK/project.properties 
    7. UnityProjectName/Assets/Plugins/Android/AppoxeeSDK/libs 
    8. UnityProjectName/Assets/Plugins/Android/AppoxeeSDK/res 
    9. UnityProjectName/Assets/Plugins/Android/google-play-services_lib 
  5. Make sure that you replace in AndroidManifest.xml the "YOUR_PACKAGE_NAME" placeholder to your reverse-domain package name as you set in the Unity IDE
  6. Open your Unity project.
Phase 2
  1. In your main Script, declare a variable from the type AppoxeeAndroidBridge
  2. In your main script , in your onEnable() method , init the AppoxeeAndroidBridge using : AppoxeePlugin =

    Your MainCameraScript class must implement IAppoxeeCallable in order to receive the results of the API calls.

  3. Your MainCameraScript class should hold a member of the AppoxeeAndroidBridge in order to use the different API calls after initializing it, using the Factory method.
  4. In order to initialise the Appoxee Uity Bridge, call AppoxeeAndroidBridge.CreateAppoxeeAndroidBridge() , passing it your gameObject, Your SDK Key & Secret Key. Do so in your onEnable() method.
  5. In your onStart() method, call AppoxeeReportActivate() in order to signal  to the SDK that the App is now in foreground. This is crucial for analytics.
  6. In your onDestroy() method, call AppoxeeReportBackground() in order to signal to the SDK that the App is now in background, This is crucial for analytics.
  7. The following code snippet shows the MainCameraScript class as step 1 - 5 explain : 

    Code Block
    languagec#
    titleInit AppoxeeAndroidBridge
    linenumberstrue
    using UnityEngine;
    using System;
    ...
    public class MainCameraScript : MonoBehaviour,IAppoxeeCallable<String> {
    ...
    	private AppoxeeAndroidBridge AppoxeePlugin; //Keep as field/member in order to use the API. if Null, API calls will cause a crash in runtime.
    ...
    	void OnEnable() {
    
    		if (AppoxeePlugin == null) {
    			AppoxeePlugin = AppoxeeAndroidBridge.CreateAppoxeeAndroidBridge(this, "YOUR_SDK_KEY", "YOUR_SECRET_KEY");
    		}
    	}
    ...
    	void Start () {
    		// AppoxeePlugin.AppoxeeReportActivate () must be called to report that the app was activated, crucial for analytics
    		if (AppoxeePlugin != null) 
    			AppoxeePlugin.AppoxeeReportActivate ();
    	}
    ...
    	void OnDestroy() {
    		// AppoxeePlugin.AppoxeeReportBackground () must be called to report that the app was deactivated, crucial for analytics
    		if (AppoxeePlugin != null) 
    			AppoxeePlugin.AppoxeeReportBackground ();
    	}
    ...
    }
  8. API Samples can be seen in the following link

...