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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T21:44:00+00:00 2026-06-12T21:44:00+00:00

I know applicationWillResignActive will be called when you tap the Home button or the

  • 0

I know “applicationWillResignActive” will be called when you tap the Home button or the Sleep/Wake button. And it is also called when an interruption(like a native call) occurs. But how can I indentify which one result in this method and do some different implement?

  • 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-12T21:44:02+00:00Added an answer on June 12, 2026 at 9:44 pm

    You cannot directly identify all reasons, but you can narrow it down a little bit.

    If the home button is pressed and the application is sent to background, your app will receive a applicationDidEnterBackground: call on your UIApplicationDelegate. Note that you will receive this after the applicationWillResignActive: call, so it may not help you.

    You could also register a listener for Audio Interruption

    AudioSessionInitialize (
                            NULL,                          // 'NULL' to use the default (main) run loop
                            NULL,                          // 'NULL' to use the default run loop mode
                            audioSessionInteruptionListener,  // a reference to your interruption callback
                            self                       // data to pass to your interruption listener callback
                            );
    

    If audioSessionInteruptionListener is invoked and the state is kAudioSessionBeginInterruption before applicationWillResignActive:, then you know that the interruption is caused by a Phone Call or the Alarm. I do not think that you can have more information.

    EDIT

    Actually, I think that you can go even a little further and identify a Phone Call vs Alarm interruption. Now this has not been tested, it is simply to give a starting point for more investigation.

    I remember having a callback registered to trap audio routes, and when a phone call was received, the audio routed changed from Speaker/Earphone to None to Receiver. So I guess that you could trap the AudioInterruption using the method descrived above, and trap the audio route change. If the audio route becomes Receiver, then the interruption was a phone call. Otherwise, it was something else, like the alarm.

    I was targetting iOS 5.0, so it may not be available for prior versions, you would have to confirm with the doc.

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

Sidebar

Related Questions

I know that -applicationWillResignActive gets called upon an incoming call, but is there a
I know that Phonegap has an event for back button, but it's only available
Anyone know how I can make a login button in Ruby on Rails for
I know the input have the maxlength, but I would like to have minlength
I need to determine when an incoming phone call arrives. I know that applicationWillTerminate
I'd like to know what's happening behind the scenes when the user locks and
I know the title is not great but I think the code will come
I know that I can do something like $int = (int)99; //(int) has a
I know that when iphone application goes to background, these methods are called: -
Know this might be rather basic, but I been trying to figure out how

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.