로딩중입니다
Live Operation Integration : Notification Popup (Unity iOS)
6/25/2016 8:39:55 AM

Live Operation Notification Popup Service

Live Operation Notification Service is a service to show messages to users by popup notifications whenever needed.

News about ongoing events or new features can be informed to users by this service.


Notice
  1. IGAW General Integration must be set in order to integrate Live Operation add-on. [IGAW General Integration : Unity iOS]
  2. In order to integrate Live Operation, IgaworksUnityPlugin_iOS~*.unitypackage file must be included in Unity project. [SDK Installation : Unity]

 


Notification Popup Initialization API

To use the Notification Popup service, follow the following steps to initialize.

It is recommended to call the initialization API at the point when the application starts.


Input User ID

User ID is to verify each user on Live Operation.

User ID must be set before loading the notification popup data.


Notice

  1. One user should only have one unique value, not variable.
  2. Must not contain any personal information(email, name, phone number, username).
  3. Must go through URL encoding if contains Korean, special character, or blank space.
  4. Must be set before LiveOpsPopupGetPopups API is called up.

Follow the above notice when input the User ID value.

IgaworksCorePluginIOS.SetUserId("player1001");


Loading the Notification Popup

Call LiveOpsPopupGetPopups api to load the notification popup data set in the Live Operation admin page.

User ID must be set before loading the data.

 

Notice

  1. Data loading cannot be done without the user ID.
  2. Without this data loading process, SDK cannot recognize any new notification added on the Live Operation notification popup admin page.

Follow the above notice when input the notification popup data.

LiveOpsPluginIOS.LiveOpsPopupGetPopups();



Notification Popup API


Notification Popup Display

Show notifications in the popup form at a desired point by calling up the LiveOpsPopupShowPopups api.

The content of the notification must be set in the notification popup admin page.

The following example shows notification popup displayed when the receiving is completed by the delegate.

public class MySampleScene : MonoBehaviour {

	// Use this for initialization
	void Start () {
		LiveOpsPluginIOS.LiveOpsSetCallbackHandler("MySampleScene");

		// Register delegate
		LiveOpsPluginIOS.liveOpsPopupGetPopupsResponded += HandleLiveOpsPopupGetPopupsResponded;

        // Implement delegate
    	public void HandleLiveOpsPopupGetPopupsResponded()
    	{
		LiveOpsPluginIOS.LiveOpsPopupShowPopups("Notification popup space key");
    	}
}

+ Notification popup space key can be created only from the notification popup admin page.


Force Quitting Notification Popups

By using the following api, you can force to quit the notification popups directly.

// Destroy the currently displayed popup only
LiveOpsPluginIOS.LiveOpsPopupDestroyPopup();

// Destroy all the popups, including the currently displayed popup and the ones after
LiveOpsPluginIOS.LiveOpsPopupDestroyAllPopups();



Live Operation : Additional Options 


Notification Popup User Targeting

You can create a user group manually to move it to push targets.
Data to set the user groups can be set manually.

Set Targeting Data

You can set customized user data to send target push.
Created custom user data is listed at Target Push admin page. This example shows grabbing user's age as the custom data.
//LiveOpsSetTargetingNumberData(int customUserData, string customUserDataKey);
//LiveOpsSetTargetingStringData(string customUserData, string customUserDataKey);

LiveOpsPluginIOS.LiveOpsSetTargetingNumberData(86, "age");
customUserData : Input user data for targeting.
customUserDataKey : Set user custom data key.

Sync Targeting Data

Call flush api to sync the targeting data to the Live Operation server. It will be applied on the server automatically when the app goes to the background or on the next execution. Call the following api when needed.

LiveOpsPluginIOS.LiveOpsFlush();


Notification Popup Deep Link

Use the Deep Link feature of a notification popup to handle various types of actions.

  • Deep Link can be registered in the Live Operation admin page.
  • Deep Link supports Json type data.
public class NewBehaviorScript : MonoBehavior {

	// Use this for initialization
	void Start () {
		LiveOpsPluginIOS.LiveOpsSetCallbackHandler("MySampleScene");

		// Register delegate
		LiveOpsPluginIOS.LiveOpsPopupSetPopupLinkListenerCalled += HandleLiveOpsPopupSetPopupLinkListenerCalled;
	}
	
        // Implement delegate
    	public void HandleLiveOpsPopupSetPopupLinkListenerCalled(string popupLinkListenerResult)
    	{

	string[] results = popupLinkListenerResult.Split(',');
	//results[0] : Popup space key
	//results[1] : Deep link data
	Debug.Log ("IgaworksADSample HandleLiveOpsPopupSetPopupLinkListenerCalled " + results[0] + results[1]);
	}	    
}


Notification Popup Delegate

We offer delegates for the events which occurs in the notification popups. Followings are the examples.


Popup Link Shortcut Delegate

When opening up the popup link, you can implement the needed feature by using the data transferred through the delegate.

public class MySampleScene : MonoBehaviour {

	// Use this for initialization
	void Start () {
		LiveOpsPluginIOS.LiveOpsSetCallbackHandler("MySampleScene");

		// Register delegate handler
		LiveOpsPluginIOS.LiveOpsSetPopupLinkListener();

		// Register delegate
		LiveOpsPluginIOS.liveOpsPopupSetPopupLinkListenerCalled += HandleLiveOpsPopupSetPopupLinkListenerCalled;
	
        // Implement delegate
    	public void HandleLiveOpsPopupSetPopupLinkListenerCalled(string popupLinkListenerResult)
    	{
	// After taking popup shortcut, the result being transferred through delegate
	
        string[] results = popupLinkListenerResult.Split(',');
	//results[0] : Popup space key of the popup clicked on the shortcut
	//results[1] : If json type of deep link was registered, the json string of that json object
        Debug.Log ("IgaworksADSample : HandleLiveOpsPopupSetPopupLinkListenerCalled " + results[0] + ", " + results[1]);
        
	// Call the following api here to force quit the popup after taking the popup shortcut
        LiveOpsPluginIOS.LiveOpsPopupDestroyPopup();     
    }
}


Popup Close Delegate

By using the data transferred through the delegate, you can close the popup.
public class MySampleScene : MonoBehaviour {

	// Use this for initialization
	void Start () {
		LiveOpsPluginIOS.LiveOpsSetCallbackHandler("MySampleScene");

		// Register delegate handler
		LiveOpsPluginIOS.LiveOpsSetPopupCloseListener();

		// Register delegate
		LiveOpsPluginIOS.liveOpsPopupSetPopupCloseListenerCalled += HandleLiveOpsPopupSetPopupCloseListenerCalled;
	
        // Implement delegate
    	public void HandleLiveOpsPopupSetPopupCloseListenerCalled(string popupCloseListenerResult)
    	{
	// Popup close result transferred through delegate
	string[] results = popupCloseListenerResult.Split(',');
        //results[0] : Popup space key of the popup that clicked close
	//results[1] : Popup campaign name of the popup that clicked close
	//results[2] : If json type of deep link was registered, the json string of that json object
	//results[3] : The number of popups that will be opened after this popup (string type)
        Debug.Log ("IgaworksADSample : HandleLiveOpsPopupSetPopupCloseListenerCalled " + results[0] + ", " + results[1] + ", " + results[2] + ", " + results[3]);    
    }
}