Swift

Erstellen Sie Ihre Vonage Applikation

In diesem Schritt erstellen Sie eine Vonage Applikation die für In-App Messaging-Kommunikation geeignet sind.

Öffnen Sie ein neues Terminalfenster und erstellen Sie ein Projektverzeichnis an einem Ort Ihrer Wahl und wechseln Sie dorthin:

mkdir vonage-tutorial cd vonage-tutorial

Erstellen Sie eine Vonage-Anwendung, indem Sie den unten stehenden Befehl kopieren und in das Terminal einfügen:

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

Nachdem Ihre Vonage Application erstellt wurde, aktualisieren Sie Ihre CLI Auth mit der Application ID und dem 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 über Ereignisse in Ihrer Konversation können an Ihre rtc-event-url. Wir werden sie in diesem Tutorial nicht verwenden, verwenden Sie also einfach eine Beispiel-URL mit diesem Befehl, um RTC in Ihrer Vonage Application zu aktivieren. Stellen Sie sicher, dass Sie die Vonage Application ID im Befehl durch die zuvor erstellte ID ersetzen:

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

HINWEIS: Informationen zu Ihrer Bewerbung, einschließlich der Bewerbungs-ID, finden Sie auch in der Dashboard.