If your target platform is iOS, your development environment must meet the following requirements:
If your target platform is Android, your development environment must meet the following requirements:
flutter doctorto check whether the development environment and the deployment environment are correct.
A valid Agora developer account.
Create a project in Agora Console, as follows:
Log in to Console, and click in the left navigation menu to enter the Project Management page.
Enter your project name, and select Secure mode: APP ID + Token for the authentication mechanism in the pop-up window.
Click Submit. You can see the created project on the Project Management page.
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.
To ensure communication security, Agora uses tokens (dynamic keys) to authenticate users joining a channel.
Agora Console supports generating temporary tokens for testing purposes.
On the Project Management page, find your project, and click to open the Token page.
Enter a channel name, and click Generate Temp Token to get a temporary token. When joining the channel, ensure that the channel name is the same with the one that you use to generate the temporary token.
Download the Agora-Flutter-SDK repository. Open
example/lib/config/agora.config.dart) and edit the following values:
YOUR_APP_ID with your Agora App ID. The data type is String.
YOUR_TOEKN with your Token. The data type is String.
YOUR_CHANNEL_ID with your RTC channel ID. The data type is String, such as
YOUR_UID with your RTC uid, which must be the same as the uid used to generate the token. The data type is Int, such as
YOUR_STRING_UID with an empty string.
/// Get your own App ID at https://dashboard.agora.io/ const appId = YOUR_APP_ID; /// Please refer to https://docs.agora.io/en/Agora%20Platform/token const token = YOUR_TOEKN; /// Your channel ID const channelId = YOUR_CHANNEL_ID; /// Your int user ID const uid = YOUR_UID; /// Your string user ID const stringUid = YOUR_STRING_UID;
Run the following command to install dependencies.
flutter packages get
Run the project.