SendbirdChat connect issue

[Problem/Question]
Hi,
I have some issue about SendbirdChat connect functions.
I checked the users in my app dashboard and I could check issued token.
but I can’t connect that user using code as below.
"
await SendbirdChat.connect(‘userId’);
"

They just said, InvalidAccessTokenException…

how can I solve this problem?

Thx.

// If problem, please fill out the below. If question, please delete.
[SDK Version]
sdk version is “sendbird_chat_sdk: ^4.0.0”

Hello @taewookim

Welcome to the Sendbird community!

It seems like you are trying to connect to the Sendbird server using just the user ID, but the server is expecting an access token or a session token for authentication. Make sure you have issued an access token or a session token for the user and pass it as an argument to the authToken parameter of the SendbirdChat.connect() method.

Here’s an example of how to connect to the Sendbird server using the Flutter SDK:


// Connect to the Sendbird server with a user ID and an access token
String userId = 'user123';
String accessToken = 'your_access_token';

try {
  await SendbirdSdk().connect(userId, accessToken);
  // The user is connected to the Sendbird server.
} catch (e) {
  // Handle error.
}

Make sure to replace user123 with the actual user ID and your_access_token with the actual access token issued for the user. If you are using a session token instead of an access token, replace accessToken with sessionToken in the code above.

If you are still having issues, please provide more details about your implementation and the error message you are receiving.

Thx for the answer.

but, Can I get the access token in code (not the sendbird dashbord).

I research for that, and I can find the SendbirdClient package.

but I can’t use these package…

How can I use SendbirdClient package?