How to handle fcm background notification without tapping on it in ionic 3

好久不见. 提交于 2019-12-08 02:39:46

问题


i am using FCM in ionic 3. I am getting notification properly when the app is in foreground. When I receive a notification in background i am getting the data in the notification only after tapping the notification. But i want to get the data without tapping on the notification. For example see the below code.

this.fcm.onNotification().subscribe(data => {
  if(data.wasTapped){
    console.log("Received in background");
  } else {
    console.log("Received in foreground");
  };
});

Here i am getting data if data.wasTrapped is true else in the foreground. My problem is to get data without tapping the notification when the app is in background

来源:https://stackoverflow.com/questions/51946934/how-to-handle-fcm-background-notification-without-tapping-on-it-in-ionic-3

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!