简体   繁体   English

前台应用程序抖动时未收到 Firebase 推送通知?

[英]Firebase Push Notification not received when flutter app in foreground?

I am using firebase_messaging for firebase push notifications.我正在使用firebase_messaging进行 firebase 推送通知。 I received push notifications when app in background or app is forcefully closed but not received when app in foreground.我在后台应用程序或应用程序被强制关闭时收到推送通知,但在前台应用程序时未收到。

And Second issue is push notification show without app icon.第二个问题是没有应用程序图标的推送通知显示。 Its shows blank square icon.它显示空白方形图标。

firebase doesn't show push notifications when the app in foreground, So we need to configure the local notification for Firebase当应用程序在前台时,firebase 不显示推送通知,因此我们需要为 Firebase 配置本地通知

Check this package检查这个包

Library for Local Notification本地通知库

You can use flutter_local_notification to push notifications and you have to use this following code,您可以使用flutter_local_notification来推送通知,您必须使用以下代码,

await FirebaseMessaging.instance.setForegroundNotificationPresentationOptions(
    alert: true,
    badge: true,
    sound: true
  );

in the main method.在主方法中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 应用程序处于前台时未收到推送通知 ios flutter - Push Notification not received when app is in foreground ios flutter 应用程序在前台时收到的推送通知与应用程序在后台时收到的推送通知不同 - Push notification received while the app is in the foreground is different from push notification received when the app is in background 如果应用程序处于前台,则不会收到sendbird推送通知 - sendbird push notification not received if app is in foreground 在Android中-当应用程序处于前台时如何防止Firebase推送通知? - In android - How to prevent Firebase push notification when app is in foreground? 应用程序在前台时推送通知(使用 Firebase 触发器) - Push notification when app is in foreground (using Firebase triggers) Firebase 在 android 中从后台删除应用程序时未收到推送通知 - Firebase push notification not received when app remove from background in android 我杀死应用程序后未收到Firebase推送通知? - Firebase Push notification is not Received when i kill the app? 如何使用IBM Mobilefirst接收到推送通知时知道应用程序是在后台还是在前台 - how to know if app is in background or foreground when push notification is received using IBM Mobilefirst 当应用程序处于前台时发送推送通知 - Push notification is sent when app is in foreground 未收到Firebase推送通知 - Firebase Push Notification not received
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM