Kreait/Firebase 消息传递 - 解释返回值

时间:2021-02-16 11:37:10

标签: php firebase-cloud-messaging

Kreait/Firebase 提供了通过 Firebase 云消息传递向订阅设备发送消息的绝佳途径。总的来说,documentation 非常出色。但是,该文档没有解释调用 send 等方法返回的信息(如果有)。以下面的例子

$factory = (new Factory)->withServiceAccount('/path/to/firebase_config.json');
$messaging = $factory->createMessaging();

$condition = ...;//define a few conditions
$notif = ...;//define the notification 
$data = ...;//define some data to send

$message = CloudMessage::withTarget('condition',$condition)->withNotification($notif)- 
>withData($data);
$rslt = $messaging->send($message);

我发现在大多数情况下,此代码返回 {"codd":1}。然而,有时我有 "{"name":"projects/`project_id/messages/long_number"}{"code":1}"

我该如何解释和/或知道这是一个错误。我一直无法找到解释此问题的 Firebase 文档。

0 个答案:

没有答案
相关问题