繁体   English   中英

APNs Keep http2 keep connection alive

[英]APNs Keep http2 keep connection alive

鉴于我不是 web 开发人员,我正在努力实现 APNS 推送通知发件人脚本。 我目前正在查看这个 php 库pushok 我的实现是这样的:

...
$payload = createPayload( $json['category'], $params, $threadId);
$client = new Client( $authprovider, production = true );
$notification = new Notification($payload, $token, 'alert'));
$client->addNotifications([$notification]);
$responses = $client->push();
...

我注意到这个库在后台使用 cURL 来联系 APNS 服务器,一切似乎都运行良好。 作为每次调用脚本中的这段代码,我想知道 curl 是否按照 Apple 的要求保持 HTTP2 连接处于活动状态,或者是否每次都创建一个新连接。 库设置为不关闭连接,但我徘徊,这在每次脚本的上下文中是否有效? 有没有办法让 php 客户端 object 在两次执行之间保持活动状态?

我认为现在使用端口 443

https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_server/sending_notification_requests_to_apns?language=objc

https://support.apple.com/en-us/HT203609

https://developer.apple.com/documentation/usernotifications/sending_push_notifications_using_command-line_tools?language=objc

我一直在通过开发者门户与 Apple 交谈,到目前为止我所知道的就是这些。 我现在决定只是挑选,看看其他使用 APNS 的开发人员做了什么来保持交付成功。 我也问过这个问题,现在我正在浏览 Apple-Push-Notifications 标签,我看到其他人也是。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM