{"id":13710144,"url":"https://github.com/JimmyPun610/Plugin.XF.TouchID","last_synced_at":"2025-05-06T18:34:12.252Z","repository":{"id":97499210,"uuid":"174469124","full_name":"JimmyPun610/Plugin.XF.TouchID","owner":"JimmyPun610","description":"This is the library for Xamarin Form to use Biometric ID to do the local authentication","archived":false,"fork":false,"pushed_at":"2022-03-25T10:01:26.000Z","size":1613,"stargazers_count":18,"open_issues_count":0,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-11-06T22:52:16.331Z","etag":null,"topics":["biometric-authentication","faceid","faceid-authentication","fingerprint","fingerprint-authentication","touch","touchid","touchid-authentication","xamarin-form","xamarin-forms"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JimmyPun610.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-03-08T04:29:34.000Z","updated_at":"2024-05-03T19:58:33.000Z","dependencies_parsed_at":"2023-04-18T12:47:55.383Z","dependency_job_id":null,"html_url":"https://github.com/JimmyPun610/Plugin.XF.TouchID","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JimmyPun610%2FPlugin.XF.TouchID","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JimmyPun610%2FPlugin.XF.TouchID/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JimmyPun610%2FPlugin.XF.TouchID/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JimmyPun610%2FPlugin.XF.TouchID/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JimmyPun610","download_url":"https://codeload.github.com/JimmyPun610/Plugin.XF.TouchID/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224521564,"owners_count":17325257,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["biometric-authentication","faceid","faceid-authentication","fingerprint","fingerprint-authentication","touch","touchid","touchid-authentication","xamarin-form","xamarin-forms"],"created_at":"2024-08-02T23:00:52.315Z","updated_at":"2024-11-13T20:31:13.410Z","avatar_url":"https://github.com/JimmyPun610.png","language":"C#","funding_links":[],"categories":["Plugins"],"sub_categories":[],"readme":"# Plugin.XF.TouchID\r\nThis project provides a easy way to call biometric authentication (Face / Fingerprint) function in Xamarin Forms\r\n\r\n### Support\r\n#### Android 6 - 12 TouchID (Target API Level 31)\r\n#### iOS 10+ FaceID and TouchID\r\n\r\n### Release notes\r\n#### Version 2.2\r\n1. Add Support to Android 12\r\n\r\n### Nuget installation\r\n#### Install to your Xamarin Project\r\n```\r\nInstall-Package Plugin.XF.TouchID\r\n```\r\n\r\n#### Build Status\r\n##### Android [![Build status](https://build.appcenter.ms/v0.1/apps/2aaea9c6-9358-481a-90aa-8d1f8cbaf0b7/branches/master/badge)](https://github.com/JimmyPun610/Plugin.XF.TouchID)\r\n##### iOS \u003cimg src=\"https://build.appcenter.ms/v0.1/apps/eb178c96-9250-4851-a39c-c0be77943142/branches/master/badge\"\u003e\r\n\r\n### iOS Guide\r\n1. In AppDelegate.cs\r\n```C#\r\n   global::Xamarin.Forms.Forms.Init();\r\n   LoadApplication(new App());\r\n   //Init the library\r\n   Plugin.XF.TouchID.TouchID.Init();\r\n   return base.FinishedLaunching(app, options);\r\n```\r\n2. In your info.plist, add face id permission request\r\n```\r\n\u003ckey\u003eNSFaceIDUsageDescription\u003c/key\u003e\r\n\u003cstring\u003eNeed your face to unlock secrets!\u003c/string\u003e\r\n```\r\n\r\nFaceID | TouchID\r\n------ | -----\r\n\u003cimg src=\"https://github.com/JimmyPun610/Plugin.XF.TouchID/blob/master/Screenshots/iOSFace.PNG?raw=true\" width=\"200\"\u003e | \u003cimg src=\"https://github.com/JimmyPun610/Plugin.XF.TouchID/blob/master/Screenshots/iOSTouch.png?raw=true\" width=\"200\"\u003e\r\n\r\n### Android Guide\r\n\r\n1. Set TargetFramework as Android10.0 (Q) API Level 29\r\n\r\n2. In MainActivity\r\n```C#\r\n   global::Xamarin.Forms.Forms.Init(this, savedInstanceState);\r\n   Xamarin.Essentials.Platform.Init(this, savedInstanceState);\r\n   //Init the library\r\n   //Use secret key, please use a unique keyname\r\n   Plugin.XF.TouchID.TouchID.Init(this, \"plugin.xf.touchid.fingerprintkey\");\r\n   //If you do not want to use secret key\r\n   //Plugin.XF.TouchID.TouchID.Init(this);\r\n   LoadApplication(new App());\r\n```\r\n\r\n```C#\r\n   protected override void OnActivityResult(int requestCode, Result resultCode, Intent data)\r\n   {\r\n        Plugin.XF.TouchID.TouchID.OnKeyguardManagerResult(data, requestCode, resultCode);\r\n        base.OnActivityResult(requestCode, resultCode, data);\r\n   }\r\n```\r\n\r\n3. Manifest.xml add Fingerprint permission\r\n```xml\r\n\u003cuses-permission android:name=\"android.permission.USE_FINGERPRINT\" /\u003e\r\n\u003c!--Android 9+--\u003e\r\n\u003cuses-permission android:name=\"android.permission.USE_BIOMETRIC\"/\u003e\r\n```\r\n\r\nAndroid 6-8 | Android 9+\r\n------ | -----\r\n\u003cimg src=\"https://github.com/JimmyPun610/Plugin.XF.TouchID/blob/master/Screenshots/Android6.png?raw=true\" width=\"200\"\u003e | \u003cimg src=\"https://github.com/JimmyPun610/Plugin.XF.TouchID/blob/master/Screenshots/Android9.png?raw=true\" width=\"200\"\u003e\r\n\r\n### Use in Xamarin Forms\r\n\r\n#### Check the device availabilities \r\n```c#\r\n//    Support = 0,\r\n//    DeviceNotSecured = 1,\r\n//    NotEnrolledFinger = 2,\r\n//    HardwareNotSupport = 3,\r\n//    OSVersionNotSupport = 4,\r\n   Plugin.XF.TouchID.TouchIDStatus possible = Plugin.XF.TouchID.TouchID.IsFingerprintAuthenticationPossible());\r\n```\r\n\r\n#### Prompt Security page for user to enroll finger or add passcode\r\n```c#\r\n   Plugin.XF.TouchID.TouchID.PromptSecuritySettings();\r\n```\r\n\r\n#### Do the authentication\r\n\r\n##### Use passcode / pin for alternative authentication (Android only, iOS default allowed)\r\n```C#\r\n\tvar dialogConfig = new Plugin.XF.TouchID.DialogConfiguration(dialogTitle: \"Sign In\", //Display in Android only\r\n                                                                         dialogDescritpion: \"Detect you biometic to auth\", //Display on Android and iOS(TouchID)\r\n                                                                         successAction: () =\u003e\r\n                                                                         {\r\n                                                                             //Will fired when authentication success\r\n                                                                             Device.BeginInvokeOnMainThread(() =\u003e\r\n                                                                             {\r\n                                                                                 DisplayAlert(\"Congratulation\", \"You pass the authentication\", \"OK\");\r\n                                                                             });\r\n                                                                         },\r\n                                                                         alterAuthButtonText: \"Use PIN\", //Display in Android only\r\n                                                                         fingerprintDialogConfiguration: new Plugin.XF.TouchID.FingerprintDialogConfiguration\r\n                                                                         {\r\n                                                                             //For Android 6-8 only\r\n                                                                             FingerprintHintString = \"Touch Sensor\",\r\n                                                                             FingerprintNotRecoginzedString = \"Not regonized\"\r\n                                                                         },\r\n                                                                         failedAction: () =\u003e\r\n                                                                         {  \r\n                                                                             //For Android 6-8 only\r\n                                                                             Device.BeginInvokeOnMainThread(() =\u003e\r\n                                                                             {\r\n                                                                                 DisplayAlert(\"Alert\", \"Too many unsuccessful attempt, please try again later\", \"OK\");\r\n                                                                             });\r\n                                                                         });\r\n\r\n   await Plugin.XF.TouchID.TouchID.Authenticate(dialogConfig);\r\n```\r\n##### Use customized action as alternative (Android only, iOS default use password)\r\n```C#\r\n  var dialogConfig = new Plugin.XF.TouchID.DialogConfiguration(dialogTitle: \"Sign In\", //Display in Android only\r\n                                                                         dialogDescritpion: \"Detect you biometic to auth\", //Display on Android and iOS(TouchID)\r\n                                                                         successAction: () =\u003e\r\n                                                                         {\r\n                                                                             //Will fired when authentication success\r\n                                                                             Device.BeginInvokeOnMainThread(() =\u003e\r\n                                                                             {\r\n                                                                                 DisplayAlert(\"Congratulation\", \"You pass the authentication\", \"OK\");\r\n                                                                             });\r\n                                                                         },\r\n                                                                         customizedAction: new Plugin.XF.TouchID.CustomizedAction(\"Cancel\", () =\u003e\r\n                                                                         {\r\n                                                                             //Android Only\r\n                                                                             Device.BeginInvokeOnMainThread(() =\u003e\r\n                                                                             {\r\n                                                                                 DisplayAlert(\"Alert\", \"You cancel the authentication\", \"OK\");\r\n                                                                             });\r\n                                                                         }),\r\n                                                                         fingerprintDialogConfiguration: new Plugin.XF.TouchID.FingerprintDialogConfiguration\r\n                                                                         {\r\n                                                                             //For Android 6-8 only\r\n                                                                             FingerprintHintString = \"Touch Sensor\",\r\n                                                                             FingerprintNotRecoginzedString = \"Not regonized\"\r\n                                                                         },\r\n                                                                         failedAction: () =\u003e\r\n                                                                         {\r\n                                                                             //For Android 6-8 only\r\n                                                                             Device.BeginInvokeOnMainThread(() =\u003e\r\n                                                                             {\r\n                                                                                 DisplayAlert(\"Alert\", \"Too many unsuccessful attempt, please try again later\", \"OK\");\r\n                                                                             });\r\n                                                                         });\r\n\tawait Plugin.XF.TouchID.TouchID.Authenticate(dialogConfig);\r\n```\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJimmyPun610%2FPlugin.XF.TouchID","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FJimmyPun610%2FPlugin.XF.TouchID","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJimmyPun610%2FPlugin.XF.TouchID/lists"}