phonedeck/gcm4j — pull request #1 by turf00 (2013-10-21 14:56:34+00:00)
Title: Gcm4j with back off handling

We have modified Gcm4j for our needs internally and would be happy if you could receive our pull request.

1. We wanted to handle back off from GCM and therefore we have added the ability to handle backoff being reported by GCM. In this scenario, if GCM provides the Retry-After header, a client of the library is able to read this value and back off for this time period.

2. We present a method of sending a message synchronously. This is useful as we already have a thread pool consuming messages from a queue and don't need another set of threads in between. I realise it was possible using Guava's SameThreadExecutorService but the docs for that mention some overhead.

3. Better handling of exceptions with standardised errors returned from the library.

4. The GcmRequest object can be built from json contained in a String.

5. Some fields (e.g. attributes) were being marshalled into the JSON sent to GCM. Although this was ignored by GCM it might not always be so.

In the future we intend to move full exponential backoff out of our internal library and into Gcm4j. We would also like to handle sending messages using the XMPP protocol supported by GCM.

Thanks,

Justin