React Native Android SDK Integration Guide
- November 10, 2026
- 11 mins read
Table of Content
The REVE Chat SDK allows users to start conversations from your React Native application using a native Android chat screen. Once integrated, users can open REVE Chat by tapping a chat button in your app.
This guide covers the complete integration process for REVE Chat SDK version 3.4.0, including Android configuration, Java and Kotlin implementation, JavaScript integration, and troubleshooting.
Note: This SDK supports Android only. The example provided in this guide displays a message when users attempt to open chat on another platform.
Prerequisites
Before integrating the SDK, make sure your development environment meets the following requirements.
| Requirement | Details |
|---|---|
| React Native | An existing React Native project with an android/ folder. Tested with React Native 0.88. |
| Minimum Android SDK | API level 24 (Android 7.0) or higher |
| Compile SDK | API level 35 or higher |
| Java Development Kit (JDK) | JDK 21.0.8 or newer |
| REVE Chat Account ID | Your numeric REVE Chat Account ID |
| Development environment |
Important: Configure JDK 21 or newer
The REVE Chat repository requires JDK 21.0.8 or newer for successful dependency resolution.
If Gradle uses an older JDK, such as JDK 17, your build may fail with the following error:
PKIX path building failedTo configure the correct JDK:
For Android Studio:
- Open Android Studio.
- Navigate to Settings > Build, Execution, Deployment > Build Tools > Gradle.
- Locate the Gradle JDK setting.
- Select a JDK 21.0.8 or newer installation.
For command-line builds:
Set the JAVA_HOME environment variable to your JDK 21.0.8 or newer installation before running the React Native or Gradle build commands.
Step 1: Add the REVE Chat Maven Repositories
First, configure your Android project to access the REVE Chat SDK dependencies.
Open the project-level Gradle file:
android/build.gradle
Add the following repositories inside the allprojects block, just above:
apply plugin: “com.facebook.react.rootproject”
Code: android/build.gradle
allprojects {
repositories {
maven { url 'https://jitpack.io' }
maven { url "https://maven.iptelephony.revesoft.com/artifactory/libs-release-local/" }
maven { url 'https://jfrog-artifact.revechat.com/artifactory/artifactory/' }
}
}If your project already contains an allprojects block, add the three repository declarations to its existing repositories section instead of creating a duplicate block.
These repositories allow Gradle to locate and download the libraries required by the REVE Chat SDK.
Step 2: Add the REVE Chat SDK Dependency
After configuring the repositories, add the REVE Chat SDK to your Android application’s dependencies.
Open the app-level Gradle file:
android/app/build.gradle
2.1 Enable Data Binding
Inside the existing android { } block, add the following configuration:
android {
// Keep your existing Android settings
buildFeatures {
dataBinding true
}
}Data Binding is required by the SDK to load and manage its chat screens.
Important: Without dataBinding true, the application may close when the REVE Chat screen opens.
2.2 Add the SDK dependency
In the same file, locate the dependencies { } block and add:
dependencies {
// Keep your existing dependencies
implementation('com.revesoft.revechatsdk:revechatsdk:3.4.0')
}This installs REVE Chat Android SDK version 3.4.0.
2.3 Enable Jetifier
Next, open:
android/gradle.properties
Add the following line:
android.enableJetifier=trueThe REVE Chat SDK uses some older Android library dependencies. Enabling Jetifier helps maintain compatibility with AndroidX.
Without this setting, the build may fail with duplicate class errors.
After completing these configurations, your Android project is ready to integrate the native SDK.
Step 3: Create the REVE Chat Native Module
React Native uses native modules to communicate between JavaScript and Android-native code.
To open the REVE Chat screen from your React Native application, create a native module called REVEChatSDKModule.
Navigate to your application’s Java or Kotlin source directory:
android/app/src/main/java/<your/package/path>/Create the module using either Java or Kotlin, depending on your project.
Important: Replace com.yourcompany.yourapp in the examples below with your application’s actual package name. You can find the namespace in android/app/build.gradle.
Option A: Implement the native module using Java
Create a Java file named:
REVEChatSDKModule.java
Add the following code:
package com.yourcompany.yourapp;
import android.content.Intent;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.ReactContextBaseJavaModule;
import com.facebook.react.bridge.ReactMethod;
import com.revesoft.revechatsdk.model.VisitorInfo;
import com.revesoft.revechatsdk.ui.activity.ReveChatActivity;
import com.revesoft.revechatsdk.utils.ReveChat;
/**
* Native module that allows React Native JavaScript
* to communicate with the REVE Chat SDK.
*/
public class REVEChatSDKModule extends ReactContextBaseJavaModule {
REVEChatSDKModule(ReactApplicationContext context) {
super(context);
}
@Override
public String getName() {
return "REVEChatSDKModule";
}
@ReactMethod
public void startChat(
String accountId,
String userName,
String userEmail,
String userPhoneNumber
) {
// Initialize the SDK with your REVE Chat Account ID
ReveChat.init(accountId);
// Create visitor information
VisitorInfo visitorInfo = new VisitorInfo.Builder()
.name(userName)
.email(userEmail)
.phoneNumber(userPhoneNumber)
.build();
// Set visitor information
ReveChat.setVisitorInfo(visitorInfo);
// Open the REVE Chat screen
Intent intent = new Intent(
getReactApplicationContext(),
ReveChatActivity.class
);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
getReactApplicationContext().startActivity(intent);
}
}Option B: Implement the native module using Kotlin
If your project uses Kotlin, create a file named:
REVEChatSDKModule.kt
Add the following code:
package com.yourcompany.yourapp
import android.content.Intent
import com.facebook.react.bridge.ReactApplicationContext
import com.facebook.react.bridge.ReactContextBaseJavaModule
import com.facebook.react.bridge.ReactMethod
import com.revesoft.revechatsdk.model.VisitorInfo
import com.revesoft.revechatsdk.ui.activity.ReveChatActivity
import com.revesoft.revechatsdk.utils.ReveChat
class REVEChatSDKModule(
context: ReactApplicationContext
) : ReactContextBaseJavaModule(context) {
override fun getName(): String = "REVEChatSDKModule"
@ReactMethod
fun startChat(
accountId: String,
userName: String,
userEmail: String,
userPhoneNumber: String
) {
// Initialize the SDK
ReveChat.init(accountId)
// Create visitor information
val visitorInfo = VisitorInfo.Builder()
.name(userName)
.email(userEmail)
.phoneNumber(userPhoneNumber)
.build()
// Set visitor information
ReveChat.setVisitorInfo(visitorInfo)
// Open the REVE Chat screen
val intent = Intent(
reactApplicationContext,
ReveChatActivity::class.java
)
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
reactApplicationContext.startActivity(intent)
}
}How the native module works
Both implementations perform the same operations:
- Initialize the SDK: ReveChat.init(accountId) connects the SDK to your REVE Chat account.
- Create visitor information: VisitorInfo.Builder() prepares the visitor’s name, email address, and phone number.
- Set visitor information: ReveChat.setVisitorInfo(visitorInfo) passes the visitor details to the SDK.
- Open the chat window: ReveChatActivity launches the native REVE Chat interface.
You only need to implement one of these two options.
Step 4: Register the Native Module and Lifecycle Observer
After creating the native module, register it with React Native so that your JavaScript code can access it.
You must also register the REVE Chat application lifecycle observer so the SDK can respond to changes in the application’s foreground and background state.
4.1 Create the REVE Chat package
Create a new file in the same directory as your native module.
Choose either Java or Kotlin.
Option A: Kotlin
File: REVEChatSDKPackage.kt
package com.yourcompany.yourapp
import com.facebook.react.ReactPackage
import com.facebook.react.bridge.NativeModule
import com.facebook.react.bridge.ReactApplicationContext
import com.facebook.react.uimanager.ViewManager
class REVEChatSDKPackage : ReactPackage {
override fun createNativeModules(
reactContext: ReactApplicationContext
): List<NativeModule> =
listOf(REVEChatSDKModule(reactContext))
override fun createViewManagers(
reactContext: ReactApplicationContext
): List<ViewManager<*, *>> =
emptyList()
}Option B: Java
File: REVEChatSDKPackage.java
package com.yourcompany.yourapp;
import com.facebook.react.ReactPackage;
import com.facebook.react.bridge.NativeModule;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.uimanager.ViewManager;
import java.util.Collections;
import java.util.List;
public class REVEChatSDKPackage implements ReactPackage {
@Override
public List<NativeModule> createNativeModules(
ReactApplicationContext reactContext) {
return Collections.<NativeModule>singletonList(
new REVEChatSDKModule(reactContext)
);
}
@Override
public List<ViewManager> createViewManagers(
ReactApplicationContext reactContext) {
return Collections.emptyList();
}
}Note: You can use a Java native module with a Kotlin package or a Kotlin native module with a Java package.
4.2 Register the package in MainApplication
Open your application’s MainApplication file.
For Kotlin-based projects, open:
android/app/src/main/java/<your/package/path>/MainApplication.kt
Locate the PackageList(this).packages.apply { } block.
Add REVEChatSDKPackage() as shown below:
PackageList(this).packages.apply {
add(REVEChatSDKPackage())
}This makes your native module available to React Native through NativeModules.
For Java-based projects using MainApplication.java, add the package inside the getPackages() method:
packages.add(new REVEChatSDKPackage());4.3 Register the REVE Chat lifecycle observer
The REVE Chat SDK needs to monitor when your application moves between foreground and background states.
For this, register the SDK lifecycle observer in the onCreate() method of your MainApplication.
Kotlin implementation
Add the following imports:
import androidx.lifecycle.ProcessLifecycleOwner
import com.revesoft.revechatsdk.utils.REVEChatAppLifecycleObserverInside onCreate(), add:
ProcessLifecycleOwner.get().lifecycle.addObserver(
REVEChatAppLifecycleObserver.INSTANCE
)Complete MainApplication.kt example
The following example shows both the native package registration and lifecycle observer configuration for the React Native version used in the developer’s test environment.
package com.yourcompany.yourapp
import android.app.Application
import androidx.lifecycle.ProcessLifecycleOwner
import com.facebook.react.PackageList
import com.facebook.react.ReactApplication
import com.facebook.react.ReactHost
import com.facebook.react.ReactNativeApplicationEntryPoint.loadReactNative
import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost
import com.revesoft.revechatsdk.utils.REVEChatAppLifecycleObserver
class MainApplication : Application(), ReactApplication {
override val reactHost: ReactHost by lazy {
getDefaultReactHost(
context = applicationContext,
packageList =
PackageList(this).packages.apply {
add(REVEChatSDKPackage())
},
)
}
override fun onCreate() {
super.onCreate()
loadReactNative(this)
ProcessLifecycleOwner.get().lifecycle.addObserver(
REVEChatAppLifecycleObserver.INSTANCE
)
}
}This is a reference implementation for React Native 0.88. If your application already contains additional configurations in MainApplication.kt, preserve them and add only the required REVE Chat changes.
Java implementation
For applications using MainApplication.java, add these imports:
import androidx.lifecycle.ProcessLifecycleOwner;
import com.revesoft.revechatsdk.utils.REVEChatAppLifecycleObserver;Then add the following statement inside the existing onCreate() method:
ProcessLifecycleOwner.get()
.getLifecycle()
.addObserver(REVEChatAppLifecycleObserver.INSTANCE);The native module, package registration, and lifecycle observer are now configured.
Step 5: Open REVE Chat from JavaScript
Once the native Android integration is complete, you can launch REVE Chat from your React Native JavaScript or TypeScript code.
You can connect this functionality to a button on any screen within your application.
Create a component named:
ChatButton.tsx
Add the following code:
import React from 'react';
import {
Alert,
Button,
NativeModules,
Platform,
View,
} from 'react-native';
const { REVEChatSDKModule } = NativeModules;
export default function ChatButton() {
const startChat = () => {
// Check whether the platform is Android
if (Platform.OS !== 'android') {
Alert.alert(
'REVE Chat',
'The REVE Chat SDK is only available on Android.'
);
return;
}
// Check whether the native module is available
if (!REVEChatSDKModule) {
Alert.alert(
'REVE Chat',
'REVEChatSDKModule was not found. Register the module and rebuild the app.'
);
return;
}
// Launch the REVE Chat window
REVEChatSDKModule.startChat(
'YOUR_ACCOUNT_ID',
'Jane Doe',
'[email protected]',
'+15551234567'
);
};
return (
<View>
<Button
title="Chat With Us"
onPress={startChat}
/>
</View>
);
}Configure your account and visitor information
Before running the application, replace the sample values with your own details.
| Parameter | Description | Example |
|---|---|---|
| accountId | Your REVE Chat Account ID | '1234567' |
| userName | Name of the visitor | 'Jane Doe' |
| userEmail | Visitor's email address | '[email protected]' |
| userPhoneNumber | Visitor's phone number | '+15551234567' |
You can pass the details of your logged-in application user to the native module.
If any visitor information is unavailable, you can pass an empty string for that parameter.
Add the button to your application
Import the ChatButton component into the screen where you want users to access live chat.
import ChatButton from './ChatButton';Then render the component:
<ChatButton />When a user taps Chat With Us, the application calls the native module and opens the REVE Chat screen.
Step 6: Build and Run the Application
After completing the native integration, rebuild your React Native Android application.
Run the following command from your project directory:
npx react-native run-androidMake sure Gradle is using JDK 21.0.8 or newer before running the command.
Important: Since this integration introduces native Android code, reloading JavaScript alone will not apply the changes. You must rebuild the application.
Verify the integration
After the application launches:
- Open the screen containing the Chat With Us button.
- Tap the button.
- Confirm that the native REVE Chat screen opens.
- Check that the visitor information is passed to the chat interface.
Depending on your REVE Chat widget configuration, the SDK may display a pre-chat form containing the visitor’s name, email address, and phone number, or open the conversation directly.
If the chat window opens successfully, the basic integration is complete.
Step 7: Configure Release Builds
The previous steps allow you to run the SDK in a debug build. However, additional manifest configuration is required when building a release version.
When generating a release build, you may encounter an Android manifest merge error.
For example:
Manifest merger failed:
Attribute application@usesCleartextTraffic
value=(false) from AndroidManifest.xml
is also present at
[com.revesoft.revechatsdk:revechatsdk:3.4.0]
AndroidManifest.xml value=(true).This occurs because the React Native release configuration and the REVE Chat SDK declare different values for usesCleartextTraffic.
To resolve this conflict, configure the Android manifest merger to use the value defined in your application.
Update AndroidManifest.xml
Open:
android/app/src/main/AndroidManifest.xml
Add the xmlns:tools namespace to your existing <manifest> tag.
Then add tools:replace=”android:usesCleartextTraffic” to your existing <application> tag.
Example:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<application
android:name=".MainApplication"
tools:replace="android:usesCleartextTraffic">
<!-- Keep your existing application components -->
</application>
</manifest>Important: Add these declarations to your existing manifest. Do not replace your application’s other attributes, activities, services, or permissions.
The tools:replace declaration allows the application’s existing usesCleartextTraffic value to take precedence during manifest merging.
You can retain this configuration for both debug and release builds.
Generate the release build
Navigate to your Android project directory and run:
./gradlew assembleReleaseAccording to the developer’s integration testing, release builds using React Native’s default non-minified configuration were successfully built and run on an Android device after applying this manifest change.
Optional Features and Additional Configuration
The steps above are sufficient for basic live chat integration.
Since the React Native integration uses the REVE Chat native Android SDK, you can also configure additional SDK features through the Android project.
For advanced configurations, refer to the REVE Chat Native Android SDK Integration Guide.
Push Notifications
You can configure Firebase Cloud Messaging (FCM) to support REVE Chat push notifications.
Refer to Step 7: Push Notification Implementation in the Native Android SDK guide for Firebase configuration, notification handling, and SDK integration.
Background Service Configuration
The native SDK also includes background service functionality through REVEChatApiService.
For service initialization and lifecycle handling, refer to Steps 3 and 5 of the Native Android SDK guide.
These configurations are separate from the basic chat-launch implementation in this article.
ProGuard and R8 Configuration
If your Android release build uses code minification, additional ProGuard or R8 rules may be necessary.
Refer to Step 9: ProGuard Configuration in the Native Android SDK guide for the required rules.
The basic React Native release configuration covered in this guide was tested without code minification enabled.
Troubleshooting Common Integration Issues
If you experience problems while integrating the REVE Chat SDK, review the following solutions.
1. Build fails with “PKIX path building failed”
Possible cause: Gradle is using an older JDK version that does not recognize the REVE Chat repository’s security certificate.
Solution: Configure Gradle to use JDK 21.0.8 or newer, as described in the prerequisites.
2. Build fails with “Could not resolve com.revesoft.revechatsdk”
Possible cause: The required Maven repositories are missing or unavailable.
Solution: Verify that all three REVE Chat Maven repository entries are present in android/build.gradle.
Also check whether your network, firewall, or proxy allows access to those repositories.
3. Build fails with “Duplicate class android.support.v4…”
Possible cause: Jetifier is not enabled.
Solution: Open android/gradle.properties and add:
android.enableJetifier=trueRebuild the application after saving the changes.
4. Application closes when opening REVE Chat
Possible cause: Android Data Binding is not enabled.
The Android logs may contain an error mentioning DataBinderMapperImpl.
Solution: Open android/app/build.gradle and make sure the following configuration exists inside the android block:
buildFeatures {
dataBinding true
}Save the file and rebuild the application.
5. “REVEChatSDKModule was not found”
Possible cause: The native module has not been registered correctly.
Solution: Confirm that:
- REVEChatSDKModule exists in your Android source directory.
- REVEChatSDKPackage correctly registers the module.
- REVEChatSDKPackage() is added in MainApplication.
- The application has been rebuilt after making the changes.
Reloading JavaScript without rebuilding the Android application will not resolve native module registration issues.
6. Release build fails with a manifest merge error
Possible cause: The SDK and application contain conflicting usesCleartextTraffic declarations.
Solution: Add the following attribute to your application’s <application> tag:
tools:replace="android:usesCleartextTraffic"Make sure the xmlns:tools namespace is also declared in the root <manifest> tag.
7. Build fails because of minSdkVersion
Possible cause: Your application uses an Android minimum SDK version lower than the SDK requirement.
Solution: Set minSdkVersion to 24 or higher in your Android Gradle configuration.
8. Build fails because a library requires a newer compileSdk
Possible cause: Your application’s compile SDK version is lower than the required version.
Solution: Configure compileSdkVersion to 35 or higher in your Android Gradle configuration.
Integration Checklist
Before completing your integration, verify the following configurations:
- Gradle uses JDK 21.0.8 or newer.
- minSdkVersion is set to 24 or higher.
- compileSdkVersion is set to 35 or higher.
- All three Maven repositories have been added.
- REVE Chat SDK version 3.4.0 is included in your app dependencies.
- dataBinding true is enabled.
- android.enableJetifier=true is configured.
- The REVE Chat native module has been created.
- The native package is registered in MainApplication.
- The REVE Chat lifecycle observer is registered.
- Your REVE Chat Account ID and visitor information are configured.
- The application has been rebuilt successfully.
- The chat window opens when the user taps the chat button.
- The release manifest contains the required tools:replace configuration.
Need Help?
The integration steps in this guide were tested using REVE Chat Android SDK 3.4.0 and React Native 0.88, with the New Architecture enabled, on an Android device.
If you experience an issue that is not covered in this guide, contact REVE Chat Support and include your Gradle error output or Android logs (logcat) to help the support team investigate the issue.