Android Question interaction between push notifications and starter service

fransvlaarhoven

Active Member
Licensed User
Longtime User
Hello,

I've an application that receives push notifications (firebase messaging).

I have seen a strange interaction between the starter service and the push notifications:

- switch off the phone
- send a few messages to the phone
- switch the phone back on
- Android boots and after a while makes a connection to the network
- the phone now receives the message that was sended while the phone was switched off
- the incoming firebase message triggers a start of the application
- this causes the service Starter to be created and started first
- and then the service handling the incoming firebase message is created and started

However, with this procedure, one message is lost.

Removing the service Starter from the application solves the problem and all messages are received.

set #StartAtBoot: True for another service also solves the problem.

Then it seems to be that:
- the phone is switched on
- Android boots
- when booting is completed, the service with #StartAtBoot: True wants to start
- this causes the service Starter to be created and started first
- the service with #StartAtBoot: True is created and started
- and after that, the service handling the incoming push messages is created and started

My conclusion, but I might be completely wrong, when it is an incoming message that triggers the start of the application, one has an interaction with service Starter.

I hope this somewhere rings a bell...
 

DonManfred

Expert
Licensed User
Longtime User
i dont understand the question at all

The service is named "FirebaseMessaging"? I mean the one which is receiving the Messages
 
Last edited:
Upvote 0

fransvlaarhoven

Active Member
Licensed User
Longtime User
i dont understand the question at all

The service is named"FirebaseMessaging"? I mean the one which is receiving the Messages

Yes, the service handling the incoming messages is named "FirebaseMessaging".

Without service Starter, all works normal

With service Starter, one message is lost when message(s) are pushed to the phone while the phone is switched off

When one makes sure that it is not the service "FirebaseMessaging" that starts the application after the phone is switched on again but something else, another service with #StartAtBoot: True, then also no message is lost.

Loosing that one single message is my problem.
For the time being, I've solved the problem by removing the service Starter from the project but this creates another problem.

Maybe there is a solution for this problem?

All suggestions are welcome...
 
Upvote 0
Top