Search code examples
jsoncompressiongoogle-cloud-messaginggzipchrome-gcm

Compress json string for gcm push notification message


I have problem with json data and gcm push notification.

I send big json data and it exceed 4kb limit, so is there any compression that i can use to compress that json(gzip or something like that) and send it?


Solution

  • If data is that big then you should use GCM only as informer to the application that it needs to pull some updated data from server.

    1. So use a tickle message to notify the device that there is something new at server end.

    2. When you receive that tickle message from server, make a pull request to the server in response of which do the needful (Generate a notification/ Update Db or whatever needed)