I created a function in react-native that looks like this one
static async myFunction(){
await RNSFAuthenticationSession.getSafariData(url,scheme).then(async (callbackUrl) => {
const isValid = await MyClass.checkIfValid(data);
if (isValid) {
return true;
} else {
return false;
}
}
and I am calling it in this way
const isValid = await MyClass.myFunction();
alert(isValid); // undefined
isValid
contains an undefined
value. Do you know how can I fix this?