简体   繁体   English

Expo 本地身份验证指纹传感器在 IOS 中不起作用

[英]Expo Local Authentication Finger print sensor not working in IOS

I am using Expo Local Authentication finger print sensor in my 2 applications.我在我的 2 个应用程序中使用 Expo 本地身份验证指纹传感器。 Both these apps detecting finger print in android, but misbehaving in IOS.这两个应用程序都在 android 中检测到指纹,但在 IOS 中行为不端。 When I install both apps in IOS, the last installed IPA will detect the finger print sensor correctly, but the first installed IPA does not trigger the sensor and it does not even show any popup "Scan your finger.".当我在 IOS 中安装这两个应用程序时,最后安装的 IPA 将正确检测到指纹传感器,但第一个安装的 IPA 不会触发传感器,甚至没有显示任何弹出窗口“扫描您的手指。”。 But its all working in Android.但它都在 Android 中工作。

const signInTouch = async () => {

try{
  
  let result = await LocalAuthentication.authenticateAsync(
    {promptMessage:'Scan your finger.'}
  );
  console.log('Scan Result:', result);
  if(result.success){
    navigation.navigate('HomePage');
  }
  }
  catch(error){
    console.log(error);
    Alert.alert('error', error.toString());
  }

}

Okay finally I solved it.!!好的,我终于解决了。!! My both apps were using expo sdk 38 and react-native sdk 38. I just downgraded only one app to我的两个应用程序都在使用 expo sdk 38 和 react-native sdk 仅降级到 38。

“expo”: “^36.0.0”, “博览会”:“^36.0.0”,

“react-native”: “https://github.com/expo/react-native/archive/sdk-36.0.0.tar.gz” “react-native”:“https://github.com/expo/react-native/archive/sdk-36.0.0.tar.gz”

the other app still using sdk 39. and then I removed the node_modules and package-lock.json from the downgraded app.另一个应用程序仍在使用 sdk 39。然后我从降级的应用程序中删除了 node_modules 和 package-lock.json。

sudo rm -rf./node_modules && sudo rm -rf package-lock.json sudo rm -rf./node_modules && sudo rm -rf package-lock.json

and then I Installed new modules in it然后我在其中安装了新模块

npm i npm i

solved some compatible warning of libraries by doing通过做解决了一些库的兼容警告

expo install “Library name” expo 安装“库名称”

Built the app, and installed both apps and it worked.:.构建了应用程序,并安装了两个应用程序并且它工作正常。:. :) :)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM