2017-05-26 98 views
0

我做TouchId認證與反應原生的例子,但是這顯示「TouchId不支持TouchId不支持iPhone 7反應母語

任何人都一直同樣的問題?

我的設備是一個仿真器。但是當我在真實的設備上運行這個問題時,問題是一樣的。

有功能

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

回答

0

我有這個問題幾個月前得到解決。最後問題出在設備配置和TouchId的權限上。代碼很好。