/ SDKs / Flutter
SDKs
Chat SDKs Flutter v3
Chat SDKs Flutter
Chat SDKs
Flutter
Version 3
Sendbird Chat SDK v3 for Flutter is no longer supported as a new version is released. Check out our latest Chat SDK v4

Retrieve a channel by URL

Copy link

Since a channel URL is a unique identifier of a channel, you can use a URL when retrieving a channel object. We recommend that you store a user's channel URLs to handle the lifecycle or state changes of your app as well as any other unexpected situations. For example, when a user is disconnected from the Sendbird server by temporarily switching to another app, you can provide a smooth restoration of the user's state once the user has returned to your app by using the stored URL to fetch the appropriate channel instance.

try {
    final channel = await channel.getChannel(channelUrl); // Channel can be openChannel or groupChannel.
    // Through the channel parameter of the callback method, 
    // the channel object identified with channelUrl is returned by the Sendbird server.
    // You can also get the channel's data from the result object.
} catch (e) {
    // Handle error.
}

List of properties

Copy link
Property nameTypeDescription

channelUrl

String

Specifies the URL of the channel to retrieve.