IOS proximity sensor

I am developing an application that requires the proximity sensor to work continuously at runtime.

I put this code in the application delegate:

[UIApplication sharedApplication].idleTimerDisabled = YES;

[UIDevice currentDevice].proximityMonitoringEnabled = YES;

The problem is that after a short period of time, even if the sensor is closed, the diplay indicator lights up.

I tried using third-party applications that use the sensor, and the display remains dark.

Does anyone know how to fix this? thanks

+6
source share

Source: https://habr.com/ru/post/956314/


All Articles