Hello,
Firebase cloud messaging has a
4000 bytes limit in the size of its messages. However, I am unable to figure out what firebase uses to calculate the length of its messages (And therefore how I would go about checking before sending a message whether it would be accepted or rejected).
The way I calculate the number of bytes is by counting the length of the minified serialized JSON object from '{' to '}'. That being said, I have tried adding whitespace and it does not make a difference, so that length is definetly not the over-the-wire JSON object length.
Also note that when both the body and the title are included it seems like if I add and remove an equal number of bytes from either of those attributes the length stays the same. But adding a byte to any of those attribute without balancing it out by removing a byte from the other attribute causes an error when subsequently sending the message.
Thanks,
Nils