UserContextApi
Use this API to access and listen to the user's context.
UserContextApi API
addUserContextUpdateListener()
addUserContextUpdateListener()
Adds a listener that will be invoked when the user's current context is updated. The user context updates delivered by this listener will not be filtered according to any (user context) criteria and will not include any provisional events (see isProvisional).
If the listener instance provided has been previously added, then it will be replaced. The user context criteria of interest (for the said listener) will also be replaced.
Calling this function has the same effect as calling
addUserContextUpdateListener(false, listener)
.Note: calling this method on an uninitialized SDK will throw an SdkException.
listener
addProvisionalAwareUserContextUpdateListener()
addProvisionalAwareUserContextUpdateListener()
Adds a listener that will be invoked when the user's current context is updated. The user context updates delivered by this listener will not be filtered according to any (user context) criteria, and may include provisional events (see isProvisional).
If the listener instance provided has been previously added, then it will be replaced. The user context criteria of interest (for the said listener) will also be replaced.
Calling this function has the same effect as calling
addUserContextUpdateListener(false, listener)
.Note: calling this method on an uninitialized SDK will throw an SdkException.
listener
addUserContextUpdateListener()
addUserContextUpdateListener()
Adds a listener that will be invoked when the user's current context is updated. You can filter the context criteria you are interested in.
The user context updates delivered by this listener will not include any provisional events (see isProvisional).
If the listener instance provided has been previously added, then it will be replaced. The user context criteria of interest will also be replaced.
Calling this function has the same effect as calling
addUserContextUpdateListener(false, criteria, listener)
.Note: calling this method on an uninitialized SDK will throw an SdkException.
criteria
listener
addProvisionalAwareUserContextUpdateListener()
addProvisionalAwareUserContextUpdateListener()
Adds a listener that will be invoked when the user's current context is updated. You can filter the context criteria you are interested in.
The user context updates delivered by this listener may include provisional events (see isProvisional).
If the listener instance provided has been previously added, then it will be replaced. The user context criteria of interest will also be replaced.
Calling this function has the same effect as calling
addUserContextUpdateListener(false, criteria, listener)
.Note: calling this method on an uninitialized SDK will throw an SdkException.
criteria
listener
requestUserContext()
requestUserContext()
Retrieves the user's current context. Provisional events are not included in the result (see isProvisional).
Note: calling this method on an uninitialized SDK will throw an SdkException.
requestUserContextIncludingProvisionalEvents()
requestUserContextIncludingProvisionalEvents()
Retrieves the user's current context. Provisional events may be included in the result (see isProvisional).
Note: calling this method on an uninitialized SDK will throw an SdkException.
removeUserContextUpdateListener()
removeUserContextUpdateListener()
Removes a previously set user context update listener.
Note: calling this method on an uninitialized SDK will throw an SdkException.
listener
Last updated