Documents
How to setup eRTC for the 1st time
Running the demo project
This is great way to test the features of the eRTC SDK before you start integrating it with your app.
-
Clone eRTC SDK.
-
Run
pod install
in the Xcode directory. -
Open the
eRTC SDK eRTCSample.xcworkspace
file in Xcode. -
Compile and run.
Adding the Chat SDK to your project
This is great way to test the features of the eRTC SDK before you start integrating it with your app.
-
Add the eRTC SDK development pods to your Podfile.
use_frameworks!
pod “eRTCSDK” -
Run
pod install
to get the latest version of the code. -
Run
pod update
to get the latest version of the code (optional for pod update). -
Open the App Delegate add the following code to initialise the chat
Objective C
How to Add the eRTC Client SDK to your Android App
Gradle
To download the SDK, you will need to include the repository manually:
-
Add repository.
repositories {
mavenCentral()
maven { url "http://artifactory.pantepic.com/artifactory/ext-sdk-rel" }
} -
Then add this to your dependencies area.
implementation 'com.ripbull.ertcsdk:coreSdk:1.0.0'
-
You also need to enable Java 8.
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
Android X
Make sure you've added the following to your gradle.properties file.
Initializing the Chat SDK
Now open your applications's main class and find the onCreate method. Add the following to setup the Chat SDK:
try {
val config = Configuration.Builder()
// SDK initialize
eRTCSDK.initializeWithConfig(this, config.build());
} catch (ChatSDKException e) {
// Handle any exceptions
e.printStackTrace();
}
How to Send Chat Text Message
A chat between two users is considered as a thread of communication. To initiate chat between users, you need to create threads and send message over that thread ID.
To do that :
/*
Here user.id corresponds to the id of the user, you need to initiate chat with. Create Thread method takes two params, one is thread name and the second one is user id
*/
eRTCSDK.chat().createThread("", user.id);