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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T15:57:39+00:00 2026-05-16T15:57:39+00:00

I am using the notification system as an alerting mechanism. If the app is

  • 0

I am using the notification system as an alerting mechanism. If the app is off or in the background, the iphone alerts the user when a notification comes in. If the app is running and in the foreground I want to show the same alert view as if it was off. I cannot get this to work for the case where the app transitions from the background to the foreground. I end up seeing the alert twice if the the transition was due to a notification, or once if the user clicked the launch icon.

Is there any way to know whether the transition was due to a notification of due to the user clicking the launch icon?

Thanks.

  • 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-05-16T15:57:39+00:00Added an answer on May 16, 2026 at 3:57 pm

    This question provides the answer.

    Specifically, in the didReceiveRemoteNotification method you can check the state of the app. UIApplicationStateActive means it is in the foreground so you need to show the alert. Otherwise the Iphone will handle the alert:

    UIApplicationState state = [application applicationState];
    if (state == UIApplicationStateActive) {
        // Show the alert
     }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using a jQuery notification system who runs when the user click on
I would like to create a user notification system using emails. In context it
Possible Duplicate: javascript: pause setTimeout(); Im using jQuery and working on a notification system
When my notification goes off I want to restore the activity that was put
there's a freedesktop.org notification system using DBUS. Looks simple enough, but I just can't
I would like to implement a 'flag as inappropriate/abusive' notification system for my app,
I'm using a MPMoviePlayerController in my iPhone app to display some short video clips
I'm using velocity templates to generated plain-text emails for a notification system. I have
I have an iOS app using push notification but once in a while I'm
HI, I am trying to send a simple notification using system.net.mail.mailmessage. I just pass

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.