0

I am looking for a way to get notified about any user initiated touch event while my app is in background running state, I want to make it clear I don't want to handle gesture events or break UIResponder chain, some form of notification that user initiated a touch somewhere on the screen?

Ayush
  • 3,989
  • 1
  • 26
  • 34
Abhinav Singh
  • 7,880
  • 1
  • 23
  • 33
  • Not possible. Think about if the user has a passcode somehwere. You could record where they are tapping their fingers on the keyboard or whatever. iOS will not allow it. – Mike Weller May 03 '13 at 11:16
  • yes that would be very disturbing user experience, i just want to know if he is touching the screen not where or what ? – Abhinav Singh May 03 '13 at 11:41
  • @ Abhinav Singh : have you got the solution for this. I need similar kind of thing using any of the private API. I also don't have to submit it to the App Store. So if you found any solution for it then please share it. – Rachit Aug 27 '13 at 13:34
  • @Rachit: If you are open to using private API's and Jailbreaking, the mobileSubtrate library allows you to hook a process to the OS and thereby, get notifications for touch events before they are sent to the OS itself. Hooks are the standard way of detecting global mouse events in Windows as well. – Hrishikesh_Pardeshi Sep 02 '13 at 09:16
  • @Hrishikesh_Pardeshi : I am open to private API's as this is an enterprise application but not to Jailbeaking. So can i use mobileSubtrate library with non- jailbroken devices as well. Also can you look into this question as well posted by me: http://stackoverflow.com/questions/18530395/getting-notification-of-ios-device-usage-in-background – Rachit Sep 02 '13 at 12:50

2 Answers2

1

This isn't possible at all using the standard SDK. You would be able to record where the user is tapping in other applications and record what they are typing on the keyboard. This just isn't allowed. Only touches sent to your app can be intercepted and handled.

Mike Weller
  • 45,401
  • 15
  • 131
  • 151
  • Thanks for interest, yes i know that and i don't want to know where n what user is touching , i just want to know whether user is touching the screen? – Abhinav Singh May 03 '13 at 11:38
1

Not allowed. If an App is in the background it is only allowed to do few certain operations:-

  • Play music
  • Informing of their location at all times
  • Internet Protocol(VoIP)
  • Updates from external accessories

Must read section "App States and Multitasking" from Apple 's link below

http://developer.apple.com/library/ios/#documentation/iphone/conceptual/iphoneosprogrammingguide/ManagingYourApplicationsFlow/ManagingYourApplicationsFlow.html

"It will surely give you strong Foundation "

gagan sharma
  • 256
  • 1
  • 4
  • 18