Brand Messenger Android SDK Conversation (APAC)

Learn how to initiate chat with an agent in the Brand Messenger Android SDK

Initiate Chat with Agent

For starting the messaging activity, using the following script:;;

If the environment is also configured with Welcome-Messages, the following can be used instead of show(context). This will also send an API request to give the user a welcome-message.


To just send the welcome-message API request without displaying the conversation screen, use the following


Intercept Message Actions

Message actions from SDK conversation screen, such as user tapping on link-buttons, can be intercepted and handled outside of the SDK via a delegate.

BrandMessengerManager.setMessageActionDelegate(new KBMMessageActionDelegate() {
    public boolean onAction(Context context, String action, Message message, Object object, Map<String, Object> replyMetadata) {
        switch (action) {
            // Example action types
            case KBMRichMessage.SUBMIT_BUTTON:
            case KBMRichMessage.QUICK_REPLY:
            case KBMRichMessage.TEMPLATE_ID + 9:
            case KBMRichMessage.WEB_LINK:
                // URL link data is in object.url.
                return true;
        // Return false to let SDK handle action. True if action is handled here.
        return false;
BrandMessengerManager.setMessageActionDelegate( object : KBMMessageActionDelegate {
    override fun onAction(
        context: Context?,
        action: String?,
        message: Message?,
        `object`: Any?,
        replyMetadata: MutableMap<String, Any>?
    ): Boolean {
        when (action) {
            KBMRichMessage.SUBMIT_BUTTON -> return false
            KBMRichMessage.QUICK_REPLY -> return false
            KBMRichMessage.TEMPLATE_ID -> return false
            KBMRichMessage.WEB_LINK -> {
                // handle link.
                return true
        return false;

Did this page help you?