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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T22:54:46+00:00 2026-06-18T22:54:46+00:00

I use GCM push notification for my Android app which is basically an instant

  • 0

I use GCM push notification for my Android app which is basically an instant messenger like Line/What’s App. In my app, even after the user logs out, the push notification continue to happen. IN other words, I have no control over the notifications.

Ideally, I would like the notifications to stop when the user logs out of the app and resume after he logs in. Thanks in advance.

  • 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-18T22:54:48+00:00Added an answer on June 18, 2026 at 10:54 pm

    You should use SharedPreferences.

    You should have a preference that contain the value if the user should be alerted or not.
    Let’s say, once a user logged out – set the preference value to false.
    Now,in your GCMIntentService in the onMessage method, check the value of the preference, if its false, just do nothing.

    Have a look at this example:

    How to use SharedPreferences in Android to store, fetch and edit values

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

Sidebar

Related Questions

I'm creating an app which uses Facebook and GCM. A user can use the
I use push notification (GCM) in my Android project. According to GCM tutorial I
I am new to android and doing a demo app for gcm push notification.
I was trying to use GCM to have push-notification in my app. I called
I have migrated my app to use the new GCM push system. It works
I am trying to create a sample app for Android which can have push
I am trying to use the GCM service in my android app. For that,
When you add Android GCM to an app, the documentation says Declare and use
I had use GCM service on my app , I did my code after
I' ve decided to use push notifications on GCM.What are the types of android

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.