Links

UserContextApi

Use this API to access and listen to the user's context.

UserContextApi API

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
Text
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
Text
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.
Note: calling this method on an uninitialized SDK will throw an SdkException.

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.