0

I have a problem in understanding the following methods...I have two works to done. identify when user play home button and second is to identify when application was interrupted by phone call.

 - (void)applicationWillResignActive:(UIApplication *)application ;
 - (void)applicationDidEnterBackground:(UIApplication *)application;
Kumar sonu
  • 535
  • 11
  • 24

3 Answers3

1

See this handy webpage and the flowcharts there:

http://www.cocoanetics.com/2010/07/understanding-ios-4-backgrounding-and-delegate-messaging/

Basically, you don't get told the reason for being backgrounded (phone call versus home button), but in some circumstances you might be able to glean what happened (e.g. appWillResignActive followed by appDidBecomeActive happens when a phone call was refused) -- however I'd be very wary about attaching interpretations to such things.

occulus
  • 16,959
  • 6
  • 53
  • 76
1

You need to implement AVAudioSessionDelegate

There are methods for beginInterruption and endInterruption

By the time the beginInterruption arrives, your audio has already stopped. Your application may be suspended or terminated following an interruption—for example, if a user chooses to take an incoming phone call

Waqas Raja
  • 10,802
  • 4
  • 33
  • 38
  • +1 thank you for the answer not exactly but it really helped me to go to near to my answer....because my app access data from website and without coming back to foreground it is not possible to start buffering again – Kumar sonu Mar 22 '11 at 11:26