-
Notifications
You must be signed in to change notification settings - Fork 0
#4 Online Messaging
ManinderjitS edited this page Dec 15, 2020
·
4 revisions
- The following static function can be called from FirebaseController class:
pushMessageToFirebase(ChatMessage chatMessage, Context mActivity)
- The MyFirebaseMessagingService service class is instantiated in the MainActivity.
- This class than runs in the background (the app needs to be running for this to work) listening for incoming Firebase messages.
- This class also uses MessageUtility class to parse object from json from the received Firebase message.
- After getting the message object from json, the class then calls the save function to store the message locally.
- For online messaging, Firebase Cloud Functions are used to forward messages from sender to recipient.
- This Cloud Function can be seen in the following index.js file.