Live Chat SDK Kotlin
Configuration
Using Java 11 or Android API 26 and above.
To use the DolphinLiveChat SDK library, please follow these steps :
You need to import our library into yourr project
You can assamble dolphin lib and get arr file. (In android studio: Gradle-> Expand dolphinlib-> build -> double click assemble)
After the build is complete, you will get the aar location
Move the file to the “libs” folder of the client-app
You need to add some dependencies to your milk app .gradle file. Then, sync to compile 3Dolphins SDK. For example, include DolphinLiveChat into your project by placing it in the libs/ folder for example, as a Gradle compile dependency.
Create Instance
You must have the server url, client id, and client secret for the application before proceeding with authentication
This initialization only needs to be performed once during the application's lifecycle and can be applied at the initial startup. Here’s how to do it:
Connect to Server
You need to initialize the Dolphin connector. Here's how to do it :
Explanation Component:
DolphinProfile
Represents the identify of the user initiating the chat
username
Represents the name of the user
Represents the user's email
phoneNumber
Represents the user's phone number
uid
Used to determine whether this user session will create a new ticket or not
If you have additional fields to be sent to the sever, you can include the in customVariables. Below is an example of customeVariableas (JsonArray)
After successfully initializing the Dolphin connector, you can authenticate to the server using :
Event Handler
The DolphiChat SDK uses EventBus to broadcast events throughout the application. You need register the object that will receive events from EventsBus. You can call it as follows :
You can put this code in onResume(), onCreate() or onStart() method
Once you no longer need to capture the event, you should unregister the receiver by calling this method
You can put this code in onDestroy() method
Receive Message
To receive message, do the following :
Send Message
Send Media Message
Binaries
Required dependencies for the 3Dolphins application
Last updated
Was this helpful?