Signature
Parameters
Returns
AnyPublisher<Bool, Never> - A publisher that emits true when the entitlement becomes active and false when it becomes inactive.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Reactive entitlement state updates using Combine
public func isActivePublisher(
for type: Entitlement,
in scope: EntitlementScope = .all
) -> AnyPublisher<Bool, Never>
| Name | Type | Description |
|---|---|---|
type | Entitlement | The entitlement type to observe |
scope | EntitlementScope | The scope to check |
AnyPublisher<Bool, Never> - A publisher that emits true when the entitlement becomes active and false when it becomes inactive.
// Automatically update when state changes
Encore.shared
.isActivePublisher(for: .freeTrial(), in: .verified)
.sink { isActive in
// Called whenever the state changes
}
.store(in: &cancellables)