mozilla-services/pushgo — pull request #81 by kitcambridge (2014-09-05 21:35:54+00:00)
Title: Refactor proprietary pingers

* Change the `PropPinger.Register()` signature to `(uaid string, pingData []byte)`, where `pingData` contains opaque ping data sent by the client.
* Change the `PropPinger.Send()` signature to `(uaid string, vers int64)`. The proprietary ping plugin is now responsible for retrieving the ping data from the backing store. This simplifies the logic in `Handler.UpdateHandler()` and `Serv.Hello()`.
* `PropPinger.Send()` now returns `(ok bool, err error)`. The plugin should return `false, nil` if the request succeeded, but the device could not be woken up. `UpdateHandler()` will then send the message over the WebSocket.
* Fix `GCMPing.Register()` so that it no longer stores request-specific device and registration IDs in `GCMPing.config`. Since pingers are created per application (rather than per client), the previous behavior would cause GCM requests to stomp on one another.

I tested this with GCM for Chrome (requires the "Google Cloud Messaging for Android" *and* "Google Cloud Messaging for Chrome" APIs to be enabled in the Google Dev Console), using the sample ["GCM Notifications"](https://chrome.google.com/webstore/detail/gpededflkpcoehfjpdecdkoiagajloin) app to generate registration IDs.