Skip to content

Commit cdaf60d

Browse files
committed
Do not init Yubikey if device does not support MFI accessory
1 parent 9ec7073 commit cdaf60d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

passKit/Helpers/YubiKeyConnection.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,10 @@ public class YubiKeyConnection: NSObject {
1818

1919
override init() {
2020
super.init()
21-
YubiKitManager.shared.delegate = self
22-
YubiKitManager.shared.startAccessoryConnection()
21+
if YubiKitDeviceCapabilities.supportsMFIAccessoryKey {
22+
YubiKitManager.shared.delegate = self
23+
YubiKitManager.shared.startAccessoryConnection()
24+
}
2325
}
2426

2527
public func connection(cancellation: @escaping (_ error: Error) -> Void, completion: @escaping (_ connection: YKFConnectionProtocol) -> Void) {

0 commit comments

Comments
 (0)