Is it possible to register to GCM service automatically (programatically) in order to get the sender ID (or whichever id is required)?
Is it possible to register to GCM service automatically (programatically) in order to get
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I’m not sure I understand your question. The registration to GCM service is always done programatically in an Android application. You send a registration request that contains the sender Id (which is a Google Project Id) and you get in the reply a Registration Id, which you send to your server (which uses that Id to send notifications to your Application on a specific device).
Unless you mean getting the Project Id itself programatically. I don’t think that’s possible. You have to create a Google API project manually in order to get such Id. You can, however, write code in your Android application that would connect your server to get the Project Id (which you already created manually), and then use it to register to GCM. This would allow you to change the Project Id your application is registered to without updating your application’s code.