Programmatically detect which iOS application is v

2019-05-17 05:06发布

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

1条回答
forever°为你锁心
2楼-- · 2019-05-17 05:41

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.

查看更多
登录 后发表回答