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

查看:116
本文介绍了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天全站免登陆