我正在尝试使用FCM和IONIC 4推送通知,并且“通知”工作得很好,但通知图像没有显示
这是发送通知的对象
{
"notification":{
"title":"Ionic 4 Notification",
"body":"This notification sent from POSTMAN using Firebase HTTP protocol",
"sound":"default",
"click_action":"FCM_PLUGIN_ACTIVITY",
"icon":"fcm_push_icon",
"main_picture":"https://qahwaziada.com/images/1566224625.jpg",
"image":"https://qahwaziada.com/images/1566224625.jpg",
"picture":"https://qahwaziada.com/images/1566224625.jpg"
},
"data":{
"page":"test"
},
"to": "/topics/all",
"priority":"high",
"restricted_package_name":""
}
,我尝试从Firebase控制台从云消息发送,但结果相同
这是代码形式app.component.ts
/**
* initialization of FCM
*/
FirebaseCloudMessagingInit(){
//token and get it
this.fcm.getToken().then(token => { console.log(token); });
this.fcm.onTokenRefresh().subscribe(token => { console.log(token); });
//listen to any notification
this.fcm.onNotification().subscribe(data => {
console.log(data,'data');
});
}