Jaka Jančar
Jaka Jančar

Reputation: 11606

Use proximity sensor without turning the screen off

This is a long shot, but does anyone know a way to avoid the automatic screen blanking when using the proximity sensor (UIDevice.proximityMonitoringEnabled & proximityState)?

Upvotes: 5

Views: 983

Answers (2)

Thinh Phan
Thinh Phan

Reputation: 301

You can use this trick to temporary disable screen turn off

 UIDevice *device = [UIDevice currentDevice];
 [device setProximityMonitoringEnabled:YES];

But current public API do not allow to use proximity sensor without blacking out the screen. Any one have solution for this?

Upvotes: 0

Brendan Miller
Brendan Miller

Reputation: 157

UIDevice only allows you to monitor the proximity sensor state and handle it within your app. You cannot control the blackening of the screen.

Upvotes: 1

Related Questions