I’m seeking to detect when an object is obstructing the entrance sensor area on an iPhone. I’ve recognized a possible resolution that makes use of the front-facing digicam to find out total common luminance (mild/darkness) of the digicam view as a proxy for detecting when one thing is obstructing the sensor area… however my use case requires avoiding use of the digicam.
I’ve tried utilizing the proximity sensor (proximityState), however at any time when proximity monitoring is lively, the display mechanically turns off. This gained’t work for my use case, sadly.
I’ve additionally found the technique of accessing the ambient mild sensor (ambientLightSensor), nevertheless it seems to be restricted for accepted analysis research functions solely.
Are there different public iOS APIs that use sensors or capabilities I’m not conscious of — similar to ARKit, or one thing else that might match the invoice right here? Attempting to keep away from it as a lot as ew can… however will we have to fall again to utilizing the camra? Thanks!