Signaling Quickstart - iOS Beta¶
Step 1: Obtain the Sample Code¶
Agora Signaling SDK for iOS package structure is listed as follows:
- ./libs: including the required libraries
- ./samples: including the sample code called iosapp1
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
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¶
Open iosapp1.xcodeproj using Xcode.
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.
Click the build and run button to compile the demo.
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:
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:
- Join Channel
- Make a Call
Scenario 1: Login¶
Click Login on both screens to login onto the signaling system. It returns Login successfully upon a successful login.
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.
Click Logout on both screens to log out of the signaling system if necessary. It returns Logout successfully.
Scenario 2: Join Channel¶
Be sure that both users are logged in.
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.
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.
Click Leave on both screens to leave the demoroom1 channel if necessary.
Scenario 3: Make a Call¶
Ensure that both users are logged in.
On the left, click Call: the user xxx make a call request.
The user xxx automatically joins the channel demoroom1 and gets the current user list in the channel.
The user yyy receives the call invitation.
The user xxx receives the callback that the user yyy has received the invitation.
The user yyy automatically joins the channel demoroom1 and gets the user list in the channel.
The user xxx receives the callback that user yyy has accepted the invitation and has joined the channel demoroom1.
Both users can now start to talk with each other.
On the left, click Bye to end the call. Both users will leave the channel automatically.
Click Logout on both screens to log out of the system if necessary.