Android Question Firebase notifications but only for a specific user?

Dianzoa

Active Member
Licensed User
Hello mates! How are You doing?
Since the new android 8.1 keeps killing my app when the phone is not active for a certain time ( still don't know how much minutes before he kills it). I need to use push notifications to inform the user that He has a job to do, since the app is already killed, this can be my solution for that, as far as I know push notifications can call the app to start again.

Cheers, Diego.
 

DonManfred

Expert
Licensed User
Longtime User
now that the phone kills the app
I can wait a week. If i then send a notification my app starts. Even if not started for a week.

Note that i never kill/swipe a app from the recent list
 
Upvote 0

Dianzoa

Active Member
Licensed User
I can wait a week. If i then send a notification my app starts. Even if not started for a week.

Note that i never kill/swipe a app from the recent list
I did not do that aswell, just leave it alone, but apparently the OS kill it completely after a few hours of inactivity, the app was only minimised.
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
I thought it has to work all the time, since that the purpose of sendind push notifications to the device?
it does work for me. Even after some weeks my app starts if a notification came in.
You need to try this. Stop the app, or better, in the settings go and Force Stop
#if you do this the app is send into a stale mode. It does not receive a notification until the uer manually starts the app. This is how android works.

Do not kill apps. Let android decide when to kill a app (NOT using any tools).
 
Upvote 0

Dianzoa

Active Member
Licensed User
Do not kill apps. Let android when to kill a app (NOT using any tools).[/QUOTE said:
That was the scenario that I described. I just let the app be, and go to sleep. WHen I woke up I sent a notification to the sleeping phone and don't get the notification. Until now, that I open the app manually again.
 
Upvote 0

Dianzoa

Active Member
Licensed User
this is happening in my app too. But this is something other than manually killing the app (force close).

My app gets started when a message come in.
Well that's the behaviour I need, but does not work for me after a few hours of inactivity.
...
"There are also devices where even if the app is still just simply swiped away, even though it's not force closed, the device itself is preventing it from receiving messages. Others say that this can't be the case because apps like WhatsApp were able to do it. The reason I've learned so far for that is because the device manufacturers have whitelisted most of the well-known apps for it to be possible."
 
Last edited:
Upvote 0

Dianzoa

Active Member
Licensed User
I am experimenting with this option.
B4X:
Dim android As Map = CreateMap("priority": "high","ttl": 0)
m.Put("data": data)
m.Put("android": android)
at first it does not seem to do something different, but I will see how it works after the device enters the doze mode.
 
Upvote 0

Dianzoa

Active Member
Licensed User
This is expected. Stopping the app like this moves it to the STOP state. It will never start until the user explicitly starts it.
Hi Erel, but what about if I never killed the app, just let it run, android 8.1, stopped it after a feww minutes, or hours, still don't get it.
EDIT:But if I killed or STOP the app, the FCM would not sent the notification still?
 
Last edited:
Upvote 0
Top