LAContext应用程序扩展中的Touch ID键盘
我正在尝试添加touchid以解锁自定义键盘扩展的受密码保护部分。LAContext应用程序扩展中的Touch ID键盘
当我这个代码添加到UIInputViewController自定义键盘的扩展,它会产生一个运行时错误
let authContext = LAContext()
的错误是:
2015-09-01 22:18:50.524 AS_Custom_KB[21508:2656253] plugin com.example.AS-Custom-KB.AS-Custom-KeyBoard interrupted 2015-09-01 22:18:50.545 AS_Custom_KB[21508:2656253] plugin com.example.AS-Custom-KB.AS-Custom-KeyBoard invalidated 2015-09-01 22:18:51.635 AS_Custom_KB[21508:2656082] viewServiceDidTerminateWithError:: Error Domain=_UIViewServiceInterfaceErrorDomain Code=3 "The operation couldn’t be completed. (_UIViewServiceInterfaceErrorDomain error 3.)" UserInfo=0x174273f80 {Message=Service Connection Interrupted}
相同的代码工作正常,在模拟器上,但由于模拟器不支持TouchID,因此不会执行任何操作。该代码也适用于调节器应用程序(而不是自定义键盘扩展)。
我尝试过浏览LAContext文档,但没有找到任何有关它为什么会导致这样的错误或任何有关不能从扩展中使用它的信息。
有关为什么会发生这种情况的任何想法,或者如何从自定义键盘扩展中获得此工作?有没有人能够从自定义键盘扩展中获得touchid工作?
[R & d的24小时后,我找到了答案我自己,我发现答案很简单,设置
设置RequestsOpenAccess
是在NSExtensionAttributes
我这样做你说。但它并没有起作用。错误:'initWithExistingContext - >(null),错误域= NSCocoaErrorDomain代码= 4099“与名为com.apple.CoreAuthentication.daemon的服务连接失效。它适合你吗?我想在我的键盘扩展中使用Touch ID。我在iOS 11中测试它。 – kai