iPhone推送通知工作在沙箱中,但不是在生产模式 [英] iPhone push-notification works in sandbox but not in production mode

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

问题描述

正如标题所说,我有一个内置的APNS的应用程序。它在沙盒模式下正常工作。但是,在生产模式下,它悲惨的失败了。

看来我在服务器上的权证,因为我没有得到一个错误,从APNS-服务回来。一切似乎很好地工作。我使用ApnsPHP由阿尔Armiento。它有一个内置功能吐出从APNS - 服务器的结果。当我尝试从商店的应用程序使用沙盒,我得到 - 预期 - 一个无效的令牌错误(因为从沙盒和生产令牌是不同的)。当我使用生产证书与应用程序从商店,我没有得到一个错误。没什么,虚无缥缈,接近零 - 这似乎是它提供的通知。唉,没有到达我的手机上。

因此​​很明显,该证书必须确定。它连接到服务器,它会发送通知,所有通过没有错误(我没有先错的证书,所以我知道如果他们不正确会发生什么:)

任何想法如何找出错误隐藏?

这里是我从APNS-服务得到的:

 周二,2012年1月3日3点13分55秒+0100 ApnsPHP [13049]:信息:试图SSL://gateway.push.apple.com:2195 ...
星期二,2012年1月3日3时13分56秒+0100 ApnsPHP [13049]:INFO:连接到SSL://gateway.push.apple.com:2195。
星期二,2012年1月3日3时13分56秒+0100 ApnsPHP [13049]:信息:发送消息队列,运行#1:1消息(S)留在队列中。
星期二,2012年1月3日3时13分56秒+0100 ApnsPHP [13049]:状态:发送消息ID 1 [自定义标识:消息徽章-000](1/3):107字节。
星期二,2012年1月3日3时13分56秒+0100 ApnsPHP [13049]:信息:断开连接。


解决方案

下面为三情况下,您可以在您的最终检查: -


  1. 请确保您已使用合适的生产证书服务器端。因为我们需要创造生产和沙箱两种不同的证书。确保您正在使用的服务器正确的证书。


  2. 第二,你可以检查你使用服务器端的正确网关和端口号。由于网关生产和沙箱是不同的。用于生产网关是: - gateway.push.apple.com。而且您所使用的服务器正确的密码,您的证书您已经使用您的服务器上。


  3. 第三,如果您的设备上的通知或不启用您可以检查。您需要启用它在你的iPhone也是如此。请确保您的设备上。


让我知道它是否适合你。

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.

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?

[Edit] 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. 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.

  2. 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.

  3. 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.

Let me know if it works for you.

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

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