Reputation: 31
My team is on developing to android app.
we want send some file to client on GCM
I knew GCM can send 4kb of payload, and it can send 1000EA's message for onetime.
so.. Can we send just 4mb data of file for onetime?
please help us!
Upvotes: 3
Views: 1151
Reputation: 2934
I would recommend uploading the file elsewhere, and putting a URL to the file in the content of the GCM message that would tell the receiver to download from the URL.
A message with contents over 4KB cannot be sent. Plus, they could be received out of order anyways.
Upvotes: 5
Reputation: 2800
I don't think you want to use GCM for this. Unless the file is under 4kb, it's best to look into a better way of sending the file to the client rather than chunking it in GCM messages. There are a couple reasons for this.
1) The purpose of GCM is small payload such as notifications or small data packages. It's not intended for large messages, just small transmissons.
2) GCM makes no guarantee of delivery. If you are wanting to chunk a file into these messages and send them then there is a chance that one of them can be lost in transmission since it has no guarantee of message delivery, kind of like UDP. So one lost message and your file is ruined.
Upvotes: 2