Rants, raves and random brain dumps on Technology including Architecture, Mobile SEO, Search Engine Optimization, Ontology, Clean Energy, Software Development, Neo4J & other Graph Databases, Cypher, LiveCycle ES, Adobe MAX, Open Data, Service Oriented Architecture (SOA), Web 2.0, Music, Flex, PDF, LiveCycle, AIR, Mobile Development, Tutorials, Technology and most importantly our own damn opinions! Approved by Tim Plommer, Financial Agent, 604 806 5556.
Thursday, July 19, 2012
Dude - Where is my C2DM?
So a project we're working on at Technoracle requires push notifications. For iOS builds we are using Apple's APNS, which is very secure and reliable. I had an issue with C2DM and went to the Google Developer website and was blind sided by this message:
Dang! For the uninitiated, C2DM is Cloud to Device Messaging. Those little red notifications you see on your phone letting you know that you have actionable items to look at works by a small daemon running in the background at all times, waiting for messages. The messages are composed of several logical parts but the basic message contains a section describing the application destination, then another about the message.
C2DM vs GCM?
So what is GCM and why is it better? Google Cloud Messaging is built from the lessons learned from C2DM, or so it appears to us. Like C2DM, it's main purpose is to transfer messages to Android powered devices to let them know there is a message on a server waiting for them to do something with. C2DM was very lightweight and easy to implement. GCM offers some improved options. From the google GCM website:
"a lightweight message telling the Android application that there is new data to be fetched from the server (for instance, a movie uploaded by a friend), or it could be a message containing up to 4kb of payload data (so apps like instant messaging can consume the message directly). The GCM service handles all aspects of queueing of messages and delivery to the target Android application running on the target device."
We are excited to try it and look forward to this improvement.
More reading:
To learn more about GCM, you can join the android-gcm group and read the following documents:
Getting StartedRead this document to learn the basic steps involved in developing Android applications based on GCM.
Architectural Overview
Read this document for a description of the underlying concepts and architecture in GCM.
Demo App Tutorial
Read this document to walk through setting up and running the GCM demo app.
Advanced Topics
Read this document to get a more in-depth understanding of key GCM features.
Migration
Read this document if you are a C2DM developer moving to GCM.
I haven't done a migration yet. Got hit hard by a car while riding my bike and have been unable to work for past week. I had similar thoughts too with the documentation. Some things I had noted are that OAuth and Client logins are now deprecated (makes sense to some degree to enforce stricter control) and JSON support. This is more aligned with APNS now.
Did you migrate over? There are sure to be a few kinks.
When I try to receive push Notifications I received these errors at the moment of receive notifications with this url: https://android.apis.google.com/c2dm/send:
When I try to receive push Notifications I received these errors at the moment of receive notifications with this url: https://android.apis.google.com/c2dm/send:
Do not spam this blog! Google and Yahoo DO NOT follow comment links for SEO. If you post an unrelated link advertising a company or service, you will be reported immediately for spam and your link deleted within 30 minutes. If you want to sponsor a post, please let us know by reaching out to duane dot nickull at gmail dot com.
Hi there, wonder how the migration went to GCM. I find the Migration doc rather skinny and wondered if you had any issues or tips you could share...
ReplyDeleteI haven't done a migration yet. Got hit hard by a car while riding my bike and have been unable to work for past week. I had similar thoughts too with the documentation. Some things I had noted are that OAuth and Client logins are now deprecated (makes sense to some degree to enforce stricter control) and JSON support. This is more aligned with APNS now.
ReplyDeleteDid you migrate over? There are sure to be a few kinks.
Does the C2DM notification service still works?
ReplyDeleteDoes the C2DM notification service still works?
ReplyDeleteYes - it currently still works but all new apps should be written using GCM.
ReplyDeleteWhen I try to receive push Notifications I received these errors at the moment of receive notifications with this url: https://android.apis.google.com/c2dm/send:
ReplyDeletedmControl: registrationId = null, error = SERVICE_NOT_AVAILABLE, removed = null
Registration error SERVICE_NOT_AVAILABLE
Error when trying to recover the notification token from C2DM. Error id: SERVICE_NOT_AVAILABLE
And the device displays the message: Google service is not available. Try again
Do you have this problem with push notifications or any idea to solve my problem?
When I try to receive push Notifications I received these errors at the moment of receive notifications with this url: https://android.apis.google.com/c2dm/send:
ReplyDeletedmControl: registrationId = null, error = SERVICE_NOT_AVAILABLE, removed = null
Registration error SERVICE_NOT_AVAILABLE
Error when trying to recover the notification token from C2DM. Error id: SERVICE_NOT_AVAILABLE
And the device displays the message: Google service is not available. Try again
Do you have this problem with push notifications or any idea to solve my problem?
It looks like the server you are using is not accepting C2DM registration. How are you sending it?
ReplyDeleteI had an account that was already registered
ReplyDeleteI was using an account that was already registered, and it was working on December, but currently push notifications stopped working
ReplyDeletesorry for the spam, we migrated to the new notification system and now everything works fine
ReplyDeleteRicardo:
ReplyDeleteDefinitely not spam. This is helpful info for others. Thank you for sharing here.
Duane