Reputation: 37
We are developing messaging app in ios, android and web platforms. We want to send a large chat message(text) from the server to clients(Web, android, ios). But data messages can have a 4KB maximum payload when sending push notification using FCM as mentioned here.
An immediate workaround would be to divide a large message into chunks of 4KB and send all those notification. Any better suggestion other than this solution would be appreciated.
Upvotes: 0
Views: 1499
Reputation: 1173
you can separate the message and make your own message type that contains information about how many parts and it's part number, then assign an id to the whole message, send them through FCM, in the client, you can collect received messages until all parts will arrive, and then combine all of them to get final message, I am using this solution. it's working believe me 😊
Upvotes: 1