Is there any way to detect whether a device has a case and screen protector on it?

134 Views Asked by At

I know this might be a stupid question, but can we detect whether an iPhone device has a case and screen protector on it in code?

2

There are 2 best solutions below

2
On

I don’t think so. Screen protectors and cases are made with sensors in mind, so they don’t interfere with proximity sensors cameras, or microphones, which I think is the only way we have to know if there’s something on the phone.

Battery cases, or lightning accessories are something else though, but I don’t think you are talking about those.

2
On

Enable the microphone and then vibrate the device. If you have a baseline idea of how the audio frequency looks without a bumper, then you can diff that against what you record.

Typically, the cases are made out of materials like silicone that reduce the intensity of the vibration sound.