React native 如何使用React Native在密钥链中设置GenericPassword?

React native 如何使用React Native在密钥链中设置GenericPassword?,react-native,keychain,React Native,Keychain,使用下面的代码,不知怎么的,它停止了阅读,我陷入了没有解决方案的困境。因此,我尝试使用react native keychain设置GenericPassword,但函数中的console.log消息我可以看到,后面的消息看不到。因此,dispatch()不会直接调用catch() 知道这里出了什么问题吗 return axios.post(SIGNUP_URL, { email, password }).then((response) => { var { user_id, toke

使用下面的代码,不知怎么的,它停止了阅读,我陷入了没有解决方案的困境。因此,我尝试使用
react native keychain
设置GenericPassword,但函数中的console.log消息我可以看到,后面的消息看不到。因此,
dispatch()
不会直接调用
catch()

知道这里出了什么问题吗

return axios.post(SIGNUP_URL, { email, password }).then((response) => {
  var { user_id, token } = response.data;
  Keychain.setGenericPassword(user_id, token, console.log('I can see this'));
  console.log('I can not see this');
  dispatch(authUser(user_id));
}).catch((error) => {
  dispatch(addAlert("Could not sign up."));
});

我不确定调用函数时,您试图用
console.log('I can see this')
语句实现什么。你能发布什么
error
ur进入
catch
block吗?@PrasunPal with console.log我正在检查代码是否生成。正如您在catch块中看到的,错误是“无法注册”。因此,如上所述,一旦我关闭Keychain函数,其他行将被跳过,直到.catch frunction您可以在
Keychain.setGenericPassword
之前打印
console.log()
,总之,您在
error
中得到的值是多少,错误
无法注册
由您定义,我要的是value
error
@prasupal
undefined不是对象(评估'RNKeychainManager.setGenericPasswordForOptions')
这是我从
error