In my app, Can I check that which app is being used by a user right now, while my app is running in background? If so, Is there any API available to get that info?
thanks in advance!
In my app, Can I check that which app is being used by a user right now, while my app is running in background? If so, Is there any API available to get that info?
thanks in advance!
Copyright © 2021 Jogjafile Inc.
No. There's no public API that lets you a background app find out about the foreground app, or get a list of running apps, or anything like that.
The only mechanism for finding out about other apps on the device is
+[UIApplication canOpenURL:]
, which you can use in some cases to find out whether a specific custom URL scheme can be handled. From that you can often guess that a particular app is installed, although the method really only tells you that some app that can handle the given scheme is installed. However, you still can't find out if that app is the foreground app, or even if it's running at all.