Skip to content

Audio and Video Calls iOS App

Ajša Terko edited this page Jan 1, 2024 · 1 revision

The Audio and Video Calls Showcase App demonstrates the use of the Infobip RTC iOS SDK. It highlights features like:

  • making WebRTC calls (used to connect two WebRTC endpoints),
  • making phone calls (used to call a phone number and connect it to a WebRTC endpoint),
  • making room calls (used to join several endpoints to a single room),
  • utilizing the camera video and screen sharing capabilities,
  • managing the audio quality and the input/output audio devices,
  • reconnecting when in a room call and the connection is interrupted, and more.

For developers seeking seamless integration, code samples are readily available in Swift.

1. (Prerequisite) Running the Token App

The prerequisite to running any Showcase Apps is running the Token App, available in both Node.js and Java.

Token App - Node.js: Guidance

Create config.json file in the ./token/node project directory, and fill it with data:

{  
  "HTTP_PORT": 8080,
  "INFOBIP_API_HOST": "api.infobip.com",
  "INFOBIP_RTC_TOKEN_PATH": "/webrtc/1/token",
  "INFOBIP_API_KEY": "YOUR_API_KEY"
}

Then in the ./token/node project directory:

  • install needed dependencies by running:
npm install
  • start the application by running:
npm start
Token App - Java: Guidance

Export the INFOBIP_API_KEY environment variable and set it to your Infobip API key.

In the ./token/java project directory, start the application by running:

mvn spring-boot:run

2. (Optional) Enabling the push notifications

Note that the creation of the WebRTC push configuration is NOT required if your mobile app will only support making the outbound calls and is not expected to receive inbound calls.

In order to enable push notifications, it is necessary to create a WebRTC push configuration. For more information on the creation of a push configuration, please refer to the corresponding API documentation.

Once you have a push configuration id, make sure to edit the Config.swift file replacing the pushConfigId with the correct one:

struct Config {
    static let pushConfigId = "your_push_config_id"
}

3. Running the Showcase Apps

You can run the Showcase App in an iOS simulator.

Alternatively, it is possible to run the Showcase App on a physical mobile device. In this case, the running Token App must be accessible from your mobile device. To ensure that the Showcase App running on your mobile device can access the Token App endpoint hosted on your machine, both devices need to be connected to the same network.

If not, the guide on exposing the localhost endpoints to the public Internet using ngrok should be consulted.