setUpNativeStreamListener method
- String callToken,
- CallSettings? callSettings,
- PresentationSettings? presentationSettings,
- dynamic onSuccess(
- Widget callWidget
- dynamic onError(
- CometChatCallsException error
override
Implementation
@override
Future<bool> setUpNativeStreamListener(String callToken, CallSettings? callSettings, PresentationSettings? presentationSettings, onSuccess, onError) async {
try{
if(nativeStream == null){
this.callSettings = callSettings;
this.presentationSettings = presentationSettings;
globalCallListener = (callSettings == null) ? presentationSettings?.listener : callSettings.listener;
initializeCallsEventStream();
nativeStream?.listen((event) {
CometChatCallsUtils.showLog("CometChatCall", "nativeStream: value: ${event.toString()}");
});
return true;
}else{
this.callSettings = callSettings;
this.presentationSettings = presentationSettings;
globalCallListener = (callSettings == null) ? presentationSettings?.listener : callSettings.listener;
return true;
}
}catch(e){
CometChatCallsUtils.showLog("CometChatCall", "startSession: error: ${e.toString()}");
onError(CometChatCallsException(CometChatCallsConstants.codeError, "Unable to start call session", e.toString()));
}
return false;
}