Reputation:
I have a few apps which are dependent from server side. From there are getting they data. The server side needed development anyhow. Server code hosting is done in our side. The client-server communication, structure is already up. In this state we need to implement a push notification: If there are new data on the server than it should be visible at user somehow.
The "standard", recommended way now is to use Google Cloud Messaging System.
I have a few concerns about it:
I am thinking to implement like this:
I will write a broadcast receiver listening when the user got internet connection. On Internet connection it will check the server to see if it has something new or not. If is does than it will show a notification and job is done. If the user clicks the notification it will start the app and download the playload. I will use an alarm schedule, to check the server again after 1 or 15 min or 4 hours, whatever. There it will be no service running in background, just receivers!
The register - unregister functionality should be done in app.
Communications to server in plus:
When the client comes to server it will send his IMEI anyhow to identify, so the server will know for who need to send push.
Anybody can take Google proposed solution and prove it is better in this case than our in-house solution?
Upvotes: 0
Views: 1028
Reputation: 393831
The main problem with that solution is that you'll add one more background process that shortens the battery life. Imagine what would happen if many app developers choose to implement your solution. A user that installs several such applications will have their battery emptied quickly. With GCM, one connection is maintained with one server, and that connection serves all applications on the device.
I believe integration with GCM is simpler than developing a push solution by yourself. The API changes always come with improvements (original GCM allowed multiple senders while C2DM didn't; the new GCM gives you user notifications and device to cloud messaging), but even if you don't choose to work with them, the old APIs still work (even if they are deprecated).
Upvotes: 1