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

ios
标签: #<Tag:0x00007fb83ce646e0>

(小生 Vincent ) #1
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"}

(小生 Vincent ) #2

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


#3

iOS需要注意环境问题哦~
推送的环境与app的环境需要一致才能收到的。

具体内容参考:
iOS注意事项7、8、9点
iOS常见问题