[英]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}");
},
);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.