React-native-keychain: In Release build[not able to retrieve data through Keychain.getGenericPassword]

Created on 23 Oct 2020  路  1Comment  路  Source: oblador/react-native-keychain

Hi Team,

This module is working fine in debug mode, but when i tried in released ipa or even in archived ipa(same with android) it is saving the data but at the time of retrieving the data it is given an error, every time it is going in catch of Keychain.getGenericPassword and giving below error(attached image) :

IMG_7715

React Native version : 0.62
react-native-keychain version : 6.2.0

Below is my code

const setKeychainPassword = async(SSOID,accessTokenExpirationDate,refreshToken) => {
try{
await Keychain.resetGenericPassword({service: "userOfflineAuth"});
}catch (error) {
console.log(error)

}

await Keychain.setGenericPassword('BiometricAuthSsoId',JSON.stringify({sub:SSOID,accessTokenExpirationDate:accessTokenExpirationDate,refreshToken:refreshToken}),{
service: 'userOfflineAuth',
accessControl: Keychain.ACCESS_CONTROL.BIOMETRY_ANY_OR_DEVICE_PASSCODE,
accessible: Keychain.ACCESSIBLE.WHEN_PASSCODE_SET_THIS_DEVICE_ONLY,
}).then(function(success) {
console.log(success);
}).catch(function(error) {

console.log(error);
});

export const getKeychainPassword = async(props) => {

await Keychain.getGenericPassword({
service: 'userOfflineAuth',
accessControl: Keychain.ACCESS_CONTROL.BIOMETRY_ANY_OR_DEVICE_PASSCODE,
authenticationPrompt : {
cancel :'Offline',
title : 'Authenticate for offline login'
}
}).then(result =>{
console.log(result);
}).catch(error => {
console.log(error)
});

}

Please help me out guys.I'm totally stuck with my app live.
Thanks in Advance.

Most helpful comment

I am also facing same issue.

>All comments

I am also facing same issue.

Was this page helpful?
0 / 5 - 0 ratings