1
votes

On iOS, is it possible to get information about the sensors available (like accelerometer, magnetic, light, proximity, gyroscope, etc…)?

Is there any method like getSensorList(), getVendor(), getModel()?

1

1 Answers

1
votes

For the accelerometer, gyroscope and magnetometer, use a CMMotionManager.

For the proximity sensor, you can try to set the proximityMonitoringEnabled property on the current UIDevice to YES. Then check the proximityMonitoringEnabled property. If its YES, then the device has a proximity monitor, if its NO then it doesn't.

For the 'light', you are most likely interested in whether or not the device has a flash or a torch. AVCaptureDevice has the properties you are looking for.