linkedkeeper.com的APNS推送服务(http2-java)提示BadDeviceToken

芦苇天 2018-03-01 10:53:30
C#(pushsharp推送已成功实现,但不是基于http2)。

张松然 linkedkeeper.com的APNS推送服务(http2-java)
文章地址:http://linkedkeeper.com/detail/blog.action?bid=163
代码:https://github.com/linkedkeeper/apns-http2
运行测试:提示BadDeviceToken



[main] ERROR com.linkedkeeper.apns.client.ApnsHttp2 - APNs http2 client connect is lost, stablish connection ...
[main] INFO com.linkedkeeper.apns.client.ApnsHttp2Client
- connect api.push.apple.com:443. this connectionReadyPromise null.
[nioEventLoopGroup-2-1] INFO com.linkedkeeper.apns.client.ApnsHttp2Client
- connectionReadyPromise operationComplete, this connectionReadyPromise DefaultChannelPromise@53a6df03(success), this reconnectionPromise null
[nioEventLoopGroup-2-1] INFO com.linkedkeeper.apns.client.ApnsHttp2Client -
Connected to api.push.apple.com/17.188.147.38:443.
[nioEventLoopGroup-2-1] INFO com.linkedkeeper.apns.client.ApnsHttp2Client
- Success to write push notification: ApnsHttp2PushNotification [token=8d5e09d576d64672c7e5a51dd3761c368a65289e58c1f3285d284668909c476f,
payload={"aps":{"badge":1,"alert":"test#1 apns-http2, i = 0 2018-03-01 22:06:19","sound":"default"}},
invalidationTime=null, priority=IMMEDIATE, topic=com.foxconn.PM2Dot5]
[nioEventLoopGroup-2-1] INFO com.linkedkeeper.apns.client.ApnsHttp2Client -
Received response from APNs gateway:
ApnsHttp2PushNotificationResponse
[ApsnPushNotification=ApnsHttp2PushNotification
[token=8d5e09d576d64672c7e5a51dd3761c368a65289e58c1f3285d284668909c476f,
payload={"aps":{"badge":1,"alert":"test#1 apns-http2, i = 0 2018-03-01 22:06:19","sound":"default"}},
invalidationTime=null, priority=IMMEDIATE, topic=com.foxconn.PM2Dot5], success=false,
rejectionReason=BadDeviceToken, tokenExpirationTimestamp=null]
[nioEventLoopGroup-2-1] INFO com.linkedkeeper.apns.client.ApnsHttp2ClientHandler
- Sending ping due to inactivity.
false
[nioEventLoopGroup-2-1] INFO com.linkedkeeper.apns.client.ApnsHttp2Client -
Success to write push notification: ApnsHttp2PushNotification [token=23b04ff56a6fea341500ca536acf534a6792fc29e92ad33f188a64a8a46f21eb, payload={"aps":{"badge":1,"alert":"test#1 apns-http2, i = 1 2018-03-01 22:08:05","sound":"default"}}, invalidationTime=null, priority=IMMEDIATE, topic=com.foxconn.PM2Dot5]
[nioEventLoopGroup-2-1] INFO com.linkedkeeper.apns.client.ApnsHttp2Client
- Received response from APNs gateway: ApnsHttp2PushNotificationResponse [ApsnPushNotification=ApnsHttp2PushNotification [token=23b04ff56a6fea341500ca536acf534a6792fc29e92ad33f188a64a8a46f21eb, payload={"aps":{"badge":1,"alert":"test#1 apns-http2, i = 1 2018-03-01 22:08:05","sound":"default"}},
invalidationTime=null, priority=IMMEDIATE, topic=com.foxconn.PM2Dot5], success=false,
rejectionReason=BadDeviceToken, tokenExpirationTimestamp=null]
false
[main] INFO com.linkedkeeper.apns.client.ApnsHttp2Client - Disconnecting.
[nioEventLoopGroup-2-1] INFO com.linkedkeeper.apns.client.ApnsHttp2Client
- connectFuture.channel close operationComplete, this connectionReadyPromise DefaultChannelPromise@53a6df03(success),
this reconnectionPromise null

哪位大神使用过,可以提供下帮助!谢谢谢!



...全文
963 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
芦苇天 2018-03-02
  • 打赏
  • 举报
回复
已解决,BadDeviceToken问题。原因:测试环境默认使用的是ProductionMode,改为开发模式即可。 <Note>Development和Production两个版本对应的apns device token是不同的,前者是develop的mobileprovision下获取的。后者是production的mobileprovision获取的。</Note>

50,710

社区成员

发帖
与我相关
我的任务
社区描述
Java相关技术讨论
javaspring bootspring cloud 技术论坛(原bbs)
社区管理员
  • Java相关社区
  • 小虚竹
  • 谙忆
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧