I've got the proximity sensor working so that I can trigger events when in proximity, but I'm trying to use it as a sort of dead man switch. The problem is that whenever in proximity, the screen turns off, which drastically reduces the usability of the app :P Also, the proximity sensor doesn't seem to activate when in landscape mode (I can't see the flashing light in my camera). Is there any way to get around these standard events and methods?
Asked
Active
Viewed 979 times
5
-
Wow off topic but it means that when the user uncovers the sensor the application would become non-responsive until they cover it up again. – SeniorShizzle Feb 01 '11 at 04:08
-
Just curious, are you using private APIs in order to access the proximity sensor triggered events? Would you be happy providing any code? – gotnull Sep 08 '11 at 06:53
-
No it was a long time ago but no private APIs, the [UIDevice] class has a proximityState that you can check, and you have to enable proximity checking as well. It's all in Apple's UIDevice documentation. Sorry I couldn't find any specific code it was so long ago – SeniorShizzle Sep 29 '11 at 05:07
1 Answers
1
Your current UIDevice has a proximityState
property on it. May be useful.

zelk
- 607
- 6
- 15
-
Yeah that's how I got it to work in the first place, like I said, but it doesn't help anything else in the question – SeniorShizzle Sep 29 '11 at 05:05