The error message “The user is not authenticated” indicates that the user is not currently authenticated with the Sendbird server. This error can occur when you try to deauthenticate a user who is not logged in or has already been logged out.
To resolve this issue, you should first check if the user is authenticated before calling the deauthenticate method. You can use the SendbirdCalls.isAuthenticated() method to check the authentication status of the user. Here’s an example of how you can modify your code:
if (SendbirdCalls.authenticated()) {
try {
await SendbirdCalls.deauthenticate();
} catch (error) {
console.error(`Logout error with error: ${error}`);
}
} else {
console.error("User is not authenticated");
}
By checking the authentication status before calling de-authenticate, you can prevent the error from occurring when the user is not authenticated.
Yes. it should check authenticate before deauthenticate .
But it seems does not exist this func isAuthenticated()
And could you give me the right way to authenticate Sendbird call.
Should we call await SendbirdCalls.authenticate(credential); everytime open app?
I am using react native.
SDK: “@sendbird/calls-react-native”: “1.0.2”,
Thank you @Chinmaya_Gupta
I call SendbirdCall.authenticate() after user logs in.
But some time i cannot received a call. I must logout then login again the call func will work.
Could you share me some step or right way to debug or find the problem.
Current implemention.
User Login → auth sendbird call → navigate to Home screen → Received a in comming call
User closed app → reopen again → open home screen → received a call in sometime.