想构建一个这样格式的字符串,用极光的sdk方法
{
"platform": "all",
"audience" : "all",
"notification" : {
"alert" : "Hi, JPush!",
"android" : {
"extras" : { "newsid" : 321}
},
"ios" : {
"extras" : { "newsid" : 321}
}
}
}
例如 这个方法后面的ios会覆盖android,怎么设置能让ios和android共存?
public static PushPayload buildPushObject_all_alert(Push push) {
Map map=new HashMap();
map.put("action", push.getAction());
return PushPayload.newBuilder().setPlatform(Platform.all()).setAudience(Audience.all()).setNotification(Notification.alert(push.getMsg()).android(push.getMsg(), null, map).ios(push.getMsg(), map)).setOptions(Options.newBuilder().setApnsProduction(false).build()).build();
}