android 和 ios 推送的参数不一样,推送的时候如何给ios设置title
这是给安卓推送的代码
public static void pushByAlias(String title,String message,List<String> alias){
PushPayload payload =PushPayload.newBuilder()
.setPlatform(Platform.android())
.setAudience(Audience.alias(alias))
.setMessage(Message.newBuilder()
.setMsgContent(message)
.addExtra("from", "JPush").build())
.setNotification(Notification.newBuilder()
.addPlatformNotification(AndroidNotification.newBuilder()
.setTitle(title)
.setAlert(message)
.build())
.build())
.build();
sendPush(payload);
}
这是给ios推送的代码
public static void pushByAlias2(String title,String message,List<String> alias){
PushPayload payload =PushPayload.newBuilder()
.setPlatform(Platform.ios())
.setAudience(Audience.alias(alias))
.setMessage(Message.newBuilder()
.setMsgContent(message)
.addExtra("from", "JPush").build())
.setNotification(Notification.newBuilder()
.addPlatformNotification(IosNotification.newBuilder()
.setAlert(message).
setBadge(1).
build())
.build())
.build();
sendPush(payload);
}
这是一起推送的代码。ios收不到,怎么回事
public static void pushByAlias(String title,String message,List<String> alias){
PushPayload payload =PushPayload.newBuilder()
.setPlatform(Platform.android_ios())
.setAudience(Audience.alias(alias))
.setMessage(Message.newBuilder()
.setMsgContent(message)
.addExtra("from", "JPush").build())
.setNotification(Notification.newBuilder()
.addPlatformNotification(AndroidNotification.newBuilder().setTitle(title).setAlert(message).build()).build())
.build();
sendPush(payload);
}