gpt4 book ai didi

ios - 推送通知已发送到苹果 apns 服务器,但设备未收到任何信息

转载 作者:可可西里 更新时间:2023-11-01 05:03:05 25 4
gpt4 key购买 nike

开发环境:

iOS 9.3.2 (iPhone6ne 6+) ... 但它适用于 iOS 8.x

Phonegap 6.2.7

Phonegap-plugin-push v1.7.2

PHP7(服务器端)- contentpush - ref

我的情况:

  1. token 自动传送到我的服务器

  2. 消息发送到ssl://gateway.push.apple.com 2195成功

  3. 设备甚至没有收到任何警报(“”)

    push.on('通知', 函数(数据) { 控制台日志(数据。消息); 警报(””); alert(data.title+"消息:"+data.message);});

最佳答案

Apple 不对成功发送消息提供任何保证。 you can see related answer here

如果您在连接到网络时没有看到 Apple 推送通知,请咨询您的网络管理员以确保可以访问相关的 TCP 端口。

要使用 Apple 推送通知服务 (APN),您的 Mac 和 iOS 客户端需要与 Apple 服务器建立直接且持续的连接。

iOS 设备首先尝试使用蜂窝数据连接到 APN。如果设备无法通过蜂窝网络连接到 Apple 的服务器,它会尝试使用 Wi-Fi 进行连接。

如果您在防火墙后使用 Wi-Fi 或使用私有(private)接入点名称 (APN) 获取蜂窝数据,则需要在这些端口上直接、无代理地连接到 APNs 服务器:

TCP port 5223: For communicating with Apple Push Notification services (APNs)
TCP port 2195: For sending notifications to APNs
TCP port 2196: For the APNs feedback service
TCP port 443: For a fallback on Wi-Fi only, when devices can't reach APNs on port 5223

APNs 服务器使用负载平衡,因此您的设备不会始终连接到相同的公共(public) IP 地址以接收通知。最好在分配给 Apple 的整个 17.0.0.0/8 地址 block 上允许访问这些端口。

APNs 代表 Apple 推送通知服务。 APN 代表接入点名称,是蜂窝数据网络和互联网之间的网关。

check this link for same explanation

同时检查 How do I troubleshoot issues with Push Notifications on iOS?

关于ios - 推送通知已发送到苹果 apns 服务器,但设备未收到任何信息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38090059/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com