【问题标题】:Silently handle firebase data notification by app only仅通过应用静默处理 Firebase 数据通知
【发布时间】:2019-09-24 08:59:16
【问题描述】:

在我颤动的 android 应用程序中,我希望 Firebase 数据通知只能由应用程序静默处理。 如果应用程序正在运行,它将处理数据,否则必须显示任何通知。 我怎样才能做到这一点

过多的通知可能会很烦人

这是我的代码


    final FirebaseMessaging fbMessaging = new FirebaseMessaging();

    @override
    Future<void> asyncInitStart( BuildContext context ) async
    {
        fbMessaging.subscribeToTopic('chat');
        fbMessaging.configure( onMessage: collectFirebaseMsg );
    }

【问题讨论】:

    标签: flutter firebase-cloud-messaging


    【解决方案1】:

    要发送始终触发您的代码且从不单独显示通知的消息,请发送不带 notification 属性的 data 消息。

    有关更多信息,请参阅documentation on message types

    【讨论】:

      猜你喜欢
      • 2016-09-30
      • 2019-06-10
      • 1970-01-01
      • 1970-01-01
      • 2021-06-25
      • 2021-05-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多