Home > Software engineering >  Apple Watch Integration for Authenticating Prompts in Swift/Objective-C Apps
Apple Watch Integration for Authenticating Prompts in Swift/Objective-C Apps

Time:06-06

I'm trying to figure out how to authenticate a prompt (in macOS), via an Apple Watch, for an application. Something similar to the behavior of Finder when authenticating while the "Use your Apple Watch to unlock this Mac" setting is toggled.

I have been trying to figure out how to do this for a bit and can't find any documentation from Apple, or any articles regarding this.

Short code examples and API documentation is helpful!

CodePudding user response:

I think you want to use the Local Authentication framework. While it seems to be focused primarily on iOS, you will find that one of the LAPolicy options is deviceAuthenticationWithWatch. You could also use deviceAuthenticationWithWatchOrBiometrics if you want to support Touch ID if the Mac has it, or use deviceOwnerAuthentication to also allow the system password. Note that if you use deviceOwnerAuthentication it will use the password for the computer, not the password for your app

There are first steps on the Apple documentation. Hope this helps!

  • Related