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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T20:55:17+00:00 2026-05-20T20:55:17+00:00

I have something fairly simple I want to do. I attach a custom piece

  • 0

I have something fairly simple I want to do. I attach a custom piece of data to some push notifications that I handle in

-(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions

I look for the UIApplicationLaunchOptionsRemoteNotificationKey and hey presto there it is.

That method only gets called if my app is being launched for the first time. How do I read that same key if my application is running in the background already when the notification comes in and the user pressed the ‘View’ button on the notification? I want to send them to a particular view controller with that data open on it, the same as I do if the app is being launched for the first time from the notification.

  • 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-20T20:55:18+00:00Added an answer on May 20, 2026 at 8:55 pm

    Check out application:didReceiveRemoteNotification:fetchCompletionHandler: in iOS 7 and later.


    The method application:didReceiveRemoteNotification: is called if your app is running in the foreground. It also is called if your app is running in the background and the user engages with your push notification (thus making your app active).

    So, the real question is how to determine if the app was in the foreground or if it was made active by the user engaging with your push notification.

    It looks like this answer to the question didReceiveRemoteNotification when in background has the key:

    You can tell whether your app was just brought to the foreground or not in application:didReceiveRemoteNotification: using this bit of code:

    - (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo
    {
        if ( application.applicationState == UIApplicationStateActive )
            // app was already in the foreground
        else
            // app was just brought from background to foreground
        ...
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a fairly simple iPhone application that I want to have run on
I want to do something that seems fairly simple. I get results but the
I'm trying to do something that is fairly simple, but my code looks terrible
I'm fairly new to jquery and struggling with something that should be fairly simple.
I have a fairly simple script but something is going wrong and I can't
I have a fairly simple expression parser that uses the Linq.Expression namespace. Input is
I have something here that is really catching me off guard. I have an
Is it possible to have something like a JTextArea which will color some keywords
I have a fairly simple question concerning NSString however it doesn't seem to do
This is a fairly simple case. I have an xml document, linked to an

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.