BlazeContentRestrictionReason
BlazeContentRestrictionReason
BlazeContentRestrictionReason is an enum that says why playback of an item was refused. It is passed to onContentRestricted. The full set is exposed rather than a few coarse buckets because the appropriate response differs per reason: offering a purchase prompt on geoBlocked would promise the viewer something paying cannot deliver, and externalUserTokenExpired calls for a fresh token rather than a paywall. Use isRetriable when only the coarse distinction matters.
Reasons added after your SDK version was built arrive as unknown rather than failing.
public enum BlazeContentRestrictionReason: String, CaseIterable, Hashable {
case subscriptionRequired = "SubscriptionRequired"
case geoBlocked = "GeoBlocked"
case vpnBlocked = "VpnBlocked"
case deviceLimitReached = "DeviceLimitReached"
case contentNotAvailable = "ContentNotAvailable"
case externalUserTokenMissing = "ExternalUserTokenMissing"
case externalUserTokenInvalid = "ExternalUserTokenInvalid"
case externalUserTokenExpired = "ExternalUserTokenExpired"
case rateLimited = "RateLimited"
case temporarilyUnavailable = "TemporarilyUnavailable"
case unknown = "Unknown"
public var isRetriable: Bool { get }
}| Value | Description |
|---|---|
| subscriptionRequired | The viewer needs a subscription to watch this content. |
| geoBlocked | The content is not available in the viewer's region. |
| vpnBlocked | The request appears to come through a VPN or proxy. |
| deviceLimitReached | The viewer is already streaming on the maximum number of devices. |
| contentNotAvailable | The content is not available for playback, including when the service answers without a playable URL. |
| externalUserTokenMissing | No viewer token was supplied, so entitlement cannot be established. |
| externalUserTokenInvalid | The supplied viewer token was rejected. |
| externalUserTokenExpired | The supplied viewer token has expired; the host app should provide a fresh one. |
| rateLimited | Too many requests. Worth retrying later. |
| temporarilyUnavailable | The service is briefly unavailable, or the SDK could not get an answer from it (for example a network failure or an unexpected server response). Worth retrying later. |
| unknown | The reason could not be recognized, including reasons added after this SDK version. |
When the SDK could not get an answer at all, or the answer carried no playable URL, the item is not held as refused: the SDK asks about it again the next time the viewer reaches it, rather than on a timer.
isRetriable
isRetriable is a convenience for when only the coarse distinction matters: whether the same request could succeed later without anything changing for the viewer. It is true only for the transient cases (rateLimited, temporarilyUnavailable). A subscription or region problem does not resolve by retrying, so it is false there. The SDK does not retry by itself; acting on a retriable reason is your decision.
Updated 4 days ago
