Swift

Overview

Give your app the application ID, session ID, and token it needs to join a Vonage Video session. Observability only works after the client is connected and subscribed—you need valid credentials first.

Setting Up Authentication

To connect to a Vonage Video session, the client needs three values:

Credential Purpose
Application ID Identifies your Vonage Video project
Session ID Identifies the room (session) to join
Token Authenticates this client for that session

In production, your backend should generate session IDs and tokens using a Server SDK. For this tutorial, hard-code them in VonageVideoManager.swift:

Replace the empty strings with values from your Vonage account:

Note: In production applications, they are retrieved from the server more info. For this demo, you can either deploy a Video Learning Server (Node or PHP) and set serverURL or follow the next steps to generate and hardcode them. To get the credentials needed to run the demo:

  • Sign up for or Log into your account.
  • In the left-side menu of the dashboard, click Applications and select a previous application or create a new one to view the Application ID. Screenshot of dashboard with Applications highlighted

Screenshot of dashboard with Application ID highlighted

  • Make sure that Video is activated

Screenshot of dashboard with Video section highlighted

  • Head over to the The Video API Playground. Either enter the Application ID or find it in the dropdown. You can leave the default values for the other options. Click "Create".

Screenshot of The Video API Playground tool

  • Your Session ID and Token will be created.

Screenshot of The Video API Playground tool generated details with the Application ID, Session ID, and Token highlighted in red boxes

Important: You can generate session IDs and tokens from your account during testing, but before production you must move credential generation to a server. See Video API technical details.