Swift

Create your Vonage Application

In this step you will create a Vonage Application capable of in-app messaging communication use cases.

Open a new terminal window and create a project directory in a destination of your choice and change into it:

mkdir vonage-tutorial cd vonage-tutorial

Create a Vonage application by copying and pasting the command below into terminal:

vonage apps create 'Your application'

✅ Creating Application
Saving private key ... Done!
Application created

Name: Your application
Application ID: 00000000-0000-0000-0000-000000000000
Improve AI: Off
Private/Public Key: Set

Capabilities:
  None Enabled
vonage apps create 'Your application'

✅ Creating Application
Saving private key ... Done!
Application created

Name: Your application
Application ID: 00000000-0000-0000-0000-000000000000
Improve AI: Off
Private/Public Key: Set

Capabilities:
  None Enabled
vonage apps create 'Your application' ✅ Creating Application Saving private key ... Done! Application created Name: Your application Application ID: 00000000-0000-0000-0000-000000000000 Improve AI: Off Private/Public Key: Set Capabilities: None Enabled

Now that your Vonage Application has been created, update your CLI auth with the Application ID and Private Key:

vonage auth set `
--local `
--api-key='your-api-key' `
--api-secret='your-api-secret' `
--app-id='your-application-id' `
--private-key=C:\path\to\private.key

API Key: your-api-key
API Secret: your-**************
App ID: your-application-id
Private Key: Is Set

✅ Checking API Key Secret
✅ Checking App ID and Private Key
vonage auth set ^
--local ^
--api-key='your-api-key' ^
--api-secret='your-api-secret' ^ 
--app-id='your-application-id' ^
--private-key=C:\path\to\private.key

API Key: your-api-key
API Secret: your-**************
App ID: your-application-id
Private Key: Is Set

✅ Checking API Key Secret
✅ Checking App ID and Private Key
vonage auth set \ --local \ --api-key='your-api-key' \ --api-secret='your-api-secret' \ --app-id='your-application-id' \ --private-key=/path/to/private.key API Key: your-api-key API Secret: your-************** App ID: your-application-id Private Key: Is Set ✅ Checking API Key Secret ✅ Checking App ID and Private Key

Webhooks about events in your conversation can be sent to your rtc-event-url. We will not be using them in this tutorial, so just use a sample URL with this command to enable RTC on your Vonage Application. Make sure to replace the Vonage Application ID in the command with the one you created earlier:

vonage apps capabilities update 00000000-0000-0000-0000-000000000000 messages `
  --messages-inbound-url='https://example.com/messages/inboud' `
  --messages-status-url='https://example.com/messages/status' `
  --messages-version='v1' `
  --no-messages-authenticate-media
  
✅ Fetching Application
✅ Adding messages capability to application 00000000-0000-0000-0000-000000000000

Name: Your application
Application ID: 00000000-0000-0000-0000-000000000000
Improve AI: Off
Private/Public Key: Set

Capabilities:
  MESSAGES:
    Authenticate Inbound Media: Off
    Webhook Version: v1
    Status URL: [POST] https://example.com/messages/status
    Inbound URL: [POST] https://example.com/messages/inboud
vonage apps capabilities update 00000000-0000-0000-0000-000000000000 messages ^
  --messages-inbound-url='https://example.com/messages/inboud' ^
  --messages-status-url='https://example.com/messages/status' ^
  --messages-version='v1' ^
  --no-messages-authenticate-media
  
✅ Fetching Application
✅ Adding messages capability to application 00000000-0000-0000-0000-000000000000

Name: Your application
Application ID: 00000000-0000-0000-0000-000000000000
Improve AI: Off
Private/Public Key: Set

Capabilities:
  MESSAGES:
    Authenticate Inbound Media: Off
    Webhook Version: v1
    Status URL: [POST] https://example.com/messages/status
    Inbound URL: [POST] https://example.com/messages/inboud
vonage apps capabilities update 00000000-0000-0000-0000-000000000000 rtc \ --rtc-event-url='https://example.com/webhooks/rtc/fallback' ✅ Fetching Application ✅ Adding rtc capability to application 00000000-0000-0000-0000-000000000000 Name: Your application Application ID: 00000000-0000-0000-0000-000000000000 Improve AI: Off Private/Public Key: Set Capabilities: RTC: Event URL: [POST] https://example.com/webhooks/voice/rtc Uses Signed callbacks: Off

NOTE: Information about your application, including the Application ID, can also be found in the Dashboard.