This repository has been archived by the owner on Jan 10, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 86
FCM Message format
Jacqueline Bronger edited this page May 1, 2018
·
1 revision
This page describes the payload of a message received via FCM (Firebase Cloud Messaging). The whole object is the payload of the FCM Message - do not confuse the payload of the message with the payload of the FCM message, these are two different things. Structure is as follows:
FCM Message -> FCM Payload -> TCA Message -> TCA Payload
{
"type": 1,
"notification": 0,
"payload": {
"room": 1,
"member": 1,
"message": "hello world"
}
}
-
type: integer - describes the format of the json payload
- 0 - do nothing
- 1 - Chat message
- 2 - Update
- 3 - Alert
- notification: integer - notification id on the server (PK)
- payload: string - contains a json formatted string which contains the data. This string should be parsed by the client library. The total limit of a FCM message is currently 4kBs.
This message type should do nothing but inform the server that it received this FCM notification. Refer to the backend documentation for further information
{
"type": 1,
"notification": 0,
"payload": {
"room": 1,
"member": 1,
"message": -1
}
}
- room: integer - the room id which has a new message
- member: integer - the member which posted the message
- message: integer - only used when a message gets updated - otherwise null
{
"type": 2,
"notification": 0,
"payload": {
"packageVersion": 50,
"sdkVersion": 14,
"releaseDate": "21.12.1970",
"lowestVersion": 1
}
}
- packageVersion: integer - the version of the newest apk
- sdkVersion: integer - the sdk version of the newest apk
- releaseDate: integer - the date the version was released
- lowestVersion: integer - lowest version which is allowed to use the api. Apps using a version below this should be blocked from accessing any apis. This is meant as emergency block if someday we want to force the users to update to a version.
{
"type": 3,
"notification": 0,
"payload": {
"silent": false
}
}
- title: string - warning title to show in notification
- text: string - information text to display when notification gets clicked
- signature: string - RSA Signature of title+text
- silent: boolean - play some sort of sound if false (e.g.: beeping)