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

  • Home
  • SEARCH
  • 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 8198973
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T06:04:35+00:00 2026-06-07T06:04:35+00:00

From the GCM docs : When an application is updated, it should invalidate its

  • 0

From the GCM docs:

When an application is updated, it should invalidate its existing
registration ID, as it is not guaranteed to work with the new version.
Because there is no lifecycle method called when the application is
updated, the best way to achieve this validation is by storing the
current application version when a registration ID is stored. Then
when the application is started, compare the stored value with the
current application version. If they do not match, invalidate the
stored data and start the registration process again.

When the docs state that “it is not guaranteed to work with the new version” is that a GCM limitation or are they speculating about potential changes in my app’s behavior from version to version?

From the app side I can more-or-less guarantee that successive versions will function properly with respect to GCM and whatever app-specific message format I concoct. Do I still need to re-register?

If so, which should I use to detect a “new version”: version code or version name? My understanding is that these are “free form” and the app developer sets them to whatever values he chooses. So, what if I put an app update in the store but don’t change versionName or versionCode; would I need to re-register with GCM?

It seems like what GCM actually wants is for the app to re-register each time a new installation is launched for the first time (and each time it’s successively launched until registration is complete), regardless of the values in versionName and versionCode. Is that an accurate statement?

  • 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-07T06:04:36+00:00Added an answer on June 7, 2026 at 6:04 am

    I don’t remember where we’ve read it, but it came to our attention that when a device gets a push while an app is not installed, Google will invalidate the registration id.

    This makes sense if the app is really uninstalled, but if the device was actually in the middle on an update, it quickly uninstalls and re-installs, so google might mistakenly think the registration needs to be invalidated.

    The solution seems like to re-register on the first launch after an update, to guarantee your app registration id is active.

    Version code is indeed a freely selected number, but you must increase it on every new version you publish to google play, so you can check if that number has changed, and know your app had been updated and you need to refresh the registration.

    EDIT:

    This is also relevant to C2DM‘s successor GCM, with a lot more docs explaining this behavior and how to properly write code.

    See: http://developer.android.com/google/gcm/client.html with all the details.

    Specifically this code, where getRegistrationId will return an empty string in case the version code changed forcing the client to register again:

            if (checkPlayServices()) {
                gcm = GoogleCloudMessaging.getInstance(this);
                regid = getRegistrationId(context);
    
                if (regid.isEmpty()) {
                    registerInBackground();
                }
            } else {
                Log.i(TAG, "No valid Google Play Services APK found.");
            }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

It does not get registration id from GCM server the app does not give
I am trying to retrieve my GCM registration ID from my android emulator but
I'm trying to migrate from C2DM to GCM, and it mostly works just fine.
From the Scala API , I got the following example, which does not compile;
From PEP 8 : - Imports should usually be on separate lines, e.g.: Yes:
From observing source code for various Android applications (not written by me), I noticed
From your experience, are there any security measures that one should undertake on a
From the Susy docs: http://susy.oddbird.net/guides/reference/#ref-grid-background SUSY GRID BACKGROUND Show the Susy Grid as a
from what i could figure out, Git stores content of each version of the
From a desktop application developer point of view, is there any difference between developing

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.