FCM (Firebase Cloud Messaging) is a free service from Google that lets users reliably deliver push notifications to web or android devices.For more information on FCM please see the following documentation.
MQTTchat uses FCM for two purposes:
Send notifications when MQTT messages or MQTT notifications are received and the android application is closed.
Route audio and video calls when the application is closed.
FCM feature is not activated by default, to activate it for your application, you must follow the following steps:
First you need to setup your app to firebase console to get a google-serivces.json file. Then you need to add this file to your project under app package.
Once the json file is added you need to add the Firebase dependencies. In the project's build.gradle:
// Add this line
And at the bottom of the app's build.gradle add:
That is all. MQTT chat takes care of others configs and use of FCM in source code.
Now you need to add your FCM server key to your MQTT chat Admin Panel to allow our MQTT servers to send notifications to your users' devices.
You can get the server key from the FCM firebase console /project/settings/cloud Messaging/server key.
Mqttchat Telifoun - FCM
You can customize MQTT chat GUI colors to match your android application theme. Below differents color variables used by MQTT chat: