0

In my music app i am allow background to work too.

And i noticed that in this order of actions the app stop playing music: In the app the user press the lock screen -> then he get msg in sms or whatsapp.... and then he slide the msg notification to open the msg app.

There is any method that i can get notification when the user made this actions?

I am using already:

- (void)applicationDidEnterBackground:(UIApplication *)application

and this notify me when the user press the lockscreen button.

YosiFZ
  • 7,792
  • 21
  • 114
  • 221

2 Answers2

1

When a notification appears on screen, you should get -applicationWillResignActive:. (This also happens if the user locks the device, gets a phone call, or a number of other things.) If the user dismisses the notification and returns to your app, you should get -applicationDidBecomeActive:. Unfortunately, there's no way to tell what's going on with another app's push notifications beyond that.

However, I'm not sure you're barking up the right tree here. If you're having trouble with other apps interrupting your audio, this Stack Overflow post may point you to some resources that can help.

Community
  • 1
  • 1
Becca Royal-Gordon
  • 17,541
  • 7
  • 56
  • 91
  • I get the notification after i lock the screen so `applicationWillResignActive` trigger when i lock the screen – YosiFZ May 30 '13 at 09:44
0

Check out this link... Here you can get a list of the background processes running in your device. With that you may be able to check if message app is running or not.

Community
  • 1
  • 1
prince
  • 854
  • 2
  • 9
  • 36