how to determine which apps are background and which app is foreground on iOS by application id
Using the method described in this question , I can get a list of apps running on an iOS device. I know PIDs and have access to their kinfo_proc structures. How can I determine which are foreground processes and which are background (assuming my app is background)? I tried to find this out base on information in kinfo_proc (see 1st link), via kp_proc.p_priority , but it looks like it is not possible to infer background/foreground state from priority. I don't really care if this works correctly for AppStore Review but I would prefer a method that will work without a jailbreak(i.e. Private APIs