JAVA 服务端发送消息给 IOS客户端为啥收不到呢 JPUSH是返回成功的哦

_vincent
2016-08-23 14:03 2.0k 0
PushPayload payload = PushPayload
    .newBuilder() 
    .setPlatform(Platform.ios())
    .setAudience(Audience.registrationId("101d8559094674115a4"))
    .setNotification(Notification.newBuilder().addPlatformNotification(
                IosNotification.newBuilder()
                .setAlert(message).setBadge(1)
                .setSound("happy.caf")
                .addExtra("from", "JPush")
                .addExtra("msg_id", "77777")
                .addExtra("type", "workplan")
                .addExtra("id", "123")
                .addExtra("time", "1111")
                .addExtra("title", "333333")
                .addExtra("content", "312132312132")
                .build()).build())
    .setOptions(Options.newBuilder().setApnsProduction(true).build())
        .build();
    try {
     PushResult result = jpushClient.sendPush(payload);
//    Debug.debug("registrationId" + registrationId + ",message:"
//            + message + "," + result.getResponseCode());
//    jpushClient.sendIosMessageWithRegistrationID("rrrrrrr", "{\"type\":\""
//            + "workplan" + "\",\"time\":\"" + "wer" + "\",\"title\":\""
//            + "aaaa" + "\",\"content\":\"" + "adasdasd" + "\",\"id\":\""
//            + "111111" + "\",\"msg_id\":\"" + "123123" + "\"}", "1a1018970aa0ee7aa12");

    System.out.print("aaaa");
    } catch (APIConnectionException e) {
        e.printStackTrace();
    } catch (APIRequestException e) {
        e.printStackTrace();
    }    


16/08/23 21:58:56 DEBUG connection.NativeHttpClient: Send request - POST https://api.jpush.cn/v3/push
16/08/23 21:58:56 DEBUG connection.NativeHttpClient: Request Content - {"platform":["ios"],"audience":{"registration_id":["101d8559094674115a4"]},"notification":{"ios":{"alert":"dddffffffffffffffffffffff7dddddd","extras":{"content":"312132312132","id":"123","title":"333333","time":"1111","msg_id":"77777","from":"JPush","type":"workplan"},"badge":"1","sound":"happy.caf"}},"options":{"sendno":458144594,"apns_production":true}}
16/08/23 21:58:57 DEBUG resp.ResponseWrapper: JPush API Rate Limiting params - quota:600, remaining:599, reset:60
16/08/23 21:58:57 DEBUG connection.NativeHttpClient: Succeed to get response OK - responseCode:200
16/08/23 21:58:57 DEBUG connection.NativeHttpClient: Response Content - {"sendno":"458144594","msg_id":"2429373409"}

1个回答

热门排序
  • _vincent
    2016-08-23 16:15

    JAVA 服务端推送 是不是IOS只有发布后才能接收到?开发版是接收不到的?