Product Guide
APIsProductUpdatesPricingFAQs
  • Introduction to REVE Chat
  • Integrations
    • Website
    • Social Media Channels
      • WhatsApp
      • Instagram Messaging and Comment
      • Facebook Messenger and Comment
      • Viber
      • Telegram
    • Direct Chat Page
    • Mobile SDK
      • Native Android SDK
      • Native iOS SDK
      • Flutter Android SDK
      • Flutter iOS SDK
      • React Native iOS SDK
      • React Native Android SDK
    • Email Integration
      • Forward emails to your REVE Chat tickets
      • Integrate Your Business Email
        • Connecting Gmail with POP/IMAP Settings
    • All Integrations
      • CRM Integrations
        • Pipedrive
        • Salesforce
        • HubSpot
        • MS Dynamics
        • Amo CRM
        • Agile CRM
        • Vtiger
        • Capsule
        • Infusionsoft (by Keap)
      • CMS Integration
        • WordPress
        • DotNet Nuke
        • Blogger
        • Joomla
        • Drupal
        • ModX
      • E-commerce
        • Shopify
        • Bigcommerce
        • WooCommerce
        • Prestashop
        • 3dCart
        • Pinnacle Cart
        • Corecommerce
        • BigCartel
        • ECWID
        • LemonStand
        • Ebay
        • Volusion
        • Americommerce
        • osCommerce
        • Magento
          • By Manual Code Injection
        • Zencart
        • XCart
        • OpenCart (V4.0.x)
          • OpenCart (Old Version Integration)
        • CSCart
        • Abantecart
      • Website Builder
        • Wix
      • Hosting Platform
        • Plesk
        • WHMCS
      • Analytics
        • Google Tag Manager
        • Google Analytics
    • Google Integration
      • YouTube Integration
      • Google Play Store
      • Google Business Account
  • Appstore
  • Inbox
    • Breaking Down of Single Inbox
    • Folders of Single Inbox
    • How Conversation Works!
    • Chat Monitoring for All Ongoing Agents' Chat
    • Chat History for All Closed Conversations
    • Proactive Chat Management
    • Voice & Video Call
    • Co-Browsing
    • How to use Shortcuts
    • Inbox Appearance
  • Contacts
    • Manage Your Contacts
    • Segments
  • WhatsApp Campaign
    • What is WhatsApp Campaign?
      • Broadcast: Send Campaigns
      • Templates: Create Campaign
  • Tickets
    • Set up your Ticketing email
    • Create Ticket
      • Create a ticket manually
      • Ticket from Chat History
      • Automated & Bulk Ticket Creation
    • Knowing your Ticketing tables
      • Custom Ticketing Tables
    • Managing a Ticket
  • Chatbot
    • Bot Builder
      • Response Elements
        • Text Action
        • Quick Reply Action
        • Carousel Action
        • Button Action
        • Send Email
      • Data Collection
        • Ask Name
        • Ask Phone
        • Ask Email
        • Ask Question
        • Ask OTP
        • Ask File
        • Ask Date
        • Ask Time
        • Forms
        • Ask Number
      • Media
        • Image Action
        • Audio Action
        • Video Action
        • File Action
      • Workflow Action
        • Condition Action
        • Chat Transfer Action
        • Close Chat
        • Appointment Action
        • Attribute Action
        • Business Hour
        • System Attributes
      • Advanced Action
        • Salesforce Bot Action Manual
        • API Connector
        • Goal
        • Dynamic Data
    • Brain AI
      • ChatGPT Integration
    • Settings
      • Bot Profile
      • General Settings
      • Webhook
    • Training
      • Intent Sample
      • Sentiment
      • Synonyms
      • FAQ
      • Untrained
      • Trained
      • Bulk Training
    • Multilingual Bot
  • Reports
    • Summary
    • Chat Satisfaction
    • Chatbot Report
      • Bot Engagement
      • Flow Engagement
      • Goal Analysis
    • Agent Analytics
      • Agent Activity
      • Agent Performance
      • Metrics
      • SLA Breach Analysis
    • Ticket Analytics
      • Dashboard
      • Metrics
    • Visitor Analytics
    • Enterprise Report
      • Daily Agent Performance
      • Hourly Agent Performance
      • Daily Group Performance
      • Traffic Analysis Report
      • First Response Time
  • User Profile
    • Billing
    • Help & Feedback
  • Settings
    • General Settings
      • Auto Triggers
      • Forms
        • Pre Chat Form
        • Post Chat Form
        • Custom Forms
          • Advanced Forms
        • Ticket Forms
      • Canned Responses
      • Custom Attributes
      • Call Recording
      • Tags
      • Appointment
      • Departments
      • Chat Transcript Forwarding
      • Ban Visitor
      • Trusted IP & Domain
      • Business Hour
    • Chat Widgets
      • Appearance
      • Custom Message
      • Widget Features
      • Forms
      • Code Snippet & Quick Share
    • Ticketing
      • Email Templates
      • Status Management
    • Agent Management
      • Agents
      • Departments
      • Role Management
    • API Settings
      • Json Parse Format
    • Scripts
    • SLA Policy
    • Routing Policy in REVE Chat
      • Chat Routing
      • Advanced Routing
    • Other Settings
Powered by GitBook
On this page
  • Minimum Requirements
  • Android SDK Integration Process
  • Step 1
  • Step 2
  • Step 3
  • Step 4
  • Step 5
  • Step 5
  • Step 6
  • Step 7
  • Step 8

Was this helpful?

  1. Integrations
  2. Mobile SDK

Native Android SDK

REVE Chat’s Android SDK can be seamlessly integrated with your mobile apps and enable your team to deliver in-app messaging to your app users for better engagement and customer support.

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

Minimum Requirements

  1. Android Studio

  2. Minimum SDK version should be 24 or above

  3. SDK Version: 3.2.2

Android SDK Integration Process

Step 1

To integrate Android SDK with your mobile app, please follow the below mentioned steps. Based on gradle version follow either steps in (a) or (b)

  1. If gradle version is ( 7.X to 8.0 ) , add following repositories in project gradle file ( build.gradle )

allprojects {
    repositories {
        jcenter()
        maven { url 'https://maven.google.com' }
        mavenLocal()
        google()
        maven {
            url "https://maven.iptelephony.revesoft.com/artifactory/libs-release-local/"
        }
        maven {// for revesoft cpp
            url "https://jfrog-artifact.revechat.com/artifactory/artifactory/"
        }
        maven { url "https://jitpack.io" }
    }
}
  1. If gradle version is 8.X to latest, add following repositories in settings.gradle

dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
    repositories {
        google()
        mavenCentral()
        maven { url 'https://jitpack.io' }
        maven { url 'https://maven.google.com/' }
        maven {
            url "https://jfrog-artifact.revechat.com/artifactory/artifactory/"
        }
        maven {
            url "https://maven.iptelephony.revesoft.com/artifactory/libs-release-local/"
        }
    }
}

Step 2

Add Design support library and REVE Chat Android SDK as dependency in your App level build.gradle file :

…
buildFeatures {
       dataBinding  true
       viewBinding true
       buildConfig = true
   }


dependencies {
   implementation('com.revesoft.revechatsdk:revechatsdk:3.2.2')
}

Step 3

Add following following method in your Main Activity and call this from onCreate() method.

Code for JAVA

private void initiateReveChat() {
    // Initializing with account id
    ReveChat.init(accountId);

    // Create visitor info
    VisitorInfo visitorInfo = new VisitorInfo.Builder()
            .name(userName) // set name
            .email(userEmail)
            .phoneNumber(userPhone)
            .build();

    // visitorInfo.setAccessToken(accessToken); // set access token if any

    ReveChat.setVisitorInfo(visitorInfo);

    ReveChat.setAppBundleName(BuildConfig.APPLICATION_ID);
    ReveChat.setAppVersionNumber(BuildConfig.VERSION_NAME);

    Intent intent = new Intent(this, REVEChatApiService.class);
    startService(intent);
}

Code for KOTLIN

private fun initiateReveChat() {
        ReveChat.init(accountId)

        //create visitor info
        val visitorInfo: VisitorInfo = VisitorInfo.Builder()
            .name(userName) // set name
            .email(userEmail)
            .phoneNumber(userPhone)
            .build()


        ReveChat.setVisitorInfo(visitorInfo)

        ReveChat.setAppBundleName(BuildConfig.APPLICATION_ID)
        ReveChat.setAppVersionNumber(BuildConfig.VERSION_NAME)
        startService(Intent(this, REVEChatApiService::class.java))
    }

Step 4

Call following method when you want to open the chat window ( e.g. on implementation of setOnClickListener() of chat button )

// Java

   private void openChatWindow() {
        startActivity(new Intent(this, ReveChatActivity.class));
    }
 // Kotlin
 private fun openChatWindow() {
      startActivity(Intent(this, ReveChatActivity::class.java))
 }

Step 5

Stop REVEChatApiService from MAIN/LAUNCHER Activity’s onDestroy() method

// for Java

@Override
protected void onDestroy() {
       super.onDestroy();
       if (!WebRTCHandler.INSTANCE.isWebRTCCallRunning())
           stopService(new Intent(this, REVEChatApiService.class));
   }

// for Kotlin

override fun onDestroy() {
       super.onDestroy()
       if (!REVEChatApiService.isCallRunning())
           stopService(Intent(this, REVEChatApiService::class.java))

   }

Step 5

If Application class is not added, then please implement it and add in manifest file

// In manifest file, application tag add your Application class ( e.g. in below example 
implmetation of Application class MyApplication )

<application
android:name=".MyApplication" />

Need to add below line in onCreate() method

  1. ProcessLifecycleOwner.get().getLifecycle().addObserver(REVEChatAppLifecycleObserver.INSTANCE) // need to call from onCreate() method

import android.app.Application;
import androidx.lifecycle.ProcessLifecycleOwner;
import com.google.firebase.FirebaseApp;
import com.revesoft.revechatsdk.utils.REVEChatAppLifecycleObserver;

public class MyApplication extends Application {

    @Override
    public void onCreate() {
        super.onCreate();
        ProcessLifecycleOwner.get().getLifecycle().addObserver(REVEChatAppLifecycleObserver.INSTANCE);
    }
}

import android.app.Application
import androidx.lifecycle.ProcessLifecycleOwner
import com.google.firebase.FirebaseApp
import com.revesoft.revechatsdk.utils.REVEChatAppLifecycleObserver

class MyApplication : Application() {
    override fun onCreate() {
        super.onCreate()
        ProcessLifecycleOwner.get().lifecycle.addObserver(REVEChatAppLifecycleObserver.INSTANCE)
    }
}

Step 6

Push Notification implementation

(i) in project gradle file add below

dependencies {
        classpath 'com.google.gms:google-services:4.4.2'
    }

(ii) in app gradle file add below dependency

dependencies {
    // firebase push
    implementation 'com.google.firebase:firebase-messaging:24.0.3' // Update version if necessary    
}

(iii) in application class onCreate() method, add below code

FirebaseApp.initializeApp(this);

(iv) create a class extending FirebaseMessagingService if not already there. In this class add below necessary codes to implement push notification. Need to use PushMessageProcessor class to send necessary information to SDK.

Below code block shows implementation in Java

public class MessagingService extends FirebaseMessagingService {

    private PushMessageProcessor pushMessageProcessor;

    @Override
    public void onCreate() {
        super.onCreate();
        pushMessageProcessor = new PushMessageProcessor(this);
    }

    @Override
    public void onMessageReceived(RemoteMessage remoteMessage) {
        pushMessageProcessor.handlePushMessage(new JSONObject(remoteMessage.getData()));
    }


    @Override
    public void onNewToken(String refreshedToken) {
        super.onNewToken(refreshedToken);
        pushMessageProcessor.onNewToken(refreshedToken);
    }
 } 

Below code block shows implementation in Kotlin

import com.google.firebase.messaging.FirebaseMessagingService;
import com.google.firebase.messaging.RemoteMessage;
import com.revesoft.revechatsdk.message.processor.PushMessageProcessor;
import org.json.JSONObject;

public class MessagingService extends FirebaseMessagingService {
  
    private PushMessageProcessor pushMessageProcessor;

    @Override
    public void onCreate() {
        super.onCreate();
    
        pushMessageProcessor = new PushMessageProcessor(this);
    }

    @Override
    public void onMessageReceived(RemoteMessage remoteMessage) {
       
        pushMessageProcessor.handlePushMessage(new JSONObject(remoteMessage.getData()));
    }

    @Override
    public void onNewToken(String refreshedToken) {
        super.onNewToken(refreshedToken);
        
        pushMessageProcessor.onNewToken(refreshedToken);
    }
}

(v) declare the class in Manifest file, if not already declared

<service
android:exported ="false"
android:name=".MessagingService">

    <intent-filter>
          <action android:name="com.google.firebase.MESSAGING_EVENT" />
            </intent-filter>
</service> 

Go to Settings -> Chat Widgets . Select the chat widget, then go to code snippet. In android section, copy paste json data.

Step 7

In the gradle.properties file add following lines

android.useAndroidX=true
android.enableJetifier=true

Step 8

Proguard Configuration

In your proguard configuration file add below:


-keep class org.webrtc.** { *; }
-keep class org.webrtc.voiceengine.** { *; }
-dontwarn org.webrtc.**

-keep class com.revesoft.revechatsdk.**{*;}
-keep interface com.revesoft.revechatsdk.* { *; }
-keep enum com.revesoft.revechatsdk.* { *; }
-dontwarn com.revesoft.revechatsdk.**

# Preserve generic type information for Gson
-keepattributes Signature

# Keep all classes and fields with generic types
-keepclassmembers,allowobfuscation class * {
    *;
}

# Keep Gson type adapters and serializers/deserializers
-keep class * extends com.google.gson.TypeAdapter
-keep class * extends com.google.gson.JsonSerializer
-keep class * extends com.google.gson.JsonDeserializer

# Keep any classes that use Gson with generics
-keep class * {
    @com.google.gson.annotations.SerializedName <fields>;
}

​

PreviousMobile SDKNextNative iOS SDK

Last updated 12 days ago

Was this helpful?

(vi) Add Firebase Service Account JSON Configuration in Agent Dashboard ()

GitHub sample application Link:

Any questions? Please email us at or .

https://app.revechat.com/
AndroidReveChatSDKTestApp
issue.support@revechat.com
scan to chat with us