로딩중입니다
IGAW common integration : Unity Android
6/5/2015 4:21:17 PM

IGAW Common Modules
All IGAWorks services are available as common modules + add-ons.
This is a Unity package available for the Unity Android Project. It is an integrated version containing both common modules and add-ons.
After the common integration process is completed, proceed to the additional integration process of the chosen service by referring to the corresponding guide. 
AndroidManifest.xml
Set app keyhash key, permission, etc., which were generated from the IGAWorks admin page by editing the Android Manifest file.
Add the App key and Hash key in-between the <application></application> tag. 
<meta-data android:name="igaworks_app_key" android:value="Set the app key." />
<meta-data android:name="igaworks_hash_key" android:value="Set the hash key" />


Add the required permission in-between the <manifest></manifest> tag. The service won't run properly unless the following permissions are added:

<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<!-- Optional values. -->
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
* Update Notice *
Higher than Common 4.2.0 version, pop-up windows of authorization setting for Android 6.0 version might be bad game UX, READ_EXTERNAL_STORAGE,WRITE_EXTERNAL_STORAGE permission will not be required.  e
TrackingLink & adPOPcorn advertising Guide
To use TrackingLink or adPOPcorn advertising service, you should add Google Install Receiver.
If receiver is not installed properly, you cannot check New User data. Please refer below guide to set the receiver.
[IGAWorks Google Install Receiver Guide]


Auto Session Tracking (Android 4.0.4 or higher)

Common 4.4.0a and higher version Android are supported Auto Session Tracking without Android activity setting. 

App should support at least Android 4.0.4 or higher version to use Auto Session Tracking.


In case, utilize Application Class provided in SDK

Declare below Androidmanifest.xml.

<application
    android:name="com.igaworks.IgawDefaultApplication"
</application>

After that, initialize the plug-in.
// using declared sentence.
using IgaworksUnityAOS;

public class MySampleScene : MonoBehavior { 
    void Awake() {
        //When Unity engine is initiazlized, initialize IGAW plug-in.
        IgaworksUnityPluginAOS.InitPlugin ();
    }
}

In case utilize Application Class manually.

If you already use Application class, please declare below Androidmanifest.xml. 

<application
    android:name="PACKAGE_NAME.YourCustomApplication"
</application>
After that, add below code in Application Class. 
public class YourCustomApplication extends Application{
    @Override
    public void onCreate(){
        super.onCreate();
        IgawCommon.autoSessionTracking(YourCustomApplication.this);
    }
}



IGAW Common Module Integration (Lower version than Android 4.0.4)

If app support lower versions than Android 4.0.4, initialize the plug-in and integrate Basic Analysis API as follows.

Plug-in Initialization
In case the unity becomes initialized after executing the application, init  and startApplication API are called up to initialize the plug-ins.
public class MySampleScene : MonoBehavior { 
    void Awake() {
//IGAW plug-in will be initialized when the Unity engine is loaded.
IgaworksUnityPluginAOS.InitPlugin ();         //Native SDK becomes initialized.
        IgaworksUnityPluginAOS.startApplication(); } }
init API that connects the Unity plug-in with the Android Native SDK.
startApplication API that initializes the Native SDK.

Basic Analysis API
startSessionendSession APIs are called up to complete transmission of customer retention rate and analysis data.
These functions should always be paired together for activation.
They should be called up when the application is switched to the foreground or background.

public class MySampleScene : MonoBehavior {
 
        // Start the app 
           void Start() {
// Because the initial execution of an app doesn't return OnApplicationPause, startSession should be called up manually. IgaworksUnityPluginAOS.Common.startSession(); } //Check the app status void OnApplicationPause(bool pauseStatus){ if (pauseStatus) { Debug.Log ("go to Background"); IgaworksUnityPluginAOS.Common.endSession(); } else { Debug.Log ("go to Foreground"); IgaworksUnityPluginAOS.Common.startSession(); } }
+ The OnApplicationPause function isn't called up for the initial operation in case of lower version of Unity 5.3. Therefore, startSession should be called up from Start().


IGAWorks Add-on Integration

If the common integration process is completed, refer to the appropriate service guide to proceed with the add-on integration.