The proximity sensor may be the way to go, but the range is pretty small. Still, less complicated than using the camera, and if someone is seeking this kind of app, I doubt they’d want to “cheat” by only pushing up 10cm, haha. Could place the phone under your chest instead of face too.
Seconded 👍 took me a bit to setup correctly, but there are lots of guides out there.