Run the sample project
This page shows you how to install and run the Signaling example project.
Prerequisites
In order to follow this procedure you must have:
- Unity Hub
- Unity Editor 2022.2.0b7 or higher
- Microsoft Visual Studio 2017 or higher
-
A computer with Internet access.
Ensure that no firewall is blocking your network communication.
Implement Signaling
1. Create an Agora project
Create a project in Agora Console, as follows:
-
Log in to Console, and click Project Management in the left navigation menu to enter the Project Management page.
-
Click Create.
-
Enter your project name, and select APP ID for the authentication mechanism in the pop-up window. Agora recommends using an App ID for authentication only in a test environment, or if your project has low security requirements.
-
Click Submit. You can see the created project on the Project Management page.
2. Get an App ID
Agora automatically assigns each project an App ID as a unique identifier.
To copy this App ID, find your project on the Project Management page in Agora Console, and click the eye icon to the right of the App ID.
3. Get an App Certificate
To get an App Certificate, do the following:
-
On the Project Management page, click Config for the project you want to use.
-
Click the copy icon under Primary Certificate.
4. Generate a token
To ensure communication security, Agora recommends using tokens to authenticate users logging in Signaling.
For testing purposes, Agora Console supports generating Signaling tokens. To generate a Signaling token:
-
Fill in the App ID, App certificate, and user ID to log in to Signaling. You need to specify the user ID yourself (for example, "test"). The generated Signaling token is showed on the screen. When calling the
login
method later, ensure that the user ID is the same with the one that you use to generate the Signaling token.
5. Configure the sample project
Approach 1: Configure through the Agora asset package
-
Open Unity and click New to create a new Unity project.
-
Download the latest version of Agora asset package for Unity on GitHub.
-
In the Unity Editor, select Assets > Import Package > Custom Package.
-
Select the Agora asset package and click Open.
-
All files of the asset package are chosen by default. Uncheck the files that you do not need and click Import.
-
Click MainScene > ChatManager in Hierarchy list.
-
Find Agora Properties in Inspector list, and enter the App ID and the Signaling token.
Approach 2: Configure through the Agora SDK
-
Download the latest version of the Agora Signaling SDK.
-
Find
./samples/Unity-Signaling-Demo
folder in the SDK package and open it it in Unity. -
Copy the
Rtm-Scripts
folder under thelibs
folder in the SDK package to theAssets
folder of the project path. -
Copy the following files under the
libs/Plugins
path in the SDK package to the corresponding path of the project:Development Platform File or folder Project directory Android Plugins/Android
/Assets/Plugins/Android/
iOS Plugins/iOS
/Assets/Plugins/iOS
macOS Plugins/macOS
/Assets/Plugins/macOS
Windows Plugins/x86
/Assets/Plugins/x86
Windows Plugins/x86_64
/Assets/Plugins/x86_64
-
Click MainScene > ChatManager in Unity’s Hierarchy list.
-
Find Agora Properties in Inspector list, and enter the App ID and the Signaling token.
6. Run the sample project
Run the sample project according to the following steps:
-
Click the File menu bar in Unity, and set the device you need to run through Build Settings.
-
Click the Play button at the top of the Unity main interface to run the sample project directly, or click File > Build And Run in the menu bar to compile and run the sample project. If the project runs successfully, you can see the following screen on your device:
Now you can experience the Signaling. You can also use the Agora Signaling Web sample app to interact with your device. Ensure that you enter the same App ID, channel name, and Signaling token in the Agora Signaling Web sample app.