以编程方式检测用户可见的iOS应用程序 [英] Programmatically detect which iOS application is visible to user

查看:45
本文介绍了以编程方式检测用户可见的iOS应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我发现 this ,但问题是该问题的答案并未提出(我也首先对其进行了测试),而且已经存在了一年多.

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.

基本上:

我试图找出当前在iOS设备上对用户可见(并打开)的应用程序. 它必须可以在库存设备(非越狱)上运行,而不必担心应用商店.

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.

我现在正在查看私有API,但似乎无法确定如何通知(或询问)有关将新应用程序发布到前台的我的应用程序.

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.

谢谢

推荐答案

感谢问题的评论部分中的@JohnWoods,我能够找到相关问题的解决方案.

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.

这篇关于以编程方式检测用户可见的iOS应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆