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
- IGAW General Integration must be set in order to integrate Live Operation add-on. [IGAW General Integration : Unity iOS]
- 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
- One user should only have one unique value, not variable.
- Must not contain any personal information(email, name, phone number, username).
- Must go through URL encoding if contains Korean, special character, or blank space.
- 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
- Data loading cannot be done without the user ID.
- 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
Set Targeting Data
//LiveOpsSetTargetingNumberData(int customUserData, string customUserDataKey);
//LiveOpsSetTargetingStringData(string customUserData, string customUserDataKey);
LiveOpsPluginIOS.LiveOpsSetTargetingNumberData(86, "age");
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]);
}
}