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. There is deliberately no default.

public enum BlazeFetchedContentPolicy {
    case evict
    case keep
}
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. A widget on screen refetches on its own; an open full-screen player keeps its content until it next reloads, so dismiss and reopen it if the switch has to show there too.
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:
Blaze.shared.setExternalUserToken(newToken, cachedContentPolicy: .evict)

// Refreshing an expiring token for the same viewer:
Blaze.shared.setExternalUserToken(refreshedToken, cachedContentPolicy: .keep)

Did this page help you?