Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8809333
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T02:50:56+00:00 2026-06-14T02:50:56+00:00

I have successfully implemented a client/server Android GCM application. My app server holds a

  • 0

I have successfully implemented a client/server Android GCM application. My app server holds a database of device/registration_id pairs. Messages are sent to the devices via web accessible PHP pages. I am trying to write the error handling on the server side, specifically the case where the response contains a canonical_id. The developer docs are quite clear about what needs to be done and why such a response might be produced:

Canonical IDs

On the server side, as long as the application is behaving well,
everything should work normally. However, if a bug in the application
triggers multiple registrations for the same device, it can be hard to
reconcile state and you might end up with duplicate messages.

GCM provides a facility called “canonical registration IDs” to easily
recover from these situations. A canonical registration ID is defined
to be the ID of the last registration requested by your application.
This is the ID that the server should use when sending messages to the
device.

If later on you try to send a message using a different registration
ID, GCM will process the request as usual, but it will include the
canonical registration ID in the registration_id field of the
response. Make sure to replace the registration ID stored in your
server with this canonical ID, as eventually the ID you’re using will
stop working.

So within my Android client app I have a development only button which will register the device with GCMRegistrar.register() a second time without bothering to unregister it first. I had assumed that this would get me a registration_id different from the first time I registered it, and that sending a message to the device from the web (maybe using the old id) would give me a response with a canonical_id.

However the second registration returns exactly the same reg_id as the first time.

Thus sending a message via the PHP on my server won’t show a canonical_id in the response. I really need to test the situation where a canonical_id is returned, indicating that I need to update my database as my PHP skills are not the finest!

So any ideas as to how I could provoke such a response would be gratefully received

Update: I just tried uninstalling the app from the phone, then reinstalling it. I still get the same reg_id.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T02:50:57+00:00Added an answer on June 14, 2026 at 2:50 am

    I answered that question – here.
    You can try following the steps I used to get a canonical registration Id. It did involve uninstalling the App, but perhaps you didn’t do all the steps I describe there.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have successfully implemented this from android to a java httpservlet on google app
I have successfully implemented a mysql server as a JDBCRealm for authentication in Tomcat
I have successfully implemented a network application in visual CLR project using boost.asio. but
I have successfully implemented interop beftween Win32 application and managed .Net dll as described
I have successfully implemented printing and print preview for my app using the PrintDocument,
I have successfully implemented SUBSONIC DAL in my desktop application. it was superb experience.
I have following Scenario: PHP(Server, Writer) ----> MySQL Database <------ PHP(Client, Reader/ Writer); PHPS
Recently I have been working on a multiplayer networking app. I had successfully implemented
I successfully implemented client editors and a server side API. Now I'm adding more
I have successfully implemented a restful service that works with my own client. Now,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.