joinPresentation static method
Future<Widget?> ?
joinPresentation(
- String callToken,
- PresentationSettings presentationSettings, {
- required dynamic onSuccess(
- Widget? callingWidget
- required dynamic onError(
- CometChatCallsException excep
Join Presentation mode.
callToken
: The call token.presentationSettings
: The Presentation Settings object.onSuccess
: A callback function that is called when the call session is successfully started.onError
: A callback function that is called when an error occurs while starting the call session.
Example: CometChatCalls.startSession( callToken: '<YOUR_CALL_TOKEN>', callSettings: <YOUR_CALL_SETTINGS>, onSuccess: (callingWidget) { // The call session was successfully started. }, onError: (error) { // An error occurred while starting the call session. }, );
Implementation
static Future<Widget?>? joinPresentation(
String callToken, PresentationSettings presentationSettings,
{required Function(Widget? callingWidget) onSuccess,
required Function(CometChatCallsException excep) onError}) async {
try {
final callingViewWidget = await CometchatcallsPluginPlatform.instance
.joinPresentation(
callToken, presentationSettings, onSuccess, onError);
return callingViewWidget;
} catch (e) {
CometChatCallsUtils.showLog(
"CometChatCall", "startSession: error: ${e.toString()}");
onError(CometChatCallsException(
"Error", "Unable to start call session", e.toString()));
}
return null;
}