Is it possible to turn off the display when monitoring proximity?

In loadView, I add myself as an observer for

[nc addObserver:self 
       selector:@selector(proximityAlert:)
           name:UIDeviceProximityStateDidChangeNotification
         object:device];

then I tell the device to start generating these alerts

[device setProximityMonitoringEnabled:YES];

and I process them in

-(void)proximityAlert:(NSNotification *)note

The problem is that when I close the sensor for too long, the screen turns off, which is not convenient in my application.

Thanks for all the answers.

+3
source share
1 answer

idleTimerDisablednot suitable for solving this issue. (Not moving away, as the comments below will be lost if I do this.)

0
source

All Articles