![](/img/trans.png)
[英]Android 12 firebase push notifications don't work when app is in the background
[英]Firebase Notification onBackground don't work for Android
由於沒有注冊 onBackgroundMessage 處理程序,無法在 Dart 中處理后台消息。
在 AndroidManifest 上添加配置
您需要在void main()
中注冊一個onBackgroundMessage
處理程序來處理您收到的后台消息。 像這樣:
void main() {
FirebaseMessaging.onBackgroundMessage(_firebaseMessagingBackgroundHandler);
runApp(MyApp());
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.