public void OnEvent(SdkEvent sdkEvent) { if (sdkEvent.Event.Equals("Connected")) { Connected?.Invoke(this); } else if (sdkEvent.Event.Equals("ConnectionFailed")) { ConnectionFailed?.Invoke(this, sdkEvent.GetEventArgs <ConnectionFailedEventArgs>()); } else if (sdkEvent.Event.Equals("Disconnected")) { Disconnected?.Invoke(this); } else if (sdkEvent.Event.Equals("LoginSuccess")) { LoginSuccess?.Invoke(this, sdkEvent.GetEventArgs <LoginSuccessEventArgs>()); } else if (sdkEvent.Event.Equals("LoginFailed")) { LoginFailed?.Invoke(this, sdkEvent.GetEventArgs <LoginFailedEventArgs>()); } else if (sdkEvent.Event.Equals("RefreshTokenSuccess")) { RefreshTokenSuccess?.Invoke(this, sdkEvent.GetEventArgs <RefreshTokenSuccessEventArgs>()); } else if (sdkEvent.Event.Equals("RefreshTokenFailed")) { RefreshTokenFailed?.Invoke(this, sdkEvent.GetEventArgs <RefreshTokenFailedEventArgs>()); } else if (sdkEvent.Event.Equals("OneTimeKeyGenerated")) { OneTimeKeyGenerated?.Invoke(this, sdkEvent.GetEventArgs <OneTimeKeyGeneratedEventArgs>()); } else if (sdkEvent.Event.Equals("IncomingCall")) { var eventArgs = sdkEvent.GetEventArgs <IncomingCallEventArgs>(); eventArgs.Call = GetIncomingCall(eventArgs.callId); IncomingCall?.Invoke(this, eventArgs); } else { Debug.LogError($"Unknown Event '{sdkEvent.Event}'"); } }
public void OnEvent(SdkEvent audioManagerEvent) { if (audioManagerEvent.Event.Equals("AudioDeviceChanged")) { var eventArgs = audioManagerEvent.GetEventArgs <AudioDeviceChangedEventArgs>(); AudioDeviceChanged?.Invoke(this, eventArgs); } else if (audioManagerEvent.Event.Equals("AudioDevicesListChanged")) { var eventArgs = audioManagerEvent.GetEventArgs <AudioDeviceListChangedEventArgs>(); AudioDevicesListChanged?.Invoke(this, eventArgs); } else if (audioManagerEvent.Event.Equals("AudioDeviceUnavailable")) { var eventArgs = audioManagerEvent.GetEventArgs <AudioDeviceUnavailableEventArgs>(); AudioDeviceUnavailable?.Invoke(this, eventArgs); } else { Debug.LogError($"Unexpected Event {audioManagerEvent.Event}"); } }