Browse SDKs · Flutter
Platform
SDKsFlutterEnterprise

Get call room token

Retrieve media room access credentials by room ID using the OpenIM Flutter SDK.

Copy

When the roomID is already known, invoke this method to retrieve or refresh the access credentials required by the media engine:

Parameters

ParameterTypeRequiredDescription
roomIDStringYesTarget call room ID.

Code example

final credentials = await OpenIM.iMManager.signalingManager
    .signalingGetTokenByRoomID(roomID: roomID);

if (credentials.token?.isNotEmpty == true &&
    credentials.roomID?.isNotEmpty == true) {
  await mediaEngine.join(
    roomID: credentials.roomID!,
    token: credentials.token!,
    liveURL: credentials.liveURL,
  );
}

Return value

A successful Future returns a SignalingCertificate object containing credentials for joining the call room.

FieldTypeDescription
tokenString?Room authentication token required by the media engine.
roomIDString?Call room ID.
liveURLString?Live media streaming server URL.
busyLineUserIDListList<String>?List of user IDs currently busy on another line.

Connect to the RTC media engine only after obtaining a non-empty token and valid room credentials. If the token expires during a reconnection attempt, invoke this API again to acquire a refreshed credential.