Signaling Quickstart - iOS Beta

Step 1: Obtain the Sample Code

Download Agora Signaling SDK from downloads, or contact sales-us@agora.io.

Agora Signaling SDK for iOS package structure is listed as follows:

  • ./libs: including the required libraries
  • ./samples: including the sample code called iosapp1

Note

The sample code currently only supports audio function. Video function will be provided later.

Step 2: Prepare the Environments

Be sure that the following development environment requirements are satisfied:

Platform System Requirement Network Requirement
iOS iOS 7.0 or later Port: HTTP 80 ,TCP 8181

Note

Both real device and emulator are acceptable.

If you want to use the Agora Signaling SDK together with Agora Native SDK, be sure that the requirements of Agora Native SDK are also satisfied.

Step 3: Compile the Sample Code

  1. Open iosapp1.xcodeproj using Xcode.

  2. Fill your own App ID and App Certificate in viewController.m.

    You can follow Obtaining an App ID and an App Certificate to get your App ID and APP Certificate.

    ../../_images/signal_demo_ios_0.1.png

    Warning

    In this demo, you can put the App Certificate directly here on the client side, but in product environment, keep your App Certificate on the server and never on any client machine.

  3. Click the build and run button to compile the demo.

    ../../_images/signal_demo_ios_0.2.png

Step 4: Execute the Sample Code

It requires two devices to demonstrate the functions included in the sample code.

Open the iosapp1 application on the iOS device after the compilation, and it displays the following screen:

../../_images/signal_demo_ios_0.png

The following table shows the function of the main buttons/menus:

Button Function
Login Log onto the signaling system.
Switch Switch the calling party and the called party.
Call Make a call.
InstMsg Send the instant messages.
Join Join the channel.
Msg Send the channel messages.
xxx The user name of the calling party
yyy The user name of the called party
demoroom1 the pre-fined channel name
Speaker Enable the speaker.

Executing the sample code according to the following scenarios:

  • Login
  • Join Channel
  • Make a Call

Scenario 1: Login

  1. Click Login on both screens to login onto the signaling system. It returns Login successfully upon a successful login.

    ../../_images/signal_demo_ios_1.png
  2. Send an instant message.

    • On the left, click InsMsg: the user xxx sends an instant message to the user yyy.

    • On the right, the user yyy receives the message as highlighted below, and vice versa.

      ../../_images/signal_demo_ios_2.png
  3. Click Logout on both screens to log out of the signaling system if necessary. It returns Logout successfully.

    ../../_images/signal_demo_ios_3.png

Scenario 2: Join Channel

  1. Be sure that both users are logged in.

  2. Click Join on both screens to join the channel demoroom1.

    It returns Join channel demoroom1 successfully, the user names and their corresponding UID who joined the channel.

    ../../_images/signal_demo_ios_4.png
  3. Send a channel message.

    • On the left, click Msg: the user xxx sends a channel message.

    • Both user xxx and user yyy receive the channel message.

      ../../_images/signal_demo_ios_5.png
  4. Click Leave on both screens to leave the demoroom1 channel if necessary.

    ../../_images/signal_demo_ios_6.png

Scenario 3: Make a Call

  1. Ensure that both users are logged in.

  2. On the left, click Call: the user xxx make a call request.

    1. The user xxx automatically joins the channel demoroom1 and gets the current user list in the channel.

    2. The user yyy receives the call invitation.

    3. The user xxx receives the callback that the user yyy has received the invitation.

    4. The user yyy automatically joins the channel demoroom1 and gets the user list in the channel.

    5. The user xxx receives the callback that user yyy has accepted the invitation and has joined the channel demoroom1.

      ../../_images/signal_demo_ios_7.png

    Both users can now start to talk with each other.

  3. On the left, click Bye to end the call. Both users will leave the channel automatically.

    ../../_images/signal_demo_ios_8.png
  4. Click Logout on both screens to log out of the system if necessary.