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 8221039
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T13:45:44+00:00 2026-06-07T13:45:44+00:00

I have tried some forum pages and searched through stackoverflow for the same thing,

  • 0

I have tried some forum pages and searched through stackoverflow for the same thing, but I did not find the solution.

I have used the below code to generate registration ID for GCM notification. But I get an empty string as a registration ID:

GCMRegistrar.checkDevice(this);
GCMRegistrar.checkManifest(this);

if (GCMRegistrar.isRegistered(this)) {
Log.d(“info”, GCMRegistrar.getRegistrationId(this));
}

regId = GCMRegistrar.getRegistrationId(this);

Log.v("log", " register id oslo : " + regId);

if (regId.equals("")) {
    // replace this with the project ID
    GCMRegistrar.register(this, "718437041388");
    Log.d("info", GCMRegistrar.getRegistrationId(this));
} else {
    Log.d("info", "already registered as" + regId);
}

Please help me with this, tell me if I got anything wrong.

Thank you in advance,
Nirav.

  • 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-07T13:45:46+00:00Added an answer on June 7, 2026 at 1:45 pm

    You should not get the registrationId just after GCMRegistrar.register(this, "718437041388");
    In fact, do you have a correct GCMIntentService.java which receive the regId?
    If yes, you can get the regId from the onRegistered inside GCMIntentService.java

     @Override
        protected void onRegistered(Context context, String registrationId) {
            Log.i(TAG, "Device registered: regId = " + registrationId);
            Log.d("GCMIntentService", "in GCMIntentService");
            displayMessage(context, getString(R.string.gcm_registered));
            ServerUtilities.register(context, registrationId);
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have tried to find some articles on my problem, but haven't found anything
I have tried to find some decent documentation on traversing in jQuery, but have
I have tried to do some reading about it, but I failed to find
I have tried to compile some C++ WIN32 code with GCC through DevC++ (MinGW
I have tried using JQuery Tools 1.2.7 ajaxed tabs, but for some reason the
Complete new person to Ruby and Rails here... Have tried some tutorials in the
I have tried to get some information from W3C regarding the update of an
In the following example (apologies for the length) I have tried to isolate some
I'm new in soapclient, I have tried to do some study online and also
I have tried to solve the problems related to circular dependency in some files

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.