[英]Notification access screen keeps popping up even after granting the permission in Flutter
I use flutter_local_notifications
plugin and Firebase Messaging
library in Flutter on Android 10 and I am only reacting to notifications in the initState
method.我在 Flutter on Android 10 中使用flutter_local_notifications
插件和Firebase Messaging
库,我只对initState
方法中的通知做出反应。 I get the data from notification and show the appropriate screen.我从通知中获取数据并显示相应的屏幕。 This works.这行得通。
The problem is that the Notification access screen (screenshot) keeps popping up each time I restart the app, even though I granted all Notification access permissions.问题是每次我重新启动应用程序时,通知访问屏幕(屏幕截图)都会不断弹出,即使我授予了所有通知访问权限。 Does anyone know how to let this screen show just once?有谁知道如何让这个屏幕只显示一次?
final m = FirebaseMessaging();
@override
void initState() {
super.initState();
m.configure(
onMessage: (Map<String, dynamic> m) async {
// method call is here and works
return;
},
onResume: (Map<String, dynamic> m) {
// method call is here and works
return;
} ....
Solved by removing notifications: ^0.0.3
from pubspec.yaml
.通过删除notifications: ^0.0.3
pubspec.yaml
。 I did not use this dependency anyway.反正我没有使用这个依赖。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.