NiklasMerz / cordova-plugin-fingerprint-aio

Cordova Plugin for fingerprint sensors (and FaceID) with Android and iOS support
https://www.npmjs.com/package/cordova-plugin-fingerprint-aio
MIT License
323 stars 188 forks source link

'Switch must be exhaustive' error when building for iOS #476

Open danemco opened 8 months ago

danemco commented 8 months ago

When building for iOS, I get the error: "switch must be exhaustive" in the Fingerprint swift file.

My solution was to add the opticID case to the list:

 if #available(iOS 11.0, *) {
                switch(authenticationContext.biometryType) {
                case .none:
                    biometryType = "none";
                case .touchID:
                    biometryType = "finger";
                case .faceID:
                    biometryType = "face";
                case .opticID:
                    biometryType = "optic";
                }
            }
Crecket commented 8 months ago

https://github.com/NiklasMerz/cordova-plugin-fingerprint-aio/blob/master/src/ios/Fingerprint.swift#L55 Fixed in >v5 at least

minduch commented 1 month ago

Yep, this seems to do the trick, but needs documentation... This issue exists for Xcode 16 and e.g. Swift version 6 (in main project code, I don't know how a plugin can handle Swift code versions).