gpt4 book ai didi

ios - FCM 的无效注册响应

转载 作者:行者123 更新时间:2023-11-29 05:12:04 25 4
gpt4 key购买 nike

来自documentation

Check the format of the registration token you pass to the server. Make sure it matches the registration token the client app receives from registering with Firebase Notifications. Do not truncate or add additional characters.

因此,我检查了 iOS 应用程序收到的 FCM token 和数据库存储的 token 。他们是identical enter image description here

尽管如此,我还是一遍又一遍地收到相同的错误

"result":{
"multicast_id":8326997376324259978,
"success":0,
"failure":1,
"canonical_ids":0,
"results":[{
"error":"InvalidRegistration"
}
]}

有人能让我看到我错过的事情吗?

....请放心

最佳答案

准备fcm请求时

private function sendPushNotificationToIOS($tokens, $notification) {
$fields = array(
'registration_ids' => $tokens,
'priority' => 'high',
'content_available' => true,
'mutable_content' => true,
'notification' => $notification,
'data' => $notification,
);
}

我将 $tokens 作为 Laravel 集合发送,这就是为什么我没有从服务器收到任何错误。因此请确保使用数组。

关于ios - FCM 的无效注册响应,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59584304/

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