Replies: 2 comments
-
I'm not aware of anyone who has done this - but, for the most part, it's not really a Rubicon question - it's an iOS question. A quick search for "Face ID API" reveals this documentation. From that, it's clear that the class that is needed is
The first thing it suggests are customising the cancel message - the syntax there is identical:
The next suggestion is evaluating a policy; that requires LAPolicy, which is an enum - so you use the constant directly
The constant can be found by looking in the iOS header files (grep for So - this question is a lot more about reading the iOS docs for "how do I use the iOS API", not Python specific questions (unless you've got a question about how to wrap a specific iOS API). |
Beta Was this translation helpful? Give feedback.
-
Thanks, I do have the LAContext docs, but I wasn’t able to get it working, as I don’t know ObjC or Rubicon, and was having trouble declaring and wrapping the types when doing the documented calls. I was just hoping maybe someone had gotten through this,
… On Jan 12, 2025, at 7:46 PM, Russell Keith-Magee ***@***.***> wrote:
I'm not aware of anyone who has done this - but, for the most part, it's not really a Rubicon question - it's an iOS question.
A quick search for "Face ID API" reveals this documentation <https://developer.apple.com/documentation/localauthentication/logging-a-user-into-your-app-with-face-id-or-touch-id?language=objc>. From that, it's clear that the class that is needed is LAContext; so:
from rubicon.objc import ObjCClass
LAContext = ObjCClass("LAContext")
context = LAContext()
The first thing it suggests are customising the cancel message - the syntax there is identical:
context.localizedCancelTitle = "Enter Username/Password"
The next suggestion is evaluating a policy; that requires LAPolicy, which is an enum - so you use the constant directly
LAPolicyDeviceOwnerAuthentication = <the constant...>
context.canEvaluatePolicy(LAPolicyDeviceOwnerAuthentication, None)
The constant can be found by looking in the iOS header files (grep for LAPolicyDeviceOwnerAuthentication in the directory returned by xcrun --show-sdk-path --sdk iphoneos). In this example, I've ignored error handling (passing in None for error).
So - this question is a lot more about reading the iOS docs for "how do I use the iOS API", not Python specific questions (unless you've got a question about how to wrap a specific iOS API).
—
Reply to this email directly, view it on GitHub <#553 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/A7IVDKYNKH4ILTNAHXJ6MHL2KMEE5AVCNFSM6AAAAABVBRDCO6VHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTCOBRGUYDKMA>.
You are receiving this because you authored the thread.
|
Beta Was this translation helpful? Give feedback.
-
Has anyone gotten biometrics (eg, FaceID) to work on Mac/iOS, with code you'd be willing to share?
Thank you
Beta Was this translation helpful? Give feedback.
All reactions