Skip to content

#4 Online Messaging

ManinderjitS edited this page Dec 15, 2020 · 4 revisions

To send a message online

pushMessageToFirebase(ChatMessage chatMessage, Context mActivity)

Receiving online messages

  • 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.

Cloud functions

  • 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.
Clone this wiki locally