I have a working android app with firebase cloud messaging notifications, but if I shut down the app the notifications don't come untill I open the app again. Is there a possibility of creating some kind of service that would run in the background and intercept incoming messages and create notifications? Just to be clear - I mean a situation when the app is not even running in the background.
Also, when a notification comes I need an auth token to my backend API and because of that sometimes the app crashes (the onMessageRead of the FirebaseMessagingService is fired before the app can fetch the token). Is there an easy to implement option of marking the message as unread in firebase so it comes again in some amount of time? Or choose the moment when the onMessageeRead is fired when the app opens?