Detect app (process) state is currently running on iOS using sysctl

465 Views Asked by At

Is it possible at runtime to detect the state of the running processes (apps) in iOS? I would like to know if the currently running apps are running in background or foreground? Is that even possible. I've been trying for a week now to find a solution but I'm stock now.

I would appreciate any help.

Thanks

1

There are 1 best solutions below

4
On

I think the only way you can do this is by calling [[UIApplication sharedApplication] canOpenURL:] and passing in a URL with a URLScheme of a specific app.

For example:

[[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"comgoogleearth://test"]]

If this returns YES, then we can assume that the google earth app is installed.

This would only be able to tell you if specific apps were installed on the device...

Hope this is of some use to you! :)