Run the Mac demo

更新时间:
复制 MD 格式

This topic describes how to run the Mac demo.

Prerequisites

You have obtained your authentication information from the console. For more information, see Access tools.

Note The token obtained from the console is for development and testing only. Using this token in a production environment poses a security threat. For production environments, you must set up your own server to generate tokens and use the HTTPS protocol. For more information, see Generate a token on the server-side.

Environment requirements

Type

Description

Terminal device

If you use a device without a built-in camera and microphone, such as a Mac mini, connect an external camera and microphone.

System Version

macOS 10.14 or later.

Procedure

  1. Download and decompress the SDK and the sample code. For more information, see SDK downloads.

  2. Copy the SDK files to the specified directory in the sample code.

    20240229154954

  3. Configure the parameters.

    1. Set DingRTC.framework and libffmpeg.dylib as dynamic libraries as shown in the following figure.

      20240229155329

    2. Open the ChannelInfo.m file and configure the authentication parameters: App ID, Channel ID, Token, and User ID.

      /* For the definitions of App ID, Channel ID, Token, User ID, and User Name, see:
         https://help.aliyun.com/document_detail/159037.html
      
         For temporary testing, you can use a temporary token. For more information, see:
         https://help.aliyun.com/document_detail/146833.html
      */
      static NSString * _appId = @"aoe****";
      static NSString * _token = @"70f77b8****";
      static NSString * _gslbServer = @"https://gslb.dingrtc.com";
      static NSString * _channelId = @"23****";
      static NSString * _userId = @"f303d59acae073****";
  4. Run.

    After the demo runs successfully, the home page is displayed. You can click Join to join a channel. If other users are in the channel, you can start a real-time audio and video call.

    20240229165141