abhijitsinghh
abhijitsinghh

Reputation: 41

Android GCM Registration is failing

I am working on Google cloud messaging service in my android app. For this I need to register my android app to GCM server. The gcm registration is failing.

I have checked: The gcm register code is Async call. The sender id (project id) is correct. The manifest file is as per the google doc. http://developer.android.com/google/gcm/client.html My device has google account set up. I have tried both the cases - add google-play-services jar and import it as project. I even went on to specify the version number (com.google.android.gms.version) in manifest as per this http://developer.android.com/google/play-services/setup.html#Setup

Where and why would this be failing? When I catch the exception, exception cause is NULL.

I had done a demo app for this GCM part and it was working fine. I had used Eclipse with JellyBean SDK. I extended this project to make the current app - package stucture remains same. But now am on Kitkat SDK.

I used the same Sender Id as before to register with GCM. It failed giving null id. I created new project at cloud console and used its project number as sender id. Still same error. Registration Id is null. I don't think Sender Id should be any issue.

Any help would be appreciated.

Upvotes: 0

Views: 798

Answers (3)

abhijitsinghh
abhijitsinghh

Reputation: 41

I am getting the GCM Registration Id now. I made two changes. Removed debuggable=false from Manifest file. Wrote a code in the activity to check for version of Play Store. So conclusion, it was the issue with play store version may be.

Upvotes: 0

Karan Maru
Karan Maru

Reputation: 1001

please follow Push Notification via GCM

if key for browser apps doesn't work, then create key with ip locking and replace it into your config.php file, it will sure work.

please also check whether your client side code works properly or not on this site

Upvotes: 0

user3380405
user3380405

Reputation:

So is GCMRegistrar Class giving out, that it failed to register?

  • i think it could be your Manifest file - check everything correctly until you are really sure you did everything right.

I had an other problem when i implemented GCM into my Project. It was giving out "Regestration OKay" but the REG_ID from GCM Server that i needed to read out, was giving me an Empty (not NULL) it was empty LOL.

I moved my MainActivity (where the regestration happens) in the "original" package of my project and it worked.

Upvotes: 0

Related Questions