REVE Chat’s Android SDK can be seamlessly integrated with your mobile apps and enable your team deliver in-app messaging to your app users for better engagement and customer support.
This tutorial shows you how to add Android chat SDK and get started in a few minutes.
Necessary or minimum requirements:
Step 1:
To integrate Android SDK with your mobile app, please follow the below mentioned steps:
Add the Android SDK url in your Project level build gradle file’s repositories section as shown below:
If android studio version less than Android Studio Arctic Fox
In app build.gradle, you can add the repositories
allprojects {
repositories {
……
maven {
url "https://jfrog-artifact.revechat.com/artifactory/artifactory/"
}
}
}
Otherwise
In settings.gradle, you can add the repositories
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
….
maven {
Url "https://jfrog-artifact.revechat.com/artifactory/artifactory/"
}
}
}
Step 2:
Add Design support library and REVE Chat Android SDK as dependency in your App level build.gradle file :
dependencies { ……. implementation('com.revesoft.revechatsdk:revechatsdk:1.0.14.2.10-snapshot') }
Note- You can also use Design support library greater then 26 also according to your project build sdk version.
Step 3:
Add following lines from where you want to start the chat.
//Initializing with account id ReveChat.init("account id"); //Creating visitor info VisitorInfo visitorInfo = new VisitorInfo.Builder() .name("your name").email("[email protected]") .phoneNumber("your number").build(); //Set visitor info ReveChat.setVisitorInfo(visitorInfo); //Optional //If want to Receive push notification from Reve Chat. //Add your device token id(registration Id) //You also need to do step 4. ReveChat.setDeviceTokenId("deviceTokenId"); //starting chat window startActivity(new Intent(this, ReveChatActivity.class));
Step 4:
Extra Customization (Optional)
Add primary and primary Dark in your color.xml, if already not defined:
<color name="revechatsdk_colorPrimary">#YourColor</color> <color name="revechatsdk_colorPrimaryDark">#YourColorDark</color>
To change chat window’s content as per your need:
<color name="revechatsdk_color_chat_background">#e9e9e9</color> <color name="revechatsdk_color_sending_msg">#b2dfea</color> <color name="revechatsdk_color_receiving_msg">#ffffff</color> //Chat action bar head text <string name="revechatsdk_title_chat_window">CHAT WITH US</string> //If the agents are offline, the action bar head text <string name="revechatsdk_title_offline_window">Leave Us a Message</string>