【问题标题】:Push notification issue for production server生产服务器的推送通知问题
【发布时间】:2013-11-24 06:38:04
【问题描述】:

我创建了启用推送通知的开发和生产证书。在测试环境中一切正常,但是当我尝试在我们的生产环境中测试开发证书时,它给了我来自我的 Java 服务器的以下错误消息。

06:56:47,054 WARN  ~ APNS push FAILED to 7ccd6139db05e657cedf27e00b93c71851cc779489474e4cede40d66182e4b26
06:56:47,054 WARN  ~ Here's the problem: javapns.notification.exceptions.ErrorResponsePacketReceivedException: An error response packe
t was received from the APNS server: APNS: [1] Invalid token
06:56:47,055 ERROR ~ javapns.notification.exceptions.ErrorResponsePacketReceivedException: An error response packet was received from 
the APNS server: APNS: [1] Invalid token
        at javapns.notification.PushedNotification.setResponse(PushedNotification.java:173)
        at javapns.notification.ResponsePacket.linkToPushedNotification(ResponsePacket.java:31)
        at javapns.notification.ResponsePacketReader.handleResponses(ResponsePacketReader.java:75)
        at javapns.notification.ResponsePacketReader.processResponses(ResponsePacketReader.java:27)
        at javapns.notification.PushNotificationManager.processedFailedNotifications(PushNotificationManager.java:223)
        at javapns.notification.PushNotificationManager.stopConnection(PushNotificationManager.java:198)
        at javapns.Push.sendPayload(Push.java:185)
        at javapns.Push.payload(Push.java:149)
        at jobs.APNSPushEvent.doJob(APNSPushEvent.java:46)
        at play.jobs.Job.doJobWithResult(Job.java:50)
        at play.jobs.Job.call(Job.java:146)
        at play.jobs.Job$1.call(Job.java:66)
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
        at java.util.concurrent.FutureTask.run(FutureTask.java:166)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:178)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:292)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:722)

【问题讨论】:

    标签: java iphone ssl-certificate apple-push-notifications javapns


    【解决方案1】:

    当两个地方使用相同类型的证书时,通知成功传递给客户端。

    为了在开发环境中测试通知,您需要使用开发证书构建客户端,服务器也应该使用开发证书。否则会失败。

    【讨论】:

      【解决方案2】:

      APNS: [1] Invalid token 表示您使用的设备令牌无效。假设您的应用程序从 Apple 获得了此设备令牌(并且您没有使用随机令牌),您可能正在使用开发令牌向生产推送服务器发送推送通知,反之亦然。设备令牌仅在一种环境(沙盒或生产环境)中有效。

      【讨论】:

      • Thanx 但是我如何获得不同的设备令牌?
      • @kamleshshingarakhiya 您的设备从 APNS 获得的令牌取决于您签署应用程序的配置文件(它包含沙盒或生产的 aps 环境权利)。
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-06-11
      • 1970-01-01
      • 2017-03-18
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多