FAQ
Data Explorer
UserContextApi
This class is part of an Early Access feature, and is subject to change in the future.
Use this api to access and listen to the user's context.

UserContextApi

addUserContextUpdateListener()

void addUserContextUpdateListener(UserContextUpdateListener listener)
Adds a listener to handle updates to the user's context.
Note: calling this method on an uninitialized SDK will throw an SdkException.
Parameters
listener
A UserContextUpdateListener that gets triggered when the user context has changed.

addUserContextUpdateListener()

void addUserContextUpdateListener(List<UserContextUpdateCriteria> criteria, UserContextUpdateListener listener)
Adds a listener to handle updates to the user's context, with the option of filtering the context criteria.
Note: calling this method on an uninitialized SDK will throw an SdkException.
Parameters
criteria
A list that filters which UserContextUpdateCriteria to return.
listener
A UserContextUpdateListener that gets triggered when the user context has changed.

requestUserContext()

PendingOperation<UserContext, RequestUserContextError> requestUserContext()
Retrieves the user's current context.

removeUserContextUpdateListener()

void removeUserContextUpdateListener(UserContextUpdateListener listener)
Removes a previously set user context update listener.
Note: calling this method on an uninitialized SDK will throw an SdkException.
Parameters
listener
A UserContextUpdateListener that gets triggered when the user context has changed.
Copy link
On this page
UserContextApi
addUserContextUpdateListener()
addUserContextUpdateListener()
requestUserContext()
removeUserContextUpdateListener()