我正在尝试从codeigniter模块向我的flutter应用程序发送推送通知。 我的onResume和onLaunch无法正常工作。
我有2种情况
我的php数据有效载荷如下:
{ "data": {
"title": "Test FCM Notification",
"is_background": true,
"message": "Test notification message from gomax CRM",
"click_action": "FLUTTER_NOTIFICATION_CLICK",
"image": "https://firebase.google.com/_static/9f55fd91be/images/firebase/lockup.png",
"payload": {
"notification": ""
},
“时间戳记”:“ 2020-03-16 8:36:59” }}
我的颤动代码是:
_firebaseMessaging.configure(
onMessage: (Map<String, dynamic> message) async{
print("message on open: $message");
},
onResume: (Map<String, dynamic> message) async{
print("messageon resume: $message");
},
onLaunch: (Map<String, dynamic> message) async{
print("message on launch: $message");
},
//onBackgroundMessage:
);
和我的androidmenifest文件:
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
<intent-filter>
<action android:name="FLUTTER_NOTIFICATION_CLICK"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>