5

I need to implement an app that monitors keyboard activity i.e. which app is using keyboard on 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.

I can use private api as my client doesn't need this app on appstore. iPhone is non-jailbroken. Thanks.

virata
  • 1,882
  • 15
  • 22
  • I don't think it's possible to do something besides voip or location services in background continuously. Altough you mentioned you won't be putting it in appstore, it violates apple's rules for background tasks. – basar Dec 26 '12 at 15:48

1 Answers1

0

Im not aware of any private API do to this continuously and in background, and as already said Apple wouldn't like it either.

The only thing you can do, is monitor changes in a UITextField in your own app using
[[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.

Using this method would of course be a documented way (UITextField Class Reference).

foebe
  • 359
  • 7
  • 17