Code sample

Updated at:

This topic provides a code sample for integrating audio and video calling into an iOS client and explains how to use it.

Download the code sample

Click here to download the audio and video calling code sample.

Use the code sample

  1. Add the configuration file to the sample project.

    1. Log on to the mPaaS console.

    2. Create an mPaaS application.

    3. Download the .config configuration file for the mPaaS application and add it to the audio and video calling sample project.

    4. Run the pod mpaas update 10.1.68 && pod install command.

  2. In the navigation pane on the left of the console, choose Audio & Video Calling > Calling Application Management. Create a calling application or open an existing one to obtain its bizName.

  3. Generate a temporary signature. In the navigation pane on the left of the console, choose Audio & Video Calling > Signature Verification. In the Generate Temporary Signature area, select the calling application and enter a User ID to generate a temporary signature.

    Note
    • If you change the calling application or User ID, you must generate a new temporary signature.

    • Temporary signatures expire. You must generate a new one after the current signature expires.

  4. Configure the sample project. Run the sample project. On the App Settings page, enter the user ID (userId), business name (bizName), and temporary signature (signature) that you obtained in the previous steps.

    Note

    To ensure your traffic is secure, generate signatures on the server-side using secure signing after the application is published.

  5. Start or join an audio or video call. To start a call, create a call channel in the app. Alternatively, to join a call, enter the channel ID (roomId) and Token of a channel created by another user.

    Note

    Within the same calling application (using the same bizName), the user ID for each client must be unique.