Run application service when push notification received


Is it possible to run some application service in the background when push notification is received (no matter what is the state of the app [foreground, background, closed]).

I use Firebase push notifications.

What I think of now is to combine autostart plugin, background mode plugin and firebase messaging plugin, but it won’t cover the situation when the app is closed by the user or system worker to release resources. Autostart works only for Android too so this not the perfect solution.

Thanks for any help.