gpt4 book ai didi

android - Firebase click_action 不起作用

转载 作者:行者123 更新时间:2023-11-29 14:45:46 25 4
gpt4 key购买 nike

我遇到了 FCM 的问题,正如 Firebase 团队记录的那样:

click_action: Indicates the action associated with a user click on the notification. When this is set, an activity with a matching intent filter is launched when user clicks the notification.

我知道它已经被讨论过,但根据我的理解,根据我从文档中了解到的内容,这应该可以从 firebase 控制台实现。它没有说明它用于数据消息,它清楚地说明了它是用于通知消息的字段,据我了解,这些是 Firebase 控制台发送的。

谁能澄清一下。谢谢!!

最佳答案

click_action目前无法通过 Firebase 控制台使用。

您说控制台发送通知消息是正确的,但是它不允许您设置通知消息的 click_action 字段。要使用 click_action,您必须使用 REST API 发送通知消息,其中所有通知消息字段都可用。

请注意,通过控制台添加的自定义数据成为数据负载中的键/值对,将伴随通知消息。示例结构:

{
"to": <topic>,
"notification": {
<notification payload>
},
"data": {
<data payload, console custom data key/value pairs go here>
}
}

所以 click_action 是通知负载的一部分,但此时您必须使用 REST API 才能使用它。我知道这还不清楚,我会研究可能的文档更新以使其更清楚。

关于android - Firebase click_action 不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38921525/

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