16693

InvalidRegistration both on C2DM & GCM

Question:

I'm trying to send Push Notifications via C2DM / GCM to an Android Application via PHP. No matter which i use, i keep getting the following :

For GCM : {"multicast_id":7672049265453358197,"success":0,"failure":1,"canonical_ids":0,"results":[{"error":"InvalidRegistration"}]}

For C2DM : Error=InvalidRegistration

After reading allot about this issue all day I'm still clueless as to why this is an InvalidRegistration as if i take the registatoin_id and use it to send a test push message via Urban Airship it works.

<ul><li>Notice that this is not an auth issue as i get a [http_code] => 200 back from google and not 401.</li> <li>If i send an empty registatoin_id or even omit just one char from it the error message changes to "MissingRegistration".</li> </ul>

Any help would be appreciated.

Answer1:

If you copied the apid from UrbanAirship then that's the problem:

<a href="http://docs.urbanairship.com/reference/glossary.html#term-apid" rel="nofollow">http://docs.urbanairship.com/reference/glossary.html#term-apid</a>

<blockquote>

Airship Push Identifier

APID

APIDs identify devices with transient registration IDs, such as Windows devices. These identifiers are version 4 UUIDs, and are 36 characters long, including dashes.

</blockquote>

You need to get the device information from <a href="http://docs.urbanairship.com/api/ua.html#get--api-apids-(APID)" rel="nofollow">http://docs.urbanairship.com/api/ua.html#get--api-apids-(APID)</a> in the "gcm_registration_id" property. That's the registration id needed.

It seems you need to then keep track of that registration id as it is transient as suggested by UrbanAirship. But that's another topic.

Recommend

  • Update a subset of dataframe rows and columns from another dataframe
  • push notification in android 1.6
  • Facebook Ads API - Batch Requesting Targeting Search
  • How do I configure installation of plugins in Grails 3.0.4?
  • R add new column depending on values in a range in different columns
  • Morphing in WebGL shaders with mix() between more then two targets
  • retrofit.RetrofitError: 404 Not Found
  • Returning this from a constructor function in JS
  • Is there any way to call saveCurrentTurnWithMatchData without sending a push notification?
  • Angular Bootstrap Carousel Slide Transition not working correctly
  • What is the use of a session store?
  • How to get the date of next specified day of week
  • How to log in to an HTTPS website with Jsoup?
  • PDO error when wrong host name
  • Is there a way to dynamically embed PDF Files in a JSP pulled from the file system?
  • Switch to popup in python using selenium
  • Who propagate bugfixes across branches (corporate development)?
  • Web.config system.webserver errors
  • Silverlight DependencyProperty.SetCurrentValue Equivalent
  • ADO and msqli connections very slow
  • How can the INSERT … ON CONFLICT (id) DO UPDATE… syntax be used with a sequence ID?
  • Problems compiling files using JOGL
  • HTTP/2 streams vs HTTP/1.1 connections
  • Python urlparse: small issue
  • NHibernate Validation Localization with S#arp Architecture
  • How can I send an e-mail from a vbs script
  • Display issues when we change from one jquery mobile page to another in firefox
  • Deselecting radio buttons while keeping the View Model in synch
  • Different response to non-authenticated users and AJAX calls
  • Accessing IRQ description array within a module and displaying action names
  • How to recover from a Spring Social ExpiredAuthorizationException
  • ILMerge & Keep Assembly Name
  • JSON with duplicate key names losing information when parsed
  • Arrow is showed instead of the material design version hamburger icon. Why doesn't syncState in
  • Large data - storage and query
  • Jquery - Jquery Wysiwyg return html as a string
  • WOWZA + RTMP + HTML5 Playback?
  • Data Validation Drop Down Box Arrow Disappearing
  • Getting Messege Twice Using IMvxMessenger
  • How to push additional view controllers onto NavigationController but keep the TabBar?