Swift
Building the user model
To have a conversation you need to store some information about a user:
- A user's name
- A user's JWT
- Who they are chatting with
To do this you will use a Struct. Open the ViewController.swift file and add it below the class.
class ViewController: UIViewController {
...
}
struct User {
let name: String
let jwt: String
let callPartnerName: String
}
To make things easier for later on add some static properties on the User type for the users Alice and Bob. Replacing ALICE_USERID, ALICE_JWT, BOB_USERID, BOB_JWT with the values you created earlier.
struct User {
...
static let Alice = User(name: "Alice",
jwt:"ALICE_JWT",
callPartnerName: "Bob")
static let Bob = User(name: "Bob",
jwt:"BOB_JWT",
callPartnerName: "Alice")
}
Making an app to app voice call
You make a voice call from an iOS app to another iOS app
Steps
1
Introduction to this task2
Prerequisites3
Create a webhook server4
Create a Vonage Application5
Create the users6
Generate JWTs7
Xcode Project and Workspace8
Project permissions9
Building the log in interface10
Building the user model11
VGVoiceClient12
Building the call interface13
Receive a call14
Make a call15
What's next?