# FCM notifications not triggering onNotification method while app in background

**URL:** <https://forum.ionicframework.com/t/fcm-notifications-not-triggering-onnotification-method-while-app-in-background/188999>\
**Category:** Ionic Angular\
**Created:** [May 7, 2020, 9:37pm UTC](https://forum.ionicframework.com/t/fcm-notifications-not-triggering-onnotification-method-while-app-in-background/188999 "2020-05-07T21:37:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dikwata](https://avatars.discourse-cdn.com/v4/letter/d/13edae/32.png) [@dikwata](https://forum.ionicframework.com/u/dikwata)\
**Post date:** [May 7, 2020, 9:37pm UTC](https://forum.ionicframework.com/t/fcm-notifications-not-triggering-onnotification-method-while-app-in-background/188999/1 "2020-05-07T21:37:38Z")

</div>

I am using @ionic-native/fcm. I can get notifications on the notification tray but the onNotification method is not called while receiving the notification. It is only called when the notification is tapped on the notification tray. below is the code I’ am using:

this.fcm.onNotification().subscribe(data =\> {  
if(data.wasTapped){

} else {

};  
});

My payload for notification is as follows:  
{  
“notification”:{  
“title”:“My notification”,  
“body”:“My notification body”,  
“sound”:“default”,  
“click\_action”:“FCM\_PLUGIN\_ACTIVITY”,  
“icon”:“fcm\_push\_icon”  
},  
“data”:{  
“param1”:“value1”,  
},  
“to”:"/topics/topicExample",  
}

---

<div class="post-metadata">

**Author:** ![Harish18](https://avatars.discourse-cdn.com/v4/letter/h/c6cbf5/32.png) [@Harish18](https://forum.ionicframework.com/u/Harish18)\
**Post date:** [August 13, 2020, 7:23am UTC](https://forum.ionicframework.com/t/fcm-notifications-not-triggering-onnotification-method-while-app-in-background/188999/2 "2020-08-13T07:23:14Z")

</div>

Hello @dikwata,

Any solution on this. I am getting the same issue
