Manual install
Updated
Links to the manual downloads for this product, and explanations on how to install them.
Through the Agora website
-
Extract the files in Agora Signaling SDK to a local folder. In the SDK folder, find the JS file in the
libsfolder, and save it to your project directory. -
Open the HTML file in your project directory, and add the following code to refer to the JS file:
<script src="path to the JS file"></script> -
To enable smart completions and type checking, take the following steps:
-
Go to
libs/agora-rtm-sdk.d.tsin the SDK folder, and save the TS file to your project directory. -
Add the following line to the beginning of the JS or TS file. Replace
path to the TS filewith the path toagora-rtm-sdk.d.ts./// <reference path="path to the TS file" />
-
Through npm
-
In
package.jsonfor your project, addagora-rtm-sdkand its version number to thedependenciesfield:"dependencies": { "agora-rtm-sdk": "^2.1.4-beta.0", "cors-anywhere": "^0.4.4", "livereload-js": "^4.0.1", "url": "^0.11.1" }, -
Install the dependencies:
pnpm install -
In your code, import
RTMfromagora-rtm-sdk:// Import the SDK import AgoraRTM from 'agora-rtm-sdk'; // Create a client instance const signalingEngine = new AgoraRTM.RTM('app-id', 'user-id', { token: 'temporary-token' }); // Listen for events signalingEngine.addEventListener('message', (eventArgs) => { console.log(`${eventArgs.publisher}: ${eventArgs.message}`); }); // Login try { await signalingEngine.login(); } catch (err) { console.log({ err }, 'error occurs at login.'); } // Send channel message try { await signalingEngine.publish('channel', 'hello world'); } catch (err) { console.log({ err }, 'error occurs at publish message'); }
Automatically integrate the SDK with JitPack
-
Add the JitPack repository in the
build.gradlefile under the root directory of your project:allprojects { repositories { ... maven { url 'https://www.jitpack.io' } } } -
Add the
com.github.agorabuilder:rtm-sdkdependency in the/app/build.gradlefile under your project. ForX.Y.Z, use the current SDK version number. You can visit JitPack.io to see the latest version number.dependencies { implementation 'com.github.agorabuilder:rtm-sdk:X.Y.Z' }
Manually copy the SDK files
To manually install the Signaling SDK for Android from a downloaded package:
-
Extract Signaling SDK to a local directory, such as
<unzipped_package>. -
Copy the following files or folders from the
libsfolder to your Android project.
| File or folder | Path in your project |
|---|---|
agora-rtm_sdk.jar | /app/libs/ |
/arm64-v8a/libagora-rtm-sdk-jni.so | ~/app/src/main/jniLibs/arm64-v8a/ |
/armeabi-v7a/libagora-rtm-sdk-jni.so | ~/app/src/main/jniLibs/armeabi-v7a/ |
/x86/libagora-rtm-jni.so | ~/app/src/main/jniLibs/x86/ |
/x86_64/libagora-rtm-sdk-jni.so | ~/app/src/main/jniLibs/x86_64/ |
Automatically integrate the SDK with CocoaPods
-
In Terminal, navigate to the project path, and run the
pod initcommand to create aPodfilein the project folder. -
Open the
Podfile, delete all contents, and input the following code:target 'Your App' do use_frameworks! pod 'AgoraRtm_iOS' end -
Replace
Your Appwith the target name of your project. -
Go back to Terminal, and run the
pod updatecommand to update the local libraries. -
Run the
pod installcommand to install the Signaling SDK. Once you successfully install the SDK, it showsPod installation complete!in Terminal, and you can see anxcworkspacefile in the project folder. -
Open the generated
xcworkspacefile.
Manually add the SDK files
v1.4.4 or later
iOS apps integrated with Signaling SDK v1.4.4 cannot be published on the App Store due to review issues. If you want to publish your app on the App Store, you must use other versions of the SDK.
-
Extract the files in Signaling SDK to a local folder.
-
Copy
AgoraRtmKit.xcframeworkfrom the SDK to your project. -
Open Xcode, and navigate to TARGETS > Project Name > General > Frameworks, Libraries, and Embedded Content.
-
Click + > Add Other... > Add Files to add the corresponding library. Ensure that the Embed attribute of the dynamic library is Embed & Sign.
Once the dynamic library is added, the project automatically links to other system libraries.
The SDK uses the XCFramework. If you are using a build tool that does not support XCFramework integration, Agora provides the following scripts to help you integrate:
- Use the
change_to_all_arch.shscript to convert the XCFramework to the universal framework. - If you need to publish an iOS app on the App Store, use the
remove_simulator_arch.shscript to remove the simulator before packaging the app.
The steps to execute these scripts are as follows:
-
Copy the above script files to your project, and execute the following code to generate
AgoraRtmKit.framework:sh change_to_all_arch.sh "<AgoraRtmKit.xcframework path>" sh remove_simulator_arch.sh "<AgoraRtmKit.framework path>" -
In Xcode, go to the TARGETS > Project Name > Build Phases > Link Binary with Libraries menu, and click + to add
AgoraRtmKit.xcframework. Ensure that the Embed attribute of the dynamic library is Embed & Sign.
Earlier than v1.4.4
-
Copy the
AgoraRtmKit.frameworkfile in thelibsfolder to the project folder. -
In Xcode, go to the TARGETS > Project Name > Build Phases > Link Binary with Libraries menu, and click + to add the following frameworks and libraries. To add the
AgoraRtmKit.frameworkfile, remember to click Add Other... after clicking +.AgoraRtmKit.frameworklibc++.tbdlibresolv.tbdSystemConfiguration.frameworkCoreTelephony.framework
Automatically integrate the SDK with CocoaPods
-
In Terminal, navigate to the project path, and run the
pod initcommand to create aPodfilein the project folder. -
Open the
Podfile, delete all contents, and input the following code:target 'Your App' do use_frameworks! pod 'AgoraRtm_macOS' end -
Replace
Your Appwith the target name of your project. -
Go back to Terminal, and run the
pod updatecommand to update the local libraries. -
Run the
pod installcommand to install the Signaling SDK. Once you successfully install the SDK, it showsPod installation complete!in Terminal, and you can see anxcworkspacefile in the project folder. -
Open the generated
xcworkspacefile.
Manually add the SDK files
v1.4.4 or later
Apps integrated with Signaling SDK v1.4.4 cannot be published on the App Store due to review issues. If you want to publish your app on the App Store, you must use other versions of the SDK.
-
Extract the files in Signaling SDK to a local folder.
-
Copy
AgoraRtmKit.xcframeworkfrom the SDK to your project. -
Open Xcode, and navigate to TARGETS > Project Name > General > Frameworks, Libraries, and Embedded Content.
-
Click + > Add Other... > Add Files to add the corresponding library. Ensure that the Embed attribute of the dynamic library is Embed & Sign.
Once the dynamic library is added, the project automatically links to other system libraries.
The SDK uses the XCFramework. If you are using a build tool that does not support XCFramework integration, Agora provides the following scripts to help you integrate:
- Use the
change_to_all_arch.shscript to convert the XCFramework to the universal framework. - If you need to publish an app on the App Store, use the
remove_simulator_arch.shscript to remove the simulator before packaging the app.
The steps to execute these scripts are as follows:
-
Copy the above script files to your project, and execute the following code to generate
AgoraRtmKit.framework:sh change_to_all_arch.sh "<AgoraRtmKit.xcframework path>" sh remove_simulator_arch.sh "<AgoraRtmKit.framework path>" -
In Xcode, go to the TARGETS > Project Name > Build Phases > Link Binary with Libraries menu, and click + to add
AgoraRtmKit.xcframework. Ensure that the Embed attribute of the dynamic library is Embed & Sign.
Earlier than v1.4.4
-
Copy the
AgoraRtmKit.frameworkfile in thelibsfolder to the project folder. -
In Xcode, go to the TARGETS > Project Name > Build Phases > Link Binary with Libraries menu, and click + to add the following frameworks and libraries. To add the
AgoraRtmKit.frameworkfile, remember to click Add Other... after clicking +.AgoraRtmKit.frameworklibc++.tbdlibresolv.tbdSystemConfiguration.frameworkCoreTelephony.framework
-
Extract the files in Agora Signaling SDK to a local folder.
-
Copy the
*.sofile and the*.jarfile to thelibfolder. -
Create a file named
pom.xmlinRTM_quickstartwith the following content:<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>io.agora</groupId> <artifactId>Signaling-Client-Demo</artifactId> <version>1.0-SNAPSHOT</version> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <maven.compiler.source>1.6</maven.compiler.source> <maven.compiler.target>1.6</maven.compiler.target> </properties> <dependencies> <dependency> <groupId>io.agora.rtm</groupId> <artifactId>agora-rtm-sdk</artifactId> <version>1.0</version> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-shade-plugin</artifactId> <version>3.2.0</version> <executions> <!-- Attach the shade into the package phase --> <execution> <phase>package</phase> <goals> <goal>shade</goal> </goals> <configuration> <transformers> <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"> <mainClass>io.agora.mainClass.RtmJavaDemo</mainClass> </transformer> </transformers> </configuration> </execution> </executions> </plugin> </plugins> </build> </project>
-
Extract the files in Agora Signaling SDK to a local folder.
-
Copy the
*.sofile in the SDK folder into yourlibfolder, and copy the*.hfile in the SDK folder into yourincludefolder. -
Create a file named
CMakeLists.txtunder theRTM_quickstartdirectory to use CMake to build the project. The text file should contain the following content:cmake_minimum_required(VERSION 2.8) project(rtmQuickstart) set(TARGET_NAME rtmQuickstart) set(SOURCES rtmQuickstart.cpp) set(HEADERS) set(TARGET_BUILD_TYPE "Debug") set(CMAKE_CXX_FLAGS "-fPIC -O2 -g -std=c++11 -msse2") include_directories(${CMAKE_SOURCE_DIR}/include) link_directories(${CMAKE_SOURCE_DIR}/lib) add_executable(${TARGET_NAME} ${SOURCES} ${HEADERS}) target_link_libraries(${TARGET_NAME} agora_rtm_sdk pthread)
-
Extract the files in Agora Signaling SDK to a local folder.
-
Copy all subfolders of the SDK folder to the solution directory of your Visual Studio project.
Ensure that the subfolders are in the same location as your
*.slnfile. -
Configure the project properties.
-
In Visual Studio, right-click the project name in the Solution Explorer window, click Properties, then click OK.
-
Select C/C++ > General > Additional Include Directories, then click Edit.
-
In the window, input
$(SolutionDir)include. -
Select Linker > General > Additional Library Directories, then click Edit.
-
In the window, input
$(SolutionDir)lib. -
Select Linker > Input > Additional Dependencies, then click Edit.
-
In the window, input
agora_rtm_sdk.lib.
-
Import the asset package
-
Extract the latest version of Agora Signaling SDK for Unity to a local folder.
-
In the Unity Editor, select Assets > Import Package > Custom Package.
-
Select the Agora Signaling Unity asset package and click Open.
-
All packages of the SDK are chosen by default. Uncheck the packages you do not need and click Import.
Manually add the SDK files
-
Extract the files in Agora Signaling SDK to a local folder.
-
Copy the
Rtm-Scriptsfolder under thelibsfolder in the SDK package to theAssetsfolder of the project path. -
Copy the following files under the
libs/Pluginspath 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 |
-
Open a terminal and execute the following command to create a new Flutter project:
flutter create project_name -
Open the project in your IDE. Add the Signaling SDK dependency to
pubspec.yamlunderdependencies:dependencies: # Add the Signaling SDK dependency, use the latest version number agora_rtm: ^2.2.1
To integrate Signaling SDK version 2.2.1 or above and Video SDK version 4.3.0 or above at the same time, refer to Handle integration issues.
-
To install the dependencies, open the terminal and execute the following command in the project path:
flutter pub get
