2014-01-24 139 views
1

我是iphone开发者。我在尝试推送通知。我创建了证书,临时配置文件和php脚本。我尝试在终端中运行,然后它工作的很好。但是当我将它上载到我的服务器时,通知有时大部分显示以下错误ios推送通知总是不显示

警告:stream_socket_client function.stream-socket-client]:无法连接到ssl://gateway.sandbox.push.apple.com:2195(连接被拒绝) 无法连接:111连接被拒绝 我将ck.pem文件放入相同的php文件目录。是否需要添加路径?

+0

哪个证书(ck.pem)您使用的是生产或开发? – Ankush

+0

嗨,对于使用ck.pem进行开发的delay.iam抱歉。我如何检查连接是否丢失?但有一点是我得到的通知很少。可能吗? – user3226620

+0

您好,能否请您尽快回复 – user3226620

回答

0

看起来你在推送通知期间失去了连接,是的,你应该添加路径 确保你仔细检查你使用的端口是否正确并打开。

+0

嗨,谢谢您的回复。我如何检查连接是否丢失?Iam使用ssl://gateway.sandbox.push.apple.com:2195.是否有任何错误?我们如何检查港口是否开放。但我的事情是我很少得到通知,这是否可能。 – user3226620

+0

嗨,你能不能请回复 – user3226620

+0

在推送通知过程中我怎么会失去连接?你能不能请回复 – user3226620

0

另请注意,推送通知并非总是有保证。您可以参考“更多关于推送通知”一节中https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/WhatAreRemoteNotif.html

Quality of Service 

Apple Push Notification Service includes a default Quality of Service (QoS) component that 
performs a store-and-forward function. If APNs attempts to deliver a notification but the device 
is offline, the QoS stores the notification. It retains only one notification per application 
on a device: the last notification received from a provider for that application. 
When the offline device later reconnects, the QoS forwards the stored notification to the device. 
The QoS retains a notification for a limited period before deleting it. 

如果设备处于脱机状态(关闭或只是可达),那么它就能接收最多尝试过程中发送给您的应用程序的单一推送通知那时。

+0

谢谢你的回复。我同意你的answer.php脚本显示大多数时间错误,并很少发送通知。我得到通知,每当php显示消息成功交付。 – user3226620

+0

嗨,你能不能请回复 – user3226620

+0

我不确定你现在需要什么。看看这个http://stackoverflow.com/questions/13897575/apns-apple-push-notification-service-reliability – Dinesh