Android Question Using Firebase for updates - I don't want the App to wake up

cooperlegend

Active Member
Licensed User
Longtime User
I have tried using Firebase within my App to fire a sync message to a second App (two Apps running, sharing data, the first sends a data message, the second see this message and if it is for them then they do a sync with the online database).

The problem is any firebase message goes to all devices loaded with this App, this is fine, but if the App is not running they the message wakes up the App. So people not currently using the App find that the App keeps waking up even though they don't currently want to use it.

Is there a way to set this up so that this doesn't occur?

Cheers in advance

John
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Push notifications start the app process if it is not running. This is how they work. Whether you show any UI or not is up to you.

However there are much simpler ways to communicate between two installed apps. You can send an intent between the apps. This will also cause the other app to start if it is not running.

If you want to send a message to the second app when it is running, then you should use UdpSocket.
 
Upvote 0

cooperlegend

Active Member
Licensed User
Longtime User
Thanks Erel, it has been a while but I have gone back to look at your reply to try and create a better versiom of comms for a new App, but having read my initial post I am not sure I explain this very well.

I was to share data between a single App running on more than one device (not two Apps running on a single device, which is how my original post read)

I have this working now with firebase so that when data is updated on one device it sends a firebase message which wakes up all the other devices running the same App (logged in) and refreshs the data by starting comms on these other devices.

Is there a better way to achieve this?
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…