Flutter Android SDK
- September 17, 2026
- 3 mins read
Table of Content
This documentation shows you how to embed REVE Chat Flutter Android SDK in an Android application and get started in a few minutes.
Getting Started with Flutter Android SDK
REVE Chat’s Flutter 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.
Introduction
This documentation shows you how to embed REVE Chat Android SDK in a Flutter based Android application and get started in a few minutes.
Necessary or minimum requirements:
- Android Studio
- Minimum SDK version should be 14 or above
- SDK version (Compile, Build, Target) should be 26 or above
Flutter 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)
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" }
}
}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.4.0')
}Note: You can also use Design support library greater then 26 also according to your project build SDK version.
Step 3
Add the following method in your Main Activity and call this from the 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);
ReveChat.setApiServiceTitle("REVEChatApiService"); // change as per your requirement
ReveChat.setApiServiceContent("REVEChatApiService"); // change as per your requirement
ReveChat.setIsScreenShotEnabled(false); // to disable taking screenshot
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)
ReveChat.setApiServiceTitle("REVEChatApiService") // change as per your requirement
ReveChat.setApiServiceContent("REVEChatApiService") // change as per your requirement
ReveChat.setIsScreenShotEnabled(false) // to disable taking screenshot
startService(Intent(this, REVEChatApiService::class.java))
}Step 4
Call the following method when you want to open the chat window (e.g. on implementation of setOnClickListener() of the 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 the 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 6
If your Application class is not added yet, implement it and register it in the manifest file:
<!-- In manifest file, application tag: add your Application class -->
<application
android:name=".MyApplication" />- ProcessLifecycleOwner.get().getLifecycle().addObserver(REVEChatAppLifecycleObserver.INSTANCE) // call this from onCreate()
Java:
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);
}
}Kotlin:
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 7
Push notification implementation
- In your project-level gradle file, add:
dependencies {
classpath 'com.google.gms:google-services:4.4.2'
}- In your app-level gradle file, add this dependency:
dependencies {
// firebase push
implementation 'com.google.firebase:firebase-messaging:24.0.3' // update version if necessary
}- In your Application class’s onCreate() method, add:
FirebaseApp.initializeApp(this);- Create a class extending FirebaseMessagingService if you don’t already have one. Use PushMessageProcessor to forward push data to the SDK.
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);
}
}Kotlin:
class MessagingService : FirebaseMessagingService() {
private lateinit var pushMessageProcessor: PushMessageProcessor
override fun onCreate() {
super.onCreate()
pushMessageProcessor = PushMessageProcessor(this)
}
override fun onMessageReceived(remoteMessage: RemoteMessage) {
pushMessageProcessor.handlePushMessage(JSONObject(remoteMessage.data as Map<String, Any>))
}
override fun onNewToken(refreshedToken: String) {
super.onNewToken(refreshedToken)
pushMessageProcessor.onNewToken(refreshedToken)
}
}Editor's note (not for publishing):
The source document's “Kotlin” push-notification sample was the Java code pasted twice (semicolons, ‘public class … extends’). The block above is corrected, idiomatic Kotlin — flagging in case you want to verify against your actual SDK class before publishing.
- Declare the service in your 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>- Add your Firebase Service Account JSON configuration in the Agent Dashboard (https://app.revechat.com). Go to Settings → Chat Widgets, select the chat widget, then open the code snippet. In the Android section, paste the JSON data.
Step 8
In the gradle.properties file, add the following lines:
android.useAndroidX=true
android.enableJetifier=trueStep 9
Proguard configuration
In your proguard configuration file, add the following:
-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>;
}GitHub sample application link: https://github.com/revechatofficial/flutter-sample-android-app