naoufal / react-native-touch-id

React Native authentication with the native Touch ID popup.

Home Page:https://www.npmjs.com/package/react-native-touch-id

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

android does not show passcode

matwming opened this issue · comments

commented

This package works great on ios with touch ID, face ID and passcode.
On android, the touch ID also works if touch ID is enabled.
BUT, when touch ID on android is not enabled, unlike ios, it will not give users an option to enter passcode. It throws "Touch ID Error".
Is it possible to show a passcode on android when touch ID is not enabled?
Many thanks.
This is my package.json info:

"@react-native-community/async-storage": "1.5.0",
 "axios": "0.18.0",
 "eslint-plugin-react": "7.13.0",
 "eslint-plugin-react-native": "3.7.0",
 "fundebug-reactnative": "^0.1.1",
 "lodash": "4.17.11",
 "moment": "2.24.0",
 "native-base": "2.12.1",
 "react": "16.8.3",
 "react-native": "0.59.8",
 "react-native-checkbox": "2.0.0",
 "react-native-document-picker": "https://github.com/Elyx0/react-native-document-picker.git#v3",
 "react-native-easy-grid": "0.2.1",
 "react-native-fs": "2.13.3",
 "react-native-gesture-handler": "1.2.2",
 "react-native-htmlview": "0.14.0",
 "react-native-image-picker": "0.27.2",
 "react-native-image-placeholder": "1.0.14",
 "react-native-modal": "11.0.2",
 "react-native-passcode-auth": "^1.0.0",
 "react-native-splash-screen": "3.0.6",
 "react-native-svg": "9.4.0",
 "react-native-svg-charts": "5.2.0",
 "react-native-touch-id": "^4.4.1",
 "react-native-typescript-transformer": "^1.2.12",
 "react-native-vector-icons": "6.4.2",
 "react-navigation": "3.11.0",
 "react-redux": "6.0.1",
 "redux": "4.0.1",
 "redux-thunk": "2.3.0",
 "styled-components": "4.3.1",
 "tcomb-form-native": "0.6.20",
 "tcomb-json-schema": "0.3.2",
 "typescript": "^3.5.2"

I agree, I'm having a similar issue, all I want to do is just detect if the users android device has touchID for changing out text.

commented

Hi Galimpian,
I think you can easily detect whether users enable touchID on android.
If a user does not enable touch ID, this package will throw an error, you just need to catch the error and change the error message to string using toString(), and check if it includes 'Touch ID Error' by includes(), and you can do anything you like such as changing text.
.catch(err=>{ if(err.toString().includes('Touch ID Error')){ // do anything you like here } })
Do not forget use Platform api from react native to to make sure the user is actually on android platform

@matwming are you saying that currently the user has to have the touchId enabled on their phone in order to see if isSupported() to work? Because iOS behavior is perfect and detects touchID/FaceID whether the user has enabled it or not. Currently I can confirm that only be enabling Fingerprint in a Android Device do I see the isSupported() give me a true but I just want to know if the device just supports it in general.