Swift

VGVoiceClient

Before you can place a call, the Client SDK needs to authenticate to the Vonage servers. The following additions are required to ViewController.swift.

NOTE: Notice that, you have already imported VGVoiceClient at the top of the file.

Add a VGVoiceClient instance, below the callButton.

Add the JWT

At the end of viewDidLoad, create a session - make sure to replace ALICE_JWT for the JWT you created during a previous step.

NOTE: The enableWebsocketInvites flag on the client configuration and the isUsingCallKit setting should not be used in production. Enable push notifications to make sure you get incoming calls even when your application is in the background using CallKit. See the push notifications guide for more information.

Build and Run

Cmd + R to build and run again:

Interface connected