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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T05:34:57+00:00 2026-06-10T05:34:57+00:00

How do you handle a push differently in Titanium depending on whether the app

  • 0

How do you handle a push differently in Titanium depending on whether the app was open at the time the push arrived?

When a push notification comes in and my app is running, I would like to pop up a message offering to take the user to the item the notification refers to. If the app is closed, and the user taps on the push notice and causes the app to open, I would like to take the user directly to the item without a popup.

Titanium’s registerForPushNotifications seems to only have one callback, “callback”, which is called regardless of the app’s state when the push arrives. According to How do I tell if my iPhone app is running when a Push Notification is received? you can use didReceiveRemoteNotification and didFinishLaunchingWithOptions in Objective C, but Titanium doesn’t seem to provide separate access to those.

  • 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-10T05:34:58+00:00Added an answer on June 10, 2026 at 5:34 am

    The ‘callback’ function will get fired right after ‘resume’ if user comes from a notification.

    So I would handle your case the following way:

    have a variable to track wether app is paused or not (a la var is_paused = false; when running).
    is_paused would be switched to true upon Ti.App ‘pause’ event and switched back to false state with a timeout (1second will do) upon Ti.App ‘resume’ event.

    Then you can have different functionality in callback function by checking if is_paused var is true or false:

    //in notification callback
    if(is_paused){ 
       //user is coming from background (do your thing automatically)
    }else{
      //user is in app (display the alert)
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to handle a return result from an AsyncTask outside of the
I handle commands inside a RoutedCommand class that implements RoutedUICommand. This would help me
How would one go about detecting a page refresh / F5 key push on
Is there anyone using git in such a fashion? I would like to distribute
I'm working on event handling in C++ and to handle notification of events, I
My app is now receiving push notifications from two different PHP scripts on our
I'd like to use python to build an app that is similar to zeroMQ
I'm writing a little notification server to push data to a client. The basic
I would like to maintain a pidlist array of children I have forked and
To Handle the error in my web application I am Creating a log file

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.