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.
我在这里使用了解决方案来获取所有正在运行的进程的列表,但结构kinfo_proc属性似乎没有给出任何有用的检测用户当前可见的应用程序。
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.
我试图在iOS设备上找出用户当前可见(和打开)的应用程序。它必须适用于库存设备(非越狱),无需担心应用程序商店。
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.
编辑:我现在正在查看私有API,但似乎无法确定我的应用程序如何被通知(或查询)有关新应用程序被带到前面。
Thank you
谢谢
1 个解决方案
#1
1
Thanks to @JohnWoods in the comment section of the question, I was able to find the solution on a related question.
感谢@JohnWoods在问题的评论部分,我能够找到相关问题的解决方案。
The solution I used and that worked for me was here.
我使用的解决方案对我有用。
#1
1
Thanks to @JohnWoods in the comment section of the question, I was able to find the solution on a related question.
感谢@JohnWoods在问题的评论部分,我能够找到相关问题的解决方案。
The solution I used and that worked for me was here.
我使用的解决方案对我有用。