I need to know if an Apple Watch user has a passcode set before we can show sensitive data in a View.
Is there a way to check for this?
LAPolicy is unavailable on the Watch and I cannot check deviceOwnerAuthenticationWithWatch from a paired phone only from a Mac.
Is there a way to check for this?
LAPolicy is unavailable on the Watch and I cannot check deviceOwnerAuthenticationWithWatch from a paired phone only from a Mac.
Eskimo, thank you so much for the suggestion. With that I think I'm now on the right track.
I have the following options set when adding the item to the keychain:
and have
in the attributes for SecItemCopyMatching
On my own watch with passcode on I get the "User interaction is not allowed" error, which seems correct.
I didn't see that in the simulator where the passcode cannot be set - that shows "No error."
I need to verify with passcode off on a device but this looks really promising. Thank you
I have the following options set when adding the item to the keychain:
Code Block swift let flag = SecAccessControlCreateFlags.userPresence let sacResult = SecAccessControlCreateWithFlags(kCFAllocatorDefault, kSecAttrAccessibleWhenPasscodeSetThisDeviceOnly, flag, &error)
and have
Code Block swift kSecUseAuthenticationUI as String: kSecUseAuthenticationUIFail
in the attributes for SecItemCopyMatching
On my own watch with passcode on I get the "User interaction is not allowed" error, which seems correct.
I didn't see that in the simulator where the passcode cannot be set - that shows "No error."
I need to verify with passcode off on a device but this looks really promising. Thank you