Signature
Parameters
Returns
Returnstrue if the specified entitlement is currently active for the user, false otherwise.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Asynchronously check if an entitlement is currently active with automatic smart refresh
public func isActive(
_ type: Entitlement,
in scope: EntitlementScope = .all
) async -> Bool
| Name | Type | Description |
|---|---|---|
type | Entitlement | The entitlement type |
scope | EntitlementScope | The scope to check (.all includes provisional grants; .verified refreshes against the backend’s verified set) |
true if the specified entitlement is currently active for the user, false otherwise.
Task {
let hasTrial = await Encore.shared.isActive(.freeTrial(), in: .all)
if hasTrial {
// User has an active free trial
showPremiumFeatures()
} else {
// User doesn't have a free trial
showUpgradePrompt()
}
}
isActivePublisher() instead.