Track who your users are and what they do in your mobile app and Customize the Salesmate Chat Messenger. Here’s how to configure Salesmate Chat for Android:
Update your User
- When you call a login method we create a user with his basic detail, after if you want to change his basic detail then you can use update user functionality as per below code snippet:
// Prepare a user's detail objectval userDetail=UserDetails.create()val email="user's email address"val firstName="user's first name"val lastName="user's last name"val userId="user's user id"// Unique id recommendeduserDetail.withEmail().withFirstName(firstName).withLastName(lastName)
SalesmateChatSDK.getInstance().update(userId, userDetail, object : UpdateListener {
override fun onUpdate() {
// Update successfully
}
override fun onError(salesmateException: SalesmateException) {
// Error on update
}
})
Submit an Event
- You can log events in Salesmate Chat that record what users do in your app and when they do it. For example, you could record the item a user ordered from your mobile app, and when they ordered it.
// Prepare a record event object
val data = hashMapOf<String, String>()
data["orderId"] = "order id"
data["productId"] = "product id"
val eventName = "order_detail"
SalesmateChatSDK.getInstance().recordEvent(eventName, data)
Create a Custom Launcher
- However, if you’d like Messenger to open from another location in your mobile app, you can create a custom launcher. This allows you to specify a button, link, or element that opens Messenger. For example, you can trigger the launcher to open when a customer clicks on your ‘Ask for support’ button.
- If you have a custom launcher, you can call:
// To launch messenger
SalesmateChatSDK.getInstance().startMessenger()
Comments
0 comments
Please sign in to leave a comment.