iosiphonereact-nativereact-native-iostouch-id

TouchId doesn't support Iphone 7 react-native


I'm made an example of TouchId authentication with react-native, but this display "TouchId is not supported"

Anyone has been the same problem?

my device is an emulator. But when I run this in a real device the problem is the same.

There are the functions

  _isSupported = async () => {
      try {
          await TouchId.isSupported()
          Alert.alert('TouchId is supported!')
      } catch(e) {
          Alert.alert('TouchId is not supported!')
      }
  }

  _trggerTouchId = async () => {
      let description = 'Verify the existing mobile phone fingerprint using the home key'
      //let title       //fallback button title will be default as 'Enter Password'(localized) 
      //let title = ""  //fallback button will be hidden 
     let title = "Verify Password"   //fallback button title will be 'Verify Password'(unlocalized) 
     try {
          await TouchId.verify({
              description,
              title,
          });
          //await TouchId.verify("123123123123"); 
          Alert.alert('verify succeeded')
     } catch(e) {
          if (e.code == '-3') {
              //fallback button is pressed 
              Alert.alert('errorCode: ' + e.code + ' verify failed, user wants to ' + title)
          }
          else {
              Alert.alert('errorCode: ' + e.code + ' verify failed')
          }
      }
  }

Solution

  • I have resolved this problem months ago. The permissions were missing inside the plist file.