- if it's running, it receives notifications in the foreground
- if it's paused, Google does it's job and shows a notification whch can be clicked
If I "swipe" it away (= kill it), the app is gone and so the FCM service and listener. I defined the FCM service as sticky but it does not work (should be recreated). Any idea?
FCM should work after you kill the app by swiping it from the recent apps list (which is not the same as killing it from the settings screen).
I've just verified it on Nexus 5X running Android 7.
It seems like on some versions of Android (might depend on the manufacturer) it doesn't behave correctly and the app is put in the stopped state. The same as killing from the setting screen. In this case the app will not receive anything until it is explicitly started by the user. https://developer.android.com/about/versions/android-3.1.html#launchcontrols
The app will not be killed if there is a foreground service. However this is not the recommended way to implement push notifications.
FCM should work after you kill the app by swiping it from the recent apps list (which is not the same as killing it from the settings screen).
I've just verified it on Nexus 5X running Android 7.
Thank's guys. Will check it this evening and report. Maybe I was to fast (swipe from recent app's and send another message). Funny as Google's REST API reports "successful" all the time.
This is expected. Your message was delivered successfully to Firebase servers. It can take many hours for the message to reach all the target devices (can be millions of devices).
Yes, you are (of course) correct. I just startet B4J and changed the code a bit. While testing (I did not update or even use my B4A app since yesterday) I then noticed several notifications (caused by my test). Works as designed.