Firebase FCM 通知 click_action 有效负载 [英] Firebase FCM notifications click_action payload

查看:40
本文介绍了Firebase FCM 通知 click_action 有效负载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当用户在应用程序处于后台时单击通知时,我试图打开特定活动.从文档中,我知道必须在有效负载中添加 click_action 并在应用程序中添加一个意图过滤器来处理它.但是,如何通过 Firebase 控制台在 Firebase 通知中添加 click_action?我也愿意接受任何其他工作.提前致谢.

I am trying to open a particular activity when the user clicks the notification when the app is in the background. From the Docs, I have got that click_action has to be added in the payload and an intent filter in the App to handle it. But, how to add click_action in the Firebase Notifications via Firebase Console? I am open to any other Work Around too. Thanks in Advance.

推荐答案

如果您的应用在后台,Firebase 将不会触发 onMessageReceived().为什么.....?我不知道.在这种情况下,我认为实施 FirebaseMessagingService 没有任何意义.

If your app is in background, Firebase will not trigger onMessageReceived(). Why.....? I have no idea. In this situation, I do not see any point in implementing FirebaseMessagingService.

根据文档,如果您想处理后台消息到达,则必须随消息一起发送click_action".但是,如果您仅通过 Firebase API 从 Firebase 控制台发送消息,则这是不可能的.这意味着您必须构建自己的控制台",以便营销人员能够使用它.所以,这使得 Firebase 控制台也毫无用处!

According to docs, if you want to process background message arrival, you have to send 'click_action' with your message. But it is not possible if you send message from Firebase console, only via Firebase API. It means you will have to build your own "console" in order to enable marketing people to use it. So, this makes Firebase console also quite useless!

这个新工具背后确实有很好的、有前途的想法,但执行起来很糟糕.

There is really good, promising, idea behind this new tool, but executed badly.

我想我们将不得不等待新版本和改进/修复!

I suppose we will have to wait for new versions and improvements/fixes!

这篇关于Firebase FCM 通知 click_action 有效负载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆