Is there a way to store received Push Notifications when app in background

Hello guys,

I have implemented Push Notification and I have logic where when notifications comes I save this notification for later display to user(the bell button displays all notifications received). When app is in foreground this works fine and notifications are stored in central storage (vuex in this case). But when app is closed(it is not even killed) I receive Push notification in status bar but my logic is not triggered and when user enters application again he has no info of this notificaiton only of ones that were presented while app was in foreground. This logic is placed inside pushNotificationReceived event listener.

Is there a way to activate this handler even when app is in background?

Thanks in advance!

I am sending notifcation + data notification. I tried to switch to data only and it made handler activate even when app was not in foreground. Only thing that I don’t like now is that when app is killed I do not receive not receive any notification, and if I was sending classic notification (not data one) I would.

So problem is somewhat solved but would like to hear if there is better solution to this.

Edit: Actually when app is killed and notification is sent ,then when app is opened again and after some time passes notification actually comes through. I don’t know if this is expected behavior