Shakeel
Shakeel

Reputation: 574

Is there a way to detect the running app, while my app is in the background in ios?

I need to detect the running application when my ios app is in the background. Basically I need to know if the user launched the Safari app?

Is there any way to do this? as I know when an app is in background, it may suspended or it could do only a minimal of things. Any help is very much appreciated.

Upvotes: 1

Views: 215

Answers (3)

LJ Wilson
LJ Wilson

Reputation: 14427

One caveat is that within your app, you can test for another app being available:

- (BOOL)canOpenURL:(NSURL *)url

This can tell you whether the current device has a specific application installed IF that application is setup to handle url schemes for launching from another app.

Apple's Docs

Upvotes: 2

Ankit Srivastava
Ankit Srivastava

Reputation: 12405

you can only detect if your app is going to the background, no info is available regarding others apps.

Upvotes: 2

Eimantas
Eimantas

Reputation: 49354

No, there is no such way. Anything you're trying to know outside the scope of your app is forbidden by Apple.

Upvotes: 1

Related Questions