Native FCM plugin, background notifications

We are using ionic native FCM plugin which in background is using

We do nothing special, simple code like docs described:


    console.log('FCM token:', token);

    console.log('onNotification, data:', data);

        console.log('Received in background');
    } else {
        console.log('Received in foreground');

    console.log('FCM refresh token:', token);


the problem is if we run the app in background, also not closed but only in background, the Notification is appearing in the notifications try and if we tapped on it the app is opening but the onNotification event is not fired and so also data.wasTapped is never true.

So the implementation is working well for foreground notifications but not so good for background notifications.

So perhaps we are misunderstanding somthing?


Same issue here, when receiving the notification with app in foreground it logs correctly and I can see the wasTapped = false, but when the app is in background the notification is in the tray but event doesn’t fire at all.

The problem seems to be solved if you add the following in the payload’s notification object:


Can you post your notification payload?

I had the same problem, but I found out that my test payload was sending only data. It worked after I updated my test payload as follows:

let payload = {
    notification: {
        title: 'Test title',
        body: 'Test body',
    data: {someKey: 'someValue'}

Thank You Very Much !!. This worked for me !

Thank You. So many solution, and this was the reason.

Sir can u plz tell me in which section we have put above code?