Android Question Runs FCM push notifications your app?

LucaMs

Expert
Licensed User
Longtime User
push notifications is that the process doesn't need to run for your app to receive messages

I tested using the projects posted in the library thread:
https://www.b4x.com/android/forum/t...-messages-firebase-cloud-messaging-fcm.67716/

and if I stop my app by the device settings, it does not start when I send an FMC message (I used the b4j project attached to send the message).

I can attach my b4a project but it is practically identical to the Erel' code, except for its name and topic.

[Note that I receive the FCM notification when my app is in background or in foreground]


Tested on Android 4.xx and 7.0.
 

Attachments

  • FirebaseNotifTest.zip
    9.6 KB · Views: 356

Erel

B4X founder
Staff member
Licensed User
Longtime User
The question here is very unclear as you haven't posted the full quote:

"The whole point of push notifications is that the process doesn't need to run for your app to receive messages. See the video tutorial."

This is correct and is indeed the most important point of using push notifications.

It doesn't mean that there aren't cases where you won't receive messages. For example:

- If you throw your phone to the fire then it will not receive messages. Same is true for throwing it down the toilet.
- If you stop the app from the settings page then the app will enter the "STOPPED" state. In that state it will never start until the user explicitly starts it. This is the same as newly installed apps that never ran.
This is very different than regular usage where the OS kills the app. This is also different than killing the app from the recent apps list.
Do note that on some devices killing the app with a swipe also moves the app to the STOPPED state. This is not the correct behavior.
 
Upvote 0

LucaMs

Expert
Licensed User
Longtime User
- If you throw your phone to the fire then it will not receive messages. Same is true for throwing it down the toilet.
How do you know I'm going to do it? :eek::p

If you stop the app from the settings page then the app will enter the "STOPPED" state.
This is very different than regular usage where the OS kills the app.
This is the point; I thought it was the same.
 
Upvote 0

KMatle

Expert
Licensed User
Longtime User
- If you throw your phone to the fire then it will not receive messages. Same is true for throwing it down the toilet

Fire: Works for a few secs then the debugger isn't working anymore. No logs and no exceptions ;-) Must be the exploding battery.

Toilet: Works for 1 sec then the B4A bridge isn't able to connect to the device anymore. I guess it's because the phone left our house down the street. Wifi is lost and 4G isn't good here in my tiwn. Right now I'm following it by car (sending messages still have the "successful" flag, so I still have hope ;-) )

@the users from Europe living near at the coast: It's a Huawei P20 :D Please return if found
 
Upvote 0
Top