Search code examples
androidandroid-c2dm

can Google c2dm server send empty registration Id in any case?


I am trying to send a push notification to a phone number through the c2dm server. for that to happen, I am registering my mobile with the c2dm server and i store the registration id which is got from the c2dm server.

I am aware of the error codes like 403, 500

Is there any case where my registration Id could be empty?


Solution

  • No, there is no way the registration_id received from Google could be empty.

    When you make the register request to the Google server, you have to receive almost instantly in your receiver registered for handling this kind of action a registration id. Log it or make a toast with it in order to convince yourself it is not empty, and then store it. You cannot send C2D messages without a registration id.