Messenger Account
A concrete account configuration for connecting to a Genesys Cloud Messenger deployment.
MessengerAccount encapsulates all the configuration needed to establish a chat session, including the deployment identifier, domain, authentication credentials, and custom attributes.
Usage:
val account = MessengerAccount(
deploymentId = "your-deployment-id",
domain = "your-domain",
context = applicationContext, // required for journey context / tracking
).apply {
logging = true
sessionExpirationNoticeInterval = 300
}
// Optionally configure authentication
account.setAuthenticationInfo(
authCode = authorizationCode,
redirectUri = "myapp://callback",
codeVerifier = pkceVerifier
)
// Optionally initiate Mobile Tracking (requires Context above)
account.initiateTracking(
TrackingConfig(
appName = "MyApp",
appNamespace = "com.example.app",
appVersion = "1.0.0",
appBuildNumber = "1",
deviceCategory = DeviceCategory.MOBILE,
deviceType = "phone",
osFamily = "Android",
osVersion = "14",
)
)
val chatController = ChatController.Builder(context)
.chatEventListener(this)
.build(account, chatLoadedListener)Important: The deploymentId and domain must match a valid Genesys Cloud Messenger deployment. An incorrect configuration will result in connection errors.
Constructors
Properties
The current authorization code authentication info, or null if not configured.
Custom attributes associated with the chat session.
Deployment identifier, containing configuration and routing information for the Genesys Cloud Messenger deployment this account connects to.
true when implicit authentication was configured via setImplicitAuthenticationInfo.
Provider consumed by the transport at session configure. Returns a JourneyContextInfo carrying the device cookie (when a Context was supplied) and the journey session id (when a tracking session exists). Returns null - so the journey context is omitted - when no cookie provider is available.
Session expiration notice interval in seconds. Specifies how many seconds before session expiration the SDK should display a notice. Defaults to 300 seconds (5 minutes) if not set.
The active Mobile Tracking adapter, or null if tracking has not been initiated.
Functions
Attaches (or replaces) a Mobile Tracking adapter to this account. No network calls are made until the first event is fired. May be called any time after construction.
Host-controlled reset of the tracked visitor: clears the customer identifiers (external id and traits) and the journey session id on the active tracker, and rotates the device cookie used to identify the user. The tracker instance itself is preserved. Clearing identifiers is a no-op when tracking has not been initiated, but the device cookie is rotated regardless.
Configures authorization code authentication for the chat session.
Configures implicit (ID token) authentication for the chat session.