로딩중입니다
Live Operation Integration : Notification Popup (iOS)
6/21/2016 5:33:32 PM

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 : iOS]
  2. In order to integrate Live Operation, LiveOps~*.framework file must be included in Xcode project. [SDK Installation : iOS]



Live Operation Notification Popup Installation

There are two ways to install the LiveOps.framework.


  • CocoaPods

The content of the Podfile must be as follows:

platform :ios, '8.0'
pod 'LiveOps'


  • Direct Installation

After adding LiveOps.framework file, add the following Dependencies.

Adding Bundle

Add LiveOps.bundle included in LiveOps.framework.



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 a set of information to identify users who have completed the campaign and are eligible for a reward.

User ID must be set before the user inputs the coupon codes.


    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 the getPopups API is called up.

Follow the above notice when input the User ID value.

[IgaworksCore setUserId:@"user10001"];


Loading the Notification Popup Data

Call getPopups 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 loading the notification popup data.

[LiveOpsPopup getPopups:^{
    //This code block will be called when there is the notification popup data.
    NSLog(@"Popup Resource Loading Success");
}];



Notification Popup API


Notification Popup Display

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

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

The following example shows a notification popup is displayed when clicking the showPopupNotiBtn button.

#import "ViewController.h"
#import "AppDelegate.h"
#import <IgaworksCore/IgaworksCore.h>
#import <LiveOps/LiveOps.h>

@implementation ViewController

- (IBAction)showNotiPopUpBtnClicked:(UIButton *)sender {
    [LiveOpsPopup showPopups:@"Notification popup space key"];
}

@end

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



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.


Link Listener

By using the data transferred through the listener, you can open up the popup link.

[LiveOpsPopup setPopupLinkListener:^(NSString *popupSpaceKey, NSDictionary *customData) {
	//The deep link data registered to the popup will be transferred through customData.
	//If the popup is not in JSON deep link type, customData will be transferred as nil.
	
	NSLog(@"popupLink listener called\n\
		deep link json: %@", customData);
}];


Close Listener

By using the data transferred through the listener, you can close the popup.

[LiveOpsPopup setPopupCloseListener:^(NSString *popupSpaceKey, NSString *popupCampaignName, NSDictionary *customData, NSUInteger remainPopupNum) {
	//The deep link data registered to the popup will be transferred through customData.
	//If the popup is not in JSON deep link type, customData will be transferred as nil.

	NSLog(@"popupClose listener called\n\
		popupCampaignName: %@\n\
		deep link json: %@\n\
		remainPopupNum: %lu", popupCampaignName, customData, (unsigned long)remainPopupNum);
}];



Force Quitting Notification Popups

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

// Destroy the currently displayed popup only
[LiveOpsPopup destroyPopup];

// Destroy all the popups, including the currently displayed popup and the ones after
[LiveOpsPopup destroyAllPopups];



Targeting Notification Popup Users

Set user groups to verify specific targets of the target push directly.
You can set the data to create your own user group 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.
//[LiveOpsUser setTargetingData:(NSString*)customUserData withKey:(NSString*)customUserDataKey]
[LiveOpsPush setTargetingData:@16 withKey:@"age"];
customUserData : Input user data for targeting. 
customUserDataKey : Set user custom data key.

Import Targeting Data

Import created targeting data to perform its action.
NSNumber* ageNum = [LiveOpsPush getTargetingDataWithKey:@"age"];

Sync Targeting Data

Call flush api to sync the targeting data to Live Operation server.
[LiveOpsUser flush];