iPhone 推送通知在沙箱中有效,但在生产模式下无效 [英] iPhone push-notification works in sandbox but not in production mode

查看:30
本文介绍了iPhone 推送通知在沙箱中有效,但在生产模式下无效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

正如标题所说,我有一个内置 APNS 的应用程序.它在沙盒模式下工作得很好.但是在生产模式下,它惨遭失败.

As the title says, I have an app with built in APNS. It does work perfectly in Sandbox-mode. But in production-mode, it fails miserably.

似乎我在服务器上拥有正确的证书,因为我没有从 APNS 服务收到错误消息.一切似乎都运行良好.我正在使用 Aldo Armiento 的 ApnsPHP.它有一个内置函数可以从 APNS-Server 中吐出结果.当我尝试将 Sandbox 与商店中的应用程序一起使用时,正如预期的那样,我收到了无效令牌错误(因为来自 Sandbox 的令牌和生产中的令牌不同).当我将生产证书与商店中的应用程序一起使用时,我没有收到错误消息.没什么,nada,zilch - 它似乎传递了通知.唉,它没有到达我的手机.

It seems that I have the right certificates on the server, because I don't get an error back from the APNS-Service. Everything seems to work fine. I am using ApnsPHP by Aldo Armiento. It has a built-in function to spit out the results from the APNS-Server. When I try to use the Sandbox with the app from the store, I get - as expected - an invalid-token-error (since tokens from sandbox and production are different). When I use the production-certificate with the app from the store, I don't get an error. Nothing, nada, zilch - it seems like it delivered the notification. Alas, it doesn't arrive on my phone.

显然,证书肯定没问题.它连接到服务器,它发送通知,所有通过都没有错误(我确实有错误的证书,所以我知道如果它们不正确会发生什么:)

So apparently, the certificates must be ok. It connects to the server, it sends the notification, all passes without errors (I did have wrong certificates first, so I know what happens if they're not right :)

有什么办法可以找出错误的藏身之处吗?

Any ideas how to find out where the bug hides?

这是我从 APNS 服务中得到的:

here's what I get back from the APNS-Service:

Tue, 03 Jan 2012 03:13:55 +0100 ApnsPHP[13049]: INFO: Trying ssl://gateway.push.apple.com:2195...
Tue, 03 Jan 2012 03:13:56 +0100 ApnsPHP[13049]: INFO: Connected to ssl://gateway.push.apple.com:2195.
Tue, 03 Jan 2012 03:13:56 +0100 ApnsPHP[13049]: INFO: Sending messages queue, run #1: 1 message(s) left in queue.
Tue, 03 Jan 2012 03:13:56 +0100 ApnsPHP[13049]: STATUS: Sending message ID 1 [custom identifier: Message-Badge-000] (1/3): 107 bytes.
Tue, 03 Jan 2012 03:13:56 +0100 ApnsPHP[13049]: INFO: Disconnected.

推荐答案

以下三种情况您可以在最后查看:-

Here is three cases you can check at your end:-

  1. 确保您在服务器端使用了正确的生产证书.因为我们需要为生产和沙箱创建两个不同的证书.确保您在服务器上使用正确的证书.

  1. Make sure that you have used the right production certificate on your server side. since we need to create two different certificates for production and sandbox. make sure you are using correct certificate on server.

第二,您可以检查您是否在服务器端使用了正确的网关和端口号.由于生产网关和沙盒网关是不同的.用于生产的网关是:- gateway.push.apple.com.并且您在服务器上为您在服务器上使用的证书使用了正确的密码.

second you can check that you have use the right gateway and port number on server side. Since gateway for production and sandbox are different one. Gateway used for production is:- gateway.push.apple.com. and also you are using correct password on server for your certificate your have used on your server.

第三,您可以检查设备上的通知是否已启用.您还需要在 iPhone 上启用它.确保它在您的设备上.

third you can check if the notification on your device is enabled or not. You need to enable it on your iPhone as well. Make sure that is on your device.

告诉我它是否适合您.

这篇关于iPhone 推送通知在沙箱中有效,但在生产模式下无效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆