简体   繁体   English

当应用程序在后台并在前台接收时,为什么在 IOS 上收不到 FCM 通知? Flutter

[英]Why does not receive FCM notifications on IOS when the app is in background and receive in foreground? Flutter

I have a Flutter app that sends Firebase notifications to all the users at some moment.我有一个 Flutter 应用程序,它会在某个时刻向所有用户发送 Firebase 通知。 It is working fine at android but in iOS only works with the app open.它在 android 上运行良好,但在 iOS 中只能在应用程序打开的情况下运行。 If I close the app (or go to main screen for example), it did not receive anything.如果我关闭应用程序(例如 go 到主屏幕),它没有收到任何东西。

I already setted 'priority': 'high', "content_available": true and still not working.我已经设置了 'priority': 'high', "content_available": true 并且仍然无法正常工作。 What can I do to perform it?我能做些什么来执行它?

If you need some code/info I update the question.如果您需要一些代码/信息,我会更新问题。

UPDATE: Yes, i'm using onResume更新:是的,我正在使用 onResume

    _firebaseMessaging.configure(

      onMessage: (Map<String, dynamic> message) async {
        print("onMessage: ${message}");
        print(message['notification']['body']);

      },

      onLaunch: (Map<String, dynamic> message) async {
        print("onMessage: ${message}");
      },
      onResume: (Map<String, dynamic> message) async {
        print("onMessage: ${message}");
      },
    );

Are you using onResume in configuration?你在配置中使用 onResume 吗?
You need to add it.您需要添加它。 Check it out一探究竟

恢复

暂无
暂无

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

相关问题 当应用在后台时,iOS会收到媒体播放器通知 - iOS receive Media Player Notifications when app is in background 如何能够在 iOS 上使用 FCM 接收后台通知(android 已经可以使用) - How to be able to receive background notifications with FCM on iOS (android already works) 当应用程序处于前台时(颤动)在 iOS 中接收 fcm - Receiving fcm in iOS when app is foreground (flutter) 为什么我的 flutter 应用在 iOS 上运行时没有使用 Firebase 云消息接收通知? - Why my flutter app doesn't receive notifications using Firebase Cloud Messaging when running on iOS? 在 IOS 应用程序的后台接收来自 firebase 的通知? - Receive notifications from firebase in background on IOS App? 如何在应用程序处于后台时接收Darwin通知 - How to Receive Darwin Notifications when app is in background 应用被杀死时,有没有办法接收通知? 那就是当应用程序无法在iOS的前台或后台运行时 - Is there a way to receive notification when app is killed? That is when app is not working in foreground or background in iOS iOS 应用程序在后台时无法接收 FCM 推送通知 - Unable to receive FCM push notification when iOS application is in background 当应用程序在 iOS 前台时如何处理 Flutter FCM 推送通知? - How to handle Flutter FCM push notification when app in foreground for iOS? Fcm:当应用程序在后台和前台时向 Android 和 IOS 发送 DataMessage - Fcm: Send DataMessage to Android and IOS when app is in background and in foreground
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM