로딩중입니다
Live Operation Integration : Targeting Push (Android)
5/27/2015 10:58:18 AM

Live Operation Service


Live Operation is a service to send push notifications to targeted app users through filtering.

App marketer can enhance the convenience of the advanced push system by integrating with Live Operation.

[Live Operation Service Guide]


Note that IGAW integration must be established before attempting to integrate with Live Operation Add-on.

If the integration hasn't been completed, refer to the directions below and complete the process first.

[IGAW integration (AOS) Guide]


NOTE
  1. IGAW Common Integration must be finished before integrate Live Operation add-on, [IGAW Common Integration: Android]
  2. IgawLiveOps~*.jar file must be included to integrate Live Operation. [SDK Installation: Android]
  3. Google Play Services must be integrated to integrate Live Operaion [Google Play Services Setting
  4. Latest version of android-support-v4.jar must be included in the project. (Higher than ver21) [Google Guide]
* Update Notice *
If you use LiveOps 1.2.9 version(Jul. 30th. 2015 updated), please check below migration guide.
[Live Operation Migration: Android]


AndroidManifest.xml

Edit the Android Manifest file for the Live Operation integration.

Other than the app key, hash key, and authorization established in the integration, you can add  Extra Authorization and Push-related Receiver & Service.


Add required permissions in-between <manifest></manifest> tag.

<uses-permission android:name="android.permission.WAKE_LOCK"/>
<uses-permission android:name="android.permission.VIBRATE"/>
<!-- LiveOps v1.3.6 부터는 필요하지 않습니다. -->
<uses-permission android:name="android.permission.GET_TASKS"/>

<!-- C2DM Permission -->
<permission android:name="MY_PACKAGE_NAME.permission.C2D_MESSAGE" android:protectionLevel = "signature" />
<uses-permission android:name="MY_PACKAGE_NAME.permission.C2D_MESSAGE"/>
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE"/>

+ Enter the package name of the integrated project in  MY_PACKAGE_NAME in the C2DM permission settings.


Add the required receiver and service for Live Operation in-between the <application></application> tags.

<!-- IGAWorks GCM Broadcast Receiver -->
<receiver android:name="com.igaworks.liveops.pushservice.LiveOpsGCMBroadcastReceiver"
    android:permission="com.google.android.c2dm.permission.SEND" >
    <intent-filter>
        <action android:name="com.google.android.c2dm.intent.RECEIVE" />
        <category android:name="MY_PACKAGE_NAME" />
    </intent-filter>
</receiver>

<!-- IGAWorks Push Service -->
<service android:enabled="true" android:name="com.igaworks.liveops.pushservice.GCMIntentService" />

<!-- Client Push App Receiver -->
<receiver android:name="com.igaworks.liveops.pushservice.LiveOpsReceiver"
    android:permission="MY_PACKAGE_NAME.permission.C2D_MESSAGE">
    <intent-filter>
        <action android:name="com.igaworks.liveops.pushservice.CLIENT_PUSH_RECEIVE"/>
    </intent-filter>
</receiver>

+ Enter the package name of the integrated project in MY_PACKAGE_NAME in the receiver settings.


+ Are you looking to participate as an adPOPcorn advertiser?

If you wish to execute CPI or more effective advertisements through the adPOPcorn ad network, you should register the Google installation receiver.

[IGAWorks Google Installation Receiver: Android



Basic Integration / Server Push


To use Live Operation, the basic integration should be proceeded through the API below from the app's main activity.

Once integration is completed, the server push becomes activated and the read status of your push notifications can be tracked.

 

  • IgawCommon.setUserId(String userId);
  • IgawLiveOps.initialize(Context context);
  • IgawLiveOps.resume(Context context);
public class MainActivity extends Activity {
	 
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
 
		IgawCommon.startApplication(this);
		//User Identification value must be set.
		IgawCommon.setUserId("user10001");		
		// Liveoperation SDK becomes initialized. 
		IgawLiveOps.initialize(MainActivity.this);		
	}
 
	@Override
	protected void onResume() {
		// TODO Auto-generated method stub
		super.onResume();
		IgawCommon.startSession(this);		
		IgawLiveOps.resume(MainActivity.this);
	}
 
	@Override
	protected void onPause() {
		// TODO Auto-generated method stub
		super.onPause();
		IgawCommon.endSession();
	}
}

+ The Live Operation service enables you to run Launcher in the Android Manifest when the push message is read.

+ User identification value must be registered by using the setUserId API so that it can be included in the push notifications being sent out.

+ If a Korean character, spacing, or special character should be used as user identification value, it must be encoded. (max length : 100 characters)

 

Enter User Identifier Value

User Identifier Value is the information verifies Live Operation user.


    NOTE

  1. A user should have only one User Identifier Value and it cannot be variable.
  2. Personal information should not included. (e.g., e-mail, name, telephone number, identifiable user ID, etc.)
  3. If a Korean character, spacing, or special character is used, it must be URL encoded.
  4. It must be set before IgawLiveOps.initialize API called up.

Enter User Identifier Value according to above.

IgawCommon.setUserId(getApplicationContext(),"user10001");

  


Deep Link Integration / Server Push

Live Operation Server Push provides the Deep Link feature.

Deep Link enables users to perform an action defined in the Deep Link data when receiving and reading a push message.


Create and Manage Deep Link data at Live Operation Management page, and data have 3 types.

TypeForm
URL (Http type)http://www.igaworks.com
URL (Custom Scheme type)myApp://activity.com
Json type{"key":"value", "igaworks":"sample"}

  • URL (http type) and  Json 

Deep Link features are implemented depending on the Deep Link type by overriding the onNewIntent function.
public class MainActivity extends Activity{ 
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
 
		IgawCommon.setUserId(MainActivity.this"userid_123123123");
		IgawLiveOps.initialize(MainActivity.this);
 
		//Deliver the intent to the onNewIntent listener.
onNewIntent(getIntent()); } @Override protected void onNewIntent(Intent intent) { super.onNewIntent(intent); /* Refer to the following depending on the type of Deep Link for implementation. */
/1. Execute the App Scheme action delivered to Deep Link(myApp://deepLinkAction)크
* * Execute the App Scheme action delivered to Deep Link.
* IgawLiveOps.onNewIntent(MainActivity.this, intent); */ /* 2. Implement Json text string type ({“url”:”deepLinkAction”}) Deep Link. * * Json text strings delivered to Deep Link are extracted and converted to the Json object.
* String jsonStr = intent.getStringExtra("com.igaworks.liveops.deepLink"); * JSONObject jsonObj; * try { * jsonObj = new JSONObject(jsonStr); * //It is implemented in a way to execute an action by parsing the Json object.
* } catch (Exception e) { * // TODO: handle exception * } */ } }

  • URL (Custom Scheme Type)

Add IgawLiveOpsPushMessageLauncherActivity in manifest file. When Push Message is clicked, add scheme and host in-between <intent-filter></intent-filter> of opened activity. If Custom Scheme is myApp://activity.com, enter activity,com in host and myApp in scheme.
<!-- Add IgawLiveOpsPushMessageLauncherActivity. -->
<activity 
	android:name="com.igaworks.liveops.pushservice.IgawLiveOpsPushMessageLauncherActivity" 
	android:permission="MY_PACKAGE_NAME.permission.C2D_MESSAGE"
	android:noHistory="true"/> 


<!-- Set Activity that applied in Deep Link. -->
<activity android:name="com.example.DeeplinkActivity">
	<intent-filter>
	<data android:scheme="myApp" android:host="activity.com" />
		  <action android:name="android.intent.action.VIEW" />
      		  <category android:name="android.intent.category.DEFAULT" />
      		  <category android:name="android.intent.category.BROWSABLE" />
	</intent-filter>            
</activity>
+ Enter package name of project in MY_PACKAGE_NAME.


Client Push

Live Operation provides a client push feature where you can create and use push messages by using the API directly from the client.

Normally, client push creates and displays push messages in case the user matches the pre-designated conditions of the app.

Moreover, it can be used as a way to create push messages through server events if communication between the developer's server and the app is available.

 

In the client push, Normal Push and Big Text Push are supported.

 

Normal Client Push

Normal client push is comprised of basic texts.

Push messages can be created and displayed through the setNormalClientPushEvent API.

IgawLiveOps.setNormalClientPushEvent(
	this,			// Application Context
	1,                 	// Delay seconds. Send a message after a predetermined number of seconds. 
	"Let’s play now!",      // Messages awaiting delivery. 
	1,			// Event ID, Value for cancellation. 
	false			// Set whether to leave it visible even when the app is running. 
);


Big Text Client Push

Big text client push supports text entry of up to 160 English characters.

Additionally, the HTML form available for Android apps is supported (bold, underline, font color).

Push messages can be created and displayed through the setBigTextClientPushEvent API.

IgawLiveOps.setBigTextClientPushEvent(
	this, 				// Application Context
	1, 				// Delay seconds, Send a message after a predetermined number of seconds. 
	"contentText", 			// contents
	"bigContentTitle", 		// Normal Push message
	"Let's play now! WoooooooW!!",	// Big texts to be displayed in push message. 
	"summaryText", 			// Summary texts to be displayed in push message. 
	1, 				// Event ID, Value for cancellation. 
	false				// Set whether to leave it visible even when the app is running. 
);

 + Push Display Method

How pushes are displayed may vary according to its type, your Android OS version, and the status of the push message bar.

Check out the link below for more details.

[Live Operation Push Display Guide]

 


Live Operation: Extra Options


User Targeting

You can create a user group manually to move it to push targets.

Added user groups can be verified in the Live Operation Admin page. They are not available in the client push.


Set Targeting Data

You can set customized user data to send target push.
Created custom user data is listed at Target Push management page. This example shows grabbing user's age as the custom data.
//IgawLiveOps.setTargetingData(Context applicationContext, final String userCustomDataKey, final Object userCustomData);
IgawLiveOps.setTargetingData(context, "purchaseCount", purchaseCount);

+ customUserData : set the data of user's action, The api supports multiple types for user data.(bool, int, long, float, String)

+ customUserDataKey : set the key for user custom data. 


Enable/Disable Push

Choose whether to receive push notifications.

It is available by calling the enableService API. See below for a parameter example.

  • true : Enable push notifications.
  • false : Disable push notifications.
// Disable push norifications. 
IgawLiveOps.enableService(MainActivity.this, false);


Sync Targeting Data

Use resume api to sync the targeting data to the Live Operation server.
Add as below in activity > onResume()
@Override
protected void onPause() {
    super.onPause();
    IgawLiveOps.resume();
}

Manual Sync 

Sync data manually, call flush api to sync the targeting data to the Live Operation server.
IgawLiveOps.flush(MainActivity.this);


Enable/Disable Push

Set whether to receive push message or not. Generally, it calls API as it's configured.
Furthermore, we offer delegate for this event. Use the delegate to process the result of the action.


Set Push

enableService  API is called and these are the examples for the parameter:
  • true : Receive Push.
  • false : Does not receive Push.음.
IgawLiveOps.enableService(MainActivity.this, true);


Use Delegate (depreciated v1.3.2)

전송되는 푸시에 대해서 수신 여부 이벤트 대한 델리게이트를 제공합니다.
enableService API를 호출하여 사용하며, 파라미터와 사용 예시는 다음과 같습니다.

IgawLiveOps.enableService(MainActivity.this, true, new LiveOpsGCMPushEnableEventListener() {
            @Override
            public void onEnableService(boolean isSuccess) {
                Log.d("DEBUG" ,"Enable PushService :: " + isSuccess);
            }
  });



Change Push Icon Image

Target Push uses Launcher Icon image as Push Icon Image.

If you want to change it to be featured by Google, call setNotificationIconStyle api and change the icon.

//IgawLiveOps.setNotificationIconStyle(Context context, String small_icon_name, String large_icon_name, int argb);
IgawLiveOps.setNotificationIconStyle(getApplicationContext(), "ic_small_filename", "ic_large_filename", 0xFFE90F0F);

// IgawLiveOps_v1.2.9 이전 버전 API
  IgawLiveOps.setNotificationIconName(MainActivity.this, "my_push_icon_custom_igm_name");

+ Call afterh IgawLiveOps.initialize api.
+ File name should not contain filename extention.
+ Add all the image fit to all the resolution in Drawable folder.


Notification Setting

Set head-up notification and lockscreen notification for higher than android 5.0 version.

Head-up Notification : Show notification when the device is activated. Lockscreen Notification: Show notification when the device is inactiviated.

(Please read more about at Google. [Go to Google Guide])

setNotificationOption api를 호출하여 헤드업/잠금 화면 알람을 설정합니다.

Head-up (priority)

  • PRIORITY_MAX (int:2), Turn on head-up
  • PRIORITY_HIGH (int:1), Turn on head-up
  • PRIORITY_DEFAULT (int:0), Turn off head-up
  • PRIORITY_LOW (int:-1), Turn off head-up
  • PRIORITY_MIN (int:-2), Turn off head-up

Lockscreen (visibility)

  • VISIBILITY_SECRET (int:-1), Turn on Lockscreen notification
  • VISIBILITY_PRIVATE (int:0), Turn on Lockscreen notification without content
  •  VISIBILITY_PUBLIC (int:1), Turn on Lockscreen notification with content
// public static void setNotificationOption(Context context, int priority, int visibility)
IgawLiveOps.setNotificationOption(getApplicationContext(), NotificationCompat.PRIORITY_HIGH, NotificationCompat.VISIBILITY_SECRET);
+ Lockscreen Notification will work when user's device setting turn on "Hide content".
+ If user uses Lockscreen, Lockscreen Notification may not work..


Stacking Notifications (InboxStyle)

You can group all the notifications together in a stack. Inbox Style works only in the server push.
(*Inbox Style is not supported in the client push, in which the push ID is not identified.)

Call setStackingNotificationOption api to set stacking notifications.

Stacking Notifications Settings (useStacking)

  • true : Stacking notifications ON.
  • false : Stacking notifications OFF.

Stacking Title Settings (useTitleForStacking)

  • true : When expanding the notifications, show the title.
  • false : When expanding the notifications, show the text.

Title and Text Settings (ContentTitle, ContentText)

  • empty :  Show the most recent title and text.
  • your_custom_message : Show the title and text called by the api.

Expanded Notifications Title Settings (bigContentTitle)

  • empty : Show ContentTitle.
  • your_custom_message : Show the title called by the api.

Expanded Notifications Text Settings (bigContentSummaryText)

  • empty : Do not use the content summary.
  • your_custom_message : Show the content called by the api.

// public static void setStackingNotificationOption(Context context, boolean useStacking, boolean useTitleForStacking,  String ContentTitle, String ContentText, String bigContentTitle, String bigContentSummaryText)
IgawLiveOps.setStackingNotificationOption(getApplicationContext(), true, false, "More events are waiting for you", "See detail", "All events", "For Summary Text");