Native Android SDK

This documentation shows you how to embed REVE Chat Android SDK in an Android application and get started in a few minutes.

Minimum Requirement#

  1. Android Studio
  2. Minimum SDK version should be 14 or above
  3. SDK version (Compile, Build, Target) should be 26 or above


Android SDK Integration Process#

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://jitpack.io' }
    maven { url 'https://maven.google.com/' }
    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://jitpack.io' }
        maven { url 'https://maven.google.com/' }
        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.3.1')

}



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. However, this step needs to be done differently for JAVA or KOTLIN in separate ways.
Code for JAVA


// Initializing with account id
ReveChat.init("account id");

// Creating visitor info
VisitorInfo visitorInfo = new VisitorInfo.Builder()
.name("your name")
.email("your@email.com")
.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)); Code for KOTLIN //Initializing with account id
ReveChat.init("account id")

//Creating visitor info
val visitorInfo: VisitorInfo = VisitorInfo.Builder()
.name("your name")
.email("your@email.com")
.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(Intent(this, ReveChatActivity::class.java))

 

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:

<!-- screen background color --> 
<color name="revechatsdk_layout_bg">#YourColor</color>
<!-- Button color --> 
<color name="revechatsdk_btn_text">#YourColor</color>
<color name="revechatsdk_btn_bg">@color/revechatsdk_colorPrimary</color>
<!-- Chat screen colors --> 
<color name="revechatsdk_color_chat_background">#YourColor</color>
<color name="revechatsdk_color_sending_msg_bg">#YourColor</color>
<color name="revechatsdk_color_receiving_msg_bg">#YourColor</color>
<color name="revechatsdk_shape_date_bubble_bg">#YourColor</color>
<!-- Chat action bar head text
<string name="revechatsdk_title_chat_window">YOUR MESSAGE TITLE</string>


Any questions? Please email us at support@revechat.com

#

Any questions? Please email us at support@revechat.com