Passing custom guest attributes to Genesys Cloud Web Messaging SDK via Kotlin

I’m integrating the Genesys Cloud Web Messaging SDK into an Android app built with Kotlin. The goal is to send custom attributes like userTier and sessionId from the native app to the Genesys Cloud platform when a guest session starts.

I’ve initialized the widget using GenesysMessaging.init() and set the organizationId correctly. The widget loads and I can see the chat bubble in the UI. However, when I try to set the guest attributes before the session starts, they don’t seem to persist or show up in the Architect flow as expected.

Here’s the Kotlin code I’m using to set the attributes:

val guestAttributes = mapOf(
 "userTier" to "gold",
 "sessionId" to System.currentTimeMillis().toString()
)
GenesysMessaging.setGuestAttributes(guestAttributes)
GenesysMessaging.startSession()

I’ve also tried passing these attributes directly in the startSession() call if there’s an overload, but the SDK docs are a bit sparse on the exact method signature for Kotlin. The session starts successfully, and I can verify the conversationId is generated. But when I check the Architect flow, the participantData doesn’t contain the userTier or sessionId keys.

I’ve checked the Genesys Cloud UI under the active conversation, and the attributes are missing there too. I’m wondering if setGuestAttributes() needs to be called on a specific thread, or if there’s a different method I should be using to attach custom data to the guest profile before the session begins.

Also, I’m seeing a warning in the logs: W/GenesysMessaging: Guest attributes set after session initialization may not be applied. I’m calling setGuestAttributes() right before startSession(), so timing shouldn’t be the issue, but maybe the order of operations is wrong.

Has anyone successfully passed custom attributes from a Kotlin Android app to the Genesys Cloud Web Messaging SDK? What’s the correct method call sequence?