hz-zhhq-app-service/greenH5modul/.svn/pristine/a7/a7beb253f4992f82c0596e6101a...

55 lines
1.8 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package com.jysoft.unipush.usermanage;
import com.gexin.rp.sdk.base.IQueryResult;
import java.util.ArrayList;
import java.util.List;
import static com.jysoft.unipush.constant.AppInfo.*;
/**
* IOS角标设置管理相关demo
*
* @author zhangwf
* @see
* @since 2019-07-12
*/
public class BadgeManageDemo {
public static void main(String[] args) {
setBadgeForCid();
setBadgeForDeviceToken();
}
/**
* cid角标设置
*/
public static void setBadgeForCid() {
List<String> cidList = new ArrayList<String>();
cidList.add(CID);
//用户应用icon上显示的数字
String badge = "+1"; //"+1"即在原有badge上加1具体详情使用请参考该接口描述
// String badge = "-1"; //"-1"即在原有badge上减1具体详情使用请参考该接口描述
// String badge = "1"; //直接设置badge数值会覆盖原有数值具体详情使用请参考该接口描述
IQueryResult res = push.setBadgeForCID(badge, APPID, cidList);
System.out.println(res);
}
/**
* deviceToken角标设置
*/
public static void setBadgeForDeviceToken() {
List<String> targetList = new ArrayList<String>();
targetList.add(DEVICETOKEN);
//用户应用icon上显示的数字
String badge = "+1"; //"+1"即在原有badge上加1具体详情使用请参考该接口描述
// String badge = "-1"; //"-1"即在原有badge上减1具体详情使用请参考该接口描述
// String badge = "1"; //直接设置badge数值会覆盖原有数值具体详情使用请参考该接口描述
IQueryResult res = push.setBadgeForDeviceToken(badge, APPID, targetList);
System.out.println(res);
}
}