ios推送通知不会一直显示

时间:2022-09-10 20:20:41

I am an iphone developer.I am trying for push notification . I created certificates,provisional profiles and php script.And i try to run in terminal,then it work nice.But when i upload it in my server,notification come sometimes mostly it show following error

我是iphone开发者。我正在尝试推送通知。我创建了证书,临时配置文件和PHP脚本。我尝试在终端中运行,然后它工作得很好。但是当我在我的服务器上传它时,通知有时主要显示以下错误

Warning: stream_socket_client() [function.stream-socket-client]: unable to connect to ssl://gateway.sandbox.push.apple.com:2195 (Connection refused) Failed to connect: 111 Connection refused I placed the ck.pem file in the same directory of php file. Does it require to add the path?

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

2 个解决方案

#1


0  

it seems you lose the connection during the push notification, and yes you should add the path make sure you double check that the port your using is correct and open.

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

#2


0  

Also note that Push notification is also not always guaranteed. You can refer 'More about Push notification' section in https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/WhatAreRemoteNotif.html

另请注意,推送通知也不能保证。您可以参考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.

If a device is offline (either turned off or just unreachable) then it will receive at most a single push notification you attempt to send to your application during that time.

如果设备处于脱机状态(关闭或刚刚无法访问),那么它最多只会收到您尝试在此期间发送到应用程序的单个推送通知。

#1


0  

it seems you lose the connection during the push notification, and yes you should add the path make sure you double check that the port your using is correct and open.

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

#2


0  

Also note that Push notification is also not always guaranteed. You can refer 'More about Push notification' section in https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/WhatAreRemoteNotif.html

另请注意,推送通知也不能保证。您可以参考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.

If a device is offline (either turned off or just unreachable) then it will receive at most a single push notification you attempt to send to your application during that time.

如果设备处于脱机状态(关闭或刚刚无法访问),那么它最多只会收到您尝试在此期间发送到应用程序的单个推送通知。