We’re trying to implement authenticated messaging in our Android app using the Genesys Cloud Web Messaging SDK. The goal is to pass custom guest attributes (like userId and role) so they show up in the conversation logs and can be used for routing.
I’m following the pattern where I first fetch a guest token from our backend, then call loginGuest on the SDK. The login seems to succeed since the UI changes to the authenticated state, but when I check the conversation in the Admin console, the custom attributes are missing or reset to defaults.
Here’s the relevant Kotlin code:
val guestToken = fetchGuestTokenFromBackend() // Returns valid JWT
val attributes = mapOf(
"userId" to "user_12345",
"role" to "premium_customer"
)
val guest = Guest(
id = null, // SDK generates this
name = "Test User",
email = "test@example.com",
attributes = attributes
)
webMessagingSdk.loginGuest(guest, guestToken) {
Log.d("Messaging", "Login success")
}
I’ve also tried setting the attributes directly via setGuestAttributes after login, but they don’t stick either. I’m using SDK version 2.1.0. The token validation seems fine because the session starts. Is there a specific format required for the attributes map, or do I need to use a different API endpoint to push these custom fields?
The standard name and email fields populate correctly, but anything in attributes vanishes.