[Problem/Question]
// Detailed description of issue.
When executing the sb.connect() method, I am encountering the error: SendbirdError: There was a network error. for testing purposes.
The User ID and access token have been hardcoded from the Sendbird dashboard.
The process flow is such that the connect() method is executed after the init() method has completed.
// If problem, please fill out the below. If question, please delete.
[SDK Version]
- sendbird/chat 4.14.5
[Reproduction Steps]
// Please provide reproduction steps and, if possible, code snippets.
import SendbirdChat from '@sendbird/chat'
import { GroupChannelModule, type SendbirdGroupChat } from '@sendbird/chat/groupChannel'
:
class SendbirdClient {
private _sb: SendbirdGroupChat | undefined = undefined
:
public readonly init = () => {
const APP_ID = 'sendbird_app_id'
this._sb = SendbirdChat.init({
appId: APP_ID,
modules: [
new GroupChannelModule()
]
}) as SendbirdGroupChat
}
:
public readonly connect = (userId: string, authToken: string) => {
if (this._sb === undefined) {
throw new Error('Sendbird not initialized')
}
try {
const user = this._sb.connect(userId, authToken)
return user
} catch (error) {
console.error(error)
}
}
}
[Frequency]
// How frequently is this issue occurring?
[Current impact]
// How is this currently impacting your implementation?