我的 FCM 正在运行 onMessage、onResume 和 onLaunch,但 onBackgroundMessage 不起作用,下面是我的代码:
_firebaseMessaging.configure(
onMessage: (Map<String, dynamic> message) async {
print("onMessage: $message");
_showItemDialog(message);
},
onBackgroundMessage: myBackgroundMessageHandler,
onLaunch: (Map<String, dynamic> message) async {
print("onLaunch: $message");
_navigateToItemDetail(message);
},
onResume: (Map<String, dynamic> message) async {
print("onResume: $message");
_navigateToItemDetail(message);
},
);
每当我的应用程序上的消息触发关闭时,我都会在控制台上观察到我收到以下消息:
W/FirebaseMessaging( 5792): Missing Default Notification Channel metadata in AndroidManifest. Default value will be used.