I found a solution for this issue, when you recieve sms and app is in background "using android sms consent api react native" or using firebase recaptcha it's getting crashed
so the solution is
Please correct me if i am wrong
useEffect(() => {
const handleAppStateChange = (nextAppState) => {
if (
appState.current.match(/inactive|background/) &&
nextAppState === 'active'
) {
// App has come to the foreground
handleOnStartUserConsentMessageListener();
receiveVerificationSMS ((error, message) => {
if (error) {
// handle error
console.log("SMS CONSENT error",error);
} else {
let code = retrieveVerificationCode(message);
setOtp(code);
}
});
setIsBackground(false);
} else if (appState.current === 'active' && nextAppState.match(/inactive|background/)) {
// App has gone to the background
setIsBackground(true);
}
appState.current = nextAppState;
};
AppState.addEventListener('change', handleAppStateChange);
return () => {
AppState.removeEventListener('change', handleAppStateChange);
};
}, []);
I found a solution for this issue, when you recieve sms and app is in background "using android sms consent api react native" or using firebase recaptcha it's getting crashed
so the solution is
Please correct me if i am wrong