Find out if iOS device has autofocus camera using phonegap
题
I've added a plugin to scan barcodes in our app and right now I'm checking the device model number (ie iPhone4,1) to see if it is a newer device that has an autofocus camera. This will of course either require us to add new devices everytime they come out or we'll forget to do it and the users won't be able to scan barcodes even though they should be able to.
What I would like to do is check to see if the device has an autofocus camera, and use that to allow or deny the users to try to scan barcodes. Anyone know how?
解决方案
You could use isFocusModeSupported
from the AVCaptureDevice
class in iOS.
Documentation is under 'Focus settings' here:
不隶属于 StackOverflow