简体   繁体   English

是否有任何私人API可以监控iPhone上的键盘访问(哪个应用程序使用键盘,其访问时间等)?

[英]Is there any private api that can monitor keyboard access (which app is using keyboard,its access time etc) on iphone?

I need to implement an app that monitors keyboard activity ie which app is using keyboard on iPhone. 我需要实现一个监控键盘活动的应用程序,即哪个应用程序在iPhone上使用键盘。 no need to retrieve key pressed/data entered by that app using keyboard at all. 根本不需要使用键盘检索该应用输入的按键/数据。

my app is going to run in background using apple's background multitasking feature for voip and navigators. 我的应用程序将在后台使用苹果的背景多任务功能为voip和导航器运行。

I can use private api as my client doesn't need this app on appstore. 我可以使用私有api,因为我的客户端在appstore上不需要这个应用程序。 iPhone is non-jailbroken. iPhone是非越狱的。 Thanks. 谢谢。

Im not aware of any private API do to this continuously and in background, and as already said Apple wouldn't like it either. 我不知道任何私有API会持续不断地在后台进行,并且正如已经说过Apple也不喜欢它。

The only thing you can do, is monitor changes in a UITextField in your own app using 您唯一能做的就是使用自己的应用程序监视UITextField中的更改
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(textFieldDidChange:) name:UITextFieldTextDidChangeNotification object:nil]; .
In textFieldDidChange: you could then check how the contents of the UITextField changed, and from that you should be able to know what key was pressed. textFieldDidChange:然后您可以检查UITextField的内容是如何更改的,从中您应该能够知道按下了哪个键。

Using this method would of course be a documented way ( UITextField Class Reference ). 使用此方法当然是一种记录方式( UITextField类参考 )。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM