# Fingerprint authentication in android and ios

**URL:** https://forums.fusetools.com/t/fingerprint-authentication-in-android-and-ios/3322
**Category:** How-to Discussions
**Created:** [April 21, 2017, 2:56pm UTC](https://forums.fusetools.com/t/fingerprint-authentication-in-android-and-ios/3322 "2017-04-21T14:56:15Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![qusyairi](https://avatars.discourse-cdn.com/v4/letter/q/b77776/32.png) [@qusyairi](https://forums.fusetools.com/u/qusyairi)
#### Post date: [April 21, 2017, 2:56pm UTC](https://forums.fusetools.com/t/fingerprint-authentication-in-android-and-ios/3322/1 "2017-04-21T14:56:15Z")

</div>

I am trying to search the forum on how to implement​ fingerprint authentication in fuse. Is there any js api that i can use?

---

<div class="post-metadata">

### Author: ![Uldis](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/uldis/32/657_2.png) [@Uldis](https://forums.fusetools.com/u/Uldis)
#### Post date: [April 21, 2017, 3:21pm UTC](https://forums.fusetools.com/t/fingerprint-authentication-in-android-and-ios/3322/2 "2017-04-21T15:21:36Z")

</div>

Hi qusyairi,

I’m afraid there are no JS wrappers created for fingerprint auth libraries at this point, at least I couldn’t find any. You are welcome to start a community effort of creating one.

---

<div class="post-metadata">

### Author: ![inod](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/inod/32/524_2.png) [@inod](https://forums.fusetools.com/u/inod)
#### Post date: [October 11, 2017, 6:10am UTC](https://forums.fusetools.com/t/fingerprint-authentication-in-android-and-ios/3322/3 "2017-10-11T06:10:09Z")

</div>

Hi all, I am interested in this topic and trying to develop it using foreign code. Are there any improvements within this five months? If you have any references or improvements, please inform here. Because these days I am working on it.

---

<div class="post-metadata">

### Author: ![Uldis](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/uldis/32/657_2.png) [@Uldis](https://forums.fusetools.com/u/Uldis)
#### Post date: [October 11, 2017, 8:41am UTC](https://forums.fusetools.com/t/fingerprint-authentication-in-android-and-ios/3322/4 "2017-10-11T08:41:21Z")

</div>

@inod: no, we have not seen any attempts at implementing this yet. Let us know how it goes!

---

<div class="post-metadata">

### Author: ![Bent](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/bent/32/157_2.png) [@Bent](https://forums.fusetools.com/u/Bent)
#### Post date: [October 11, 2017, 9:05am UTC](https://forums.fusetools.com/t/fingerprint-authentication-in-android-and-ios/3322/5 "2017-10-11T09:05:23Z")

</div>

I’d take a look at this blog post that Remi from the Fuse team wrote when he implemented another iOS specific feature (voice recognition) with Foreign Code: [https://blog.fusetools.com/fuse-foreign-speech-c4d888b505ec](https://blog.fusetools.com/fuse-foreign-speech-c4d888b505ec)

---

<div class="post-metadata">

### Author: ![SvenWS](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/svenws/32/325_2.png) [@SvenWS](https://forums.fusetools.com/u/SvenWS)
#### Post date: [October 11, 2017, 11:36am UTC](https://forums.fusetools.com/t/fingerprint-authentication-in-android-and-ios/3322/6 "2017-10-11T11:36:22Z")

</div>

There is a [cordova Fuse bridge](https://github.com/akalyan/fuse-cordova-bridge) which let you use cordova plugins. Maybe that fits in your case:

---

<div class="post-metadata">

### Author: ![inod](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/inod/32/524_2.png) [@inod](https://forums.fusetools.com/u/inod)
#### Post date: [October 12, 2017, 9:31am UTC](https://forums.fusetools.com/t/fingerprint-authentication-in-android-and-ios/3322/7 "2017-10-12T09:31:28Z")

</div>

Hi all, I think Cordova bridge only support for ios platform. As well as fingerprint authentication already has built for ios. [https://github.com/bolav/fuse-touchid/blob/master/iOSFingerPrint.uno](https://github.com/bolav/fuse-touchid/blob/master/iOSFingerPrint.uno)

In here, I am trying to do it with android platform. But I can’t give android permission. My error is,

```auto
Uno.Permissions.Permissions.Android does not contain a member called 'USE_FINGERPRINT'. Could you be missing a package reference?

```

The problem is fingerprint permission haven’t included fuse documentation under “What permissions are requestable by default?”

---

<div class="post-metadata">

### Author: ![Bent](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/bent/32/157_2.png) [@Bent](https://forums.fusetools.com/u/Bent)
#### Post date: [October 12, 2017, 9:35am UTC](https://forums.fusetools.com/t/fingerprint-authentication-in-android-and-ios/3322/8 "2017-10-12T09:35:17Z")

</div>

Did you take a look at the Android Permissions documentation? [https://www.fusetools.com/docs/native-interop/android-permissions](https://www.fusetools.com/docs/native-interop/android-permissions)

Or this related thread from the Forum? [https://www.fusetools.com/community/forums/howto\_discussions/removing\_unnecessary\_android\_permissions](https://www.fusetools.com/community/forums/howto_discussions/removing_unnecessary_android_permissions)

---

<div class="post-metadata">

### Author: ![inod](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/inod/32/524_2.png) [@inod](https://forums.fusetools.com/u/inod)
#### Post date: [October 12, 2017, 10:45am UTC](https://forums.fusetools.com/t/fingerprint-authentication-in-android-and-ios/3322/9 "2017-10-12T10:45:07Z")

</div>

When I tried with READ\_CALL\_LOG, It works properly.

Now I want to give the permission with USE\_FINGERPRINT.

Again I tried it manually, edited Manifest file and then run build.bat, installed apk, But It didn’t ask for permission on my device. I checked both ways.  
This is my template,

```auto
using Uno.Threading;
using Uno;
using Uno.UX;
using Uno.Compiler.ExportTargetInterop;
using Android;
using Uno.Permissions;

using Fuse;
using Fuse.Scripting;

[extern(Android) ForeignInclude(Language.Java,     
                        "android.content.Intent", 
                        "android.content.Context", 
                        "android.os.Bundle",
                        "android.content.SharedPreferences",
                        "android.os.Handler",
                        "android.hardware.fingerprint.FingerprintManager",
                        "java.lang.Object"
                         )]

[UXGlobalModule]
public class fingerAndroid : NativeModule{
    static readonly fingerAndroid _instance;
    static string getPermission;
    
    public fingerAndroid(){
        if (_instance != null) return;
    	_instance = this;
    	Resource.SetGlobalKey(_instance, "fingerAndroid");
        AddMember(new NativeFunction("fingerPrintAuth",(NativeCallback)fingerPrint));
    }

    object fingerPrint(Context c, object[] args){
        var permissionPromise = Permissions.Request(Permissions.Android.USE_FINGERPRINT);
        permissionPromise.Then(OnPermitted, OnRejected);
        return getPermission;
        //fingerPrintImpl();
        //return null;
    }

    void OnPermitted(PlatformPermission permission)
     {
          debug_log "Access to the fingerprint Scanner!";
          getPermission = fingerPrintImpl();
     }

     void OnRejected(Exception e)
     {
         debug_log "Blast: " + e.Message;
     }

    [Foreign(Language.Java)]
    public static extern(Android) string fingerPrintImpl()
    @{
    android.util.Log.d("Inside the fingerPrintImpl", "Started!");
    return null;
    //My Code will goes here
    @}

    static extern(!Android) string fingerPrintImpl(){
        debug_log("Notifications not supported on this platform.");
        return null;
    }

}

```

---

<div class="post-metadata">

### Author: ![Uldis](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/uldis/32/657_2.png) [@Uldis](https://forums.fusetools.com/u/Uldis)
#### Post date: [October 12, 2017, 11:00am UTC](https://forums.fusetools.com/t/fingerprint-authentication-in-android-and-ios/3322/10 "2017-10-12T11:00:40Z")

</div>

@inod: when looking at [Android docs](https://developer.android.com/about/versions/marshmallow/android-6.0.html#fingerprint-authentication), it seems that you should NOT be requesting this permission during run-time (which `Uno.Permissions` is used for), but instead simply add it to your manifest as an install-time permission. The forum thread that Bent linked shows you how.
