【问题标题】:TouchId doesn't support Iphone 7 react-nativeTouchId 不支持 Iphone 7 react-native
【发布时间】:2017-05-26 13:40:09
【问题描述】:

我用 react-native 做了一个 TouchId 认证的例子,但是这个显示“TouchId is not supported

有人遇到过同样的问题吗?

我的设备是一个模拟器。但是当我在真实设备上运行它时,问题是一样的。

有功能

  _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')
          }
      }
  }

【问题讨论】:

    标签: ios iphone react-native react-native-ios touch-id


    【解决方案1】:

    几个月前我已经解决了这个问题。 plist 文件中缺少权限。

    【讨论】:

    • 意味着问题出在设备配置上还是您添加了权限?
    • plist 文件中缺少权限。 @Sagar
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-08-28
    • 1970-01-01
    • 1970-01-01
    • 2018-10-07
    • 1970-01-01
    相关资源
    最近更新 更多