/* * Initialize the Twilio Conversations SDK */ void initializeTwilioSdk() { TwilioConversations.SetLogLevel(TwilioConversations.LogLevel.Debug); if (!TwilioConversations.IsInitialized) { TwilioConversations.Initialize(ApplicationContext, new TwilioConversations.InitListener { InitHandler = () => { /* * Now that the SDK is initialized we create a ConversationsClient and register for incoming calls. */ // The TwilioAccessManager manages the lifetime of the access token and notifies the client of token expirations. accessManager = TwilioAccessManagerFactory.CreateAccessManager(accessToken, accessManagerListener()); conversationsClient = TwilioConversations.CreateConversationsClient(accessManager, conversationsClientListener()); // Specify the audio output to use for this conversation client conversationsClient.AudioOutput = AudioOutput.Speakerphone; // Initialize the camera capturer and start the camera preview cameraCapturer = CameraCapturerFactory.CreateCameraCapturer(this, CameraCapturerCameraSource.CameraSourceFrontCamera, previewFrameLayout, capturerErrorListener()); startPreview(); // Register to receive incoming invites conversationsClient.Listen(); }, ErrorHandler = err => { Toast.MakeText(this, "Failed to initialize the Twilio Conversations SDK", ToastLength.Long).Show(); } }); } }
public void OnIncomingInviteCancelled(IConversationsClient conversationsClient, IIncomingInvite incomingInvite) { InviteCancelledHandler?.Invoke(conversationsClient, incomingInvite); }
public void OnStopListeningForInvites(IConversationsClient conversationsClient) { StopListeningForInvitesHandler?.Invoke(conversationsClient); }
public void OnFailedToStartListening(IConversationsClient conversationsClient, TwilioConversationsException conversationException) { FailedToStartHandler?.Invoke(conversationsClient, conversationException); }