Android Question FirebaseNotifications

RichardHirst

Member
Licensed User
Longtime User
Hi Erel

Watching the great videos, the one on Firebase Notifications.

Q1. The on screen device, is this a Mirror of a real device or an emulator..? Do you have instructions how to set this up please.

Q2. With Firebase Notifications, I see you can store the message for a time on the server. Is there a way to receive these when the applications starts..? On a New Device and an Already Register Device. The same as MQTT I guess.

On that would you use MQTT or Firebase for a message system...?

Thank You

Richard
 

KMatle

Expert
Licensed User
Longtime User
Q2. With Firebase Notifications, I see you can store the message for a time on the server. Is there a way to receive these when the applications starts..? On a New Device and an Already Register Device. The same as MQTT I guess.

The app (exactly: The firebasemessaging service) is started automatically if a message arrives (via Google services running on you device). Messages are stored on the Google servers if the device isn't reachable.

The goal is to receive the message and do something with it at once (notification or something else). Like WhatsApp. If the device is "sleeping", you get a notification. If you are inside a chat, the new message is shown. You decide what happens in your app.

WhatsApp uses own servers to store the link between user and FCM token (it's abstract and can change). So when you send a WhatsApp message to a friend, it checks which FCM token your friends device has and sends a FCM message to that token (= device). This shows that you need a database to store the connection between user (or phone number) to token and update it when needed. Easy.


On that would you use MQTT or Firebase for a message system...?

It's "almost" the same technology. FCM comes for free, MQTT needs a supplier with a plan (e.g. 1000 messages are for free, more will cost you). MQTT is supported by almost every device. FCM is more for Android and iOS. FCM is integrated in Adroid (via Google) so you can use some automation (like notification if the device sleeps, depending on the type of message). A PC can't receive FCM messages (not Android nor iOS).

MQTT comes as an extra SW and works on most platforms.
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
The on screen device, is this a Mirror of a real device or an emulator..? Do you have instructions how to set this up please.
It is a real device mirrored with a software named Reflector.

On that would you use MQTT or Firebase for a message system...?
As you do not want and actually can't keep your app running all the time, you cannot implement a reliable messaging system without FCM. FCM is just one component. You should also use MQTT or any other server solution together with FCM.
 
Upvote 0
Top