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 digital camera to find out total common luminance (mild/darkness) of the digital camera view as a proxy for detecting when one thing is obstructing the sensor area… however my use case requires avoiding use of the digital camera.
I’ve tried utilizing the proximity sensor (proximityState), however each time proximity monitoring is energetic, the display screen 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 permitted analysis examine purposes solely.
Are there different public iOS APIs that use sensors or capabilities I’m not conscious of — resembling ARKit, or one thing else that would match the invoice right here? Making an attempt to keep away from it as a lot as ew can… however will we have to fall again to utilizing the camra? Thanks!