gpt4 book ai didi

android - GCM 推送到 iOS 设备时速度很慢

转载 作者:行者123 更新时间:2023-11-29 01:51:48 24 4
gpt4 key购买 nike

我在使用适用于 iOS 的 GCM 时遇到问题。每当我向 Android 设备发送推送通知时,我都会在 0.5 秒内收到通知,没有任何问题。每当我将注册 token 更改为 iOS 设备的注册 token (而不是 APN 注册 ID)时,Web 请求至少需要 4 秒才能收到响应;并且最多需要 30 秒才能在 iOS 设备上接收推送。关于为什么会发生这种情况或者这是我应该从 GCM 期望的行为类型的任何想法?

示例负载:

{
"notification": {
"body": "HEY"
},
"registration_ids": [<registration token of ios device>],
"time_to_live": 400
}

Authorization 和 Content-Type header 也已设置。

我还需要提供其他什么来使调试这个问题更容易吗?

谢谢。

最佳答案

在您的负载中设置“priority”="high",您应该会看到您向 iOS 的交付速度更快。

{
"notification": {
"body": "HEY"
},
"priority":"high",
"registration_ids": [<registration token of ios device>],
"time_to_live": 400
}

关于android - GCM 推送到 iOS 设备时速度很慢,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31320347/

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