欢迎访问 生活随笔!

生活随笔

当前位置: 首页 > 编程语言 > php >内容正文

php

写一个php发通知公告,从我的服务器PHP发送推送通知

发布时间:2025/3/15 php 40 豆豆
生活随笔 收集整理的这篇文章主要介绍了 写一个php发通知公告,从我的服务器PHP发送推送通知 小编觉得挺不错的,现在分享给大家,帮大家做个参考.

我试图从我的localhost发送推送通知到我的iDevices都正常工作但是在

PHP错误日志中我收到了警告,为什么?

注意:我收到所有设备上的推送

警告:

PHP Warning: socket_close(): supplied resource is not a valid Socket resource in /Applications/MAMP/htdocs/Push/SendPush.php on line xxx

我的一些代码:

//....

$streamContext = stream_context_create();

stream_context_set_option($streamContext, 'ssl', 'local_cert', $apnsCert);

$apns = stream_socket_client('ssl://' . $apnsHost . ':' . $apnsPort, $error, $errorString, 2, STREAM_CLIENT_CONNECT, $streamContext);

//...

socket_close($apns);

fclose($apns);

总结

以上是生活随笔为你收集整理的写一个php发通知公告,从我的服务器PHP发送推送通知的全部内容,希望文章能够帮你解决所遇到的问题。

如果觉得生活随笔网站内容还不错,欢迎将生活随笔推荐给好友。