How to check support of Touch ID, Face Id ,Password and pattern lock in React-Native

后端 未结 3 1604
有刺的猬
有刺的猬 2020-12-18 23:08

I have implemented a react-native-fingerprint-scanner, it\'s working for Touch Id.

Now I wanted to add authentication for Touch ID,

3条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-18 23:30

    TouchID.isSupported()
          .then(biometryType => {
            // Success code
            if (biometryType === 'FaceID') {
              console.log('FaceID is supported.');
            } else if (biometryType === 'TouchID'){
              console.log('TouchID is supported.');
            } else if (biometryType === true) {
              // Touch ID is supported on Android
        }
          })
          .catch(error => {
            // Failure code if the user's device does not have touchID or faceID enabled
            console.log(error);
          });
    

提交回复
热议问题