GuidesAPI ReferenceRelease Notes
HomeLog InHome
Guides

BlazeFetchedContentPolicy

BlazeFetchedContentPolicy

BlazeFetchedContentPolicy tells the SDK what to do with content it already fetched when the viewer token changes. It is passed to setExternalUserToken.

A token change does not say by itself what happened. Signing in, switching to a different account, and refreshing an expiring token all arrive through the same setter and call for different behaviour. The host is the only side that knows which one it is, so it selects the policy.

sealed interface BlazeFetchedContentPolicy {
    data object Evict : BlazeFetchedContentPolicy
    data object Keep : BlazeFetchedContentPolicy
}
ValueWhen to use
EvictThe viewer identity itself changed (sign-in, switching accounts). The SDK discards content fetched so far and fetches it again for this viewer. Entry points go empty until the refetch lands.
KeepThe viewer stayed the same and only the token was replaced (a routine refresh of an expiring token). Nothing on screen changes.
// Signing in or switching accounts:
BlazeSDK.setExternalUserToken(newToken, BlazeFetchedContentPolicy.Evict)

// Refreshing an expiring token for the same viewer:
BlazeSDK.setExternalUserToken(refreshedToken, BlazeFetchedContentPolicy.Keep)

Did this page help you?