3

I found this and the problem is that the answers on that question didn't pan out (I also tested them first) and also that it is over a year old.

I've used the solution here to fetch the list of all running processes, but not of the struct kinfo_proc attributes seem to give any useful in detecting which app is currently visible to the user.

Basically:

I am trying to find out which app is currently visible (and open) to the user on iOS devices. It must work on stock devices (non-jailbroken) and no need to worry about the app store.

Edit: I am looking at the private APIs now, but cannot seem to determine how my app could be notified (or inquire) about a new application being brought to the front.

Thank you

Community
  • 1
  • 1
Dulax
  • 553
  • 3
  • 20
  • How do I go abouts figuring out the private APIs ? – Dulax Nov 25 '13 at 21:28
  • If it's in one of the SDK header files, it's public. If it's not, it's private. (I don't know what API @JohnWoods is referencing, though.) – Rob Napier Nov 26 '13 at 13:30
  • @JohnWoods thanks, turns out my question is a dup of [this](http://stackoverflow.com/questions/8252396/how-to-determine-which-apps-are-background-and-which-app-is-foreground-on-ios-by). Just searching 'SBFrontmostApplicationDisplayIdentifier' found that one. I'll look into it, thanks a bunch. – Dulax Nov 26 '13 at 13:57

1 Answers1

1

Thanks to @JohnWoods in the comment section of the question, I was able to find the solution on a related question.

The solution I used and that worked for me was here.

Community
  • 1
  • 1
Dulax
  • 553
  • 3
  • 20