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 Flutter Android SDK with your mobile app, please follow the below mentioned steps:
Add the Flutter 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 project build.gradle, you can add the repositories
# Add project specific ProGuard rules here.# Bydefault, the flags in this file are appended to flags specified# in E:\Android_Studio\sdk/tools/proguard/proguard-android.txt# You can edit the include path and order by changing the proguardFiles# directive in build.gradle.## For more details, see# http://developer.android.com/guide/developing/tools/proguard.html# Add any project specific keep options here:# If your project uses WebView with JS, uncomment the following# and specify the fully qualified classname to the JavaScript interface# class:#-keepclassmembers classfqcn.of.javascript.interface.for.webview {# public*;#}-keep classcom.revesoft.revechatsdk.** {*;}-keep interfacecom.revesoft.revechatsdk.** { *; }-keep enumcom.revesoft.revechatsdk.** { *; }-dontwarn com.revesoft.revechatsdk.**-keep classorg.webrtc.** { *; }-keep classorg.webrtc.voiceengine.** { *; }-dontwarn org.webrtc.**
Step 4
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 idReveChat.init("account id");LoginState loginState =LoginState.LOGGED_OUT;boolean doNotShowPreChatForm =true;/** * if the application doesn't need to show the pre-chat form then needs to set as * loginState = LoginState.LOGGED_IN */if (doNotShowPreChatForm) loginState =LoginState.LOGGED_IN;//Creating visitor infoVisitorInfo visitorInfo =new VisitorInfo.Builder().name("your name").email("your@email.com").phoneNumber("your number").appLoginState(loginState).build();//Set visitor infoReveChat.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 windowstartActivity(new Intent(this,ReveChatActivity.class));
Code for KOTLIN
//Initializing with account idReveChat.init("account id")var loginState : LoginState= LoginState.LOGGED_OUTvar doNotShowPreChatForm =true/** * if the application doesn't need to show the pre-chat form then needs to set as * loginState = LoginState.LOGGED_IN */if (doNotShowPreChatForm) loginState = LoginState.LOGGED_IN//Creating visitor infoval visitorInfo: VisitorInfo= VisitorInfo.Builder() .name("your name") .email("your@email.com") .phoneNumber("your number") .appLoginState(loginState) .build()//Set visitor infoReveChat.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 windowstartActivity(Intent(this, ReveChatActivity::class.java))