![]() ![]() For example, this dialog appears the first time you try to authenticate on a Touch ID device: The prompt will be slightly different the first time you request authentication for the app. On a device with Touch ID or Face ID you will get a prompt to authenticate. ![]() In the app, tap the button to request authentication. In that menu, choose Enrolled to activate the appropriate sensor. In the Features menu you’ll see an option for Face ID or Touch ID, depending on the type of Simulator you are running. You can now run this in the Simulator which actually has a way for you to test authentication. Add this code to its Pressed event: Authenticator.Request("Please verify yourself.", _Īuthenticator.SensorType = )įor devices with Face ID, you’ll also want to go to the Capabilities Editor (click on iOS Build Settings and choose the Advanced tab in the Inspector) to enable User Authentication and click Options to enter a custom message prompt. The button will be used to ask for authentication. TextArea1.Text = "Error:" + EndOfLine.iOS + error.Message + EndOfLine + _ Put this code in the Error event to indicate the failure: Label1.Text = "Local Authentication" The Error event is called should the touch, face or password not be valid. Put this code in the event to indicate that: Label1.Text = "Local Authentication" The AuthenticationSucceeded event is called when the authentication request succeeds due to a valid touch, face or password. On Authenticator, add the AuthenticationSucceeded and Error events. Also add a Button, a Label and a TextArea. It will appear in the tray area at the bottom. In an iOS project, add a UserAuthentication object to your screen and change its name to Authenticator. With the new UserAuthentication class available in Xojo 2021 Release 1, you can now easily ask an iOS user to authenticate themselves using Face ID, Touch ID or with their password/passcode. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |