Reputation: 192
I am trying to add touchid to unlock a password protected section of a custom keyboard extension.
When I add this code to the UIInputViewController for the custom keyboard extension, it generates a runtime error
let authContext = LAContext()
The error is:
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}
The same code works fine on the simulator, but doesn't do anything as the simulator doesn't support TouchID. The code also works fine in a regualar app (and not a custom keyboard extension).
I have tried looking through the LAContext documentation, but didn't find anything about why it might cause an error like this, or any info about not being able to use it from an extension.
Any ideas about why this might be happening, or how to get this working from a custom keyboard extension? Has anyone been able to get touchid working from a custom keyboard extension?
Upvotes: 3
Views: 696
Reputation: 192
After 24hours of R&D I found a answer my self, I found answer very simple and settings
Set RequestsOpenAccess
Yes in your NSExtensionAttributes
Upvotes: 3