subscriptionStatus
A published property that indicates the subscription status of the user.
If you're using a custom PurchaseController
, you must update this property whenever the user's entitlements change.
You can also observe changes via the SuperwallDelegate
method subscriptionStatusDidChange(from:to:)
.
Purpose
Indicates the current subscription status of the user and can be observed for changes using Combine or SwiftUI.
Signature
Parameters
This property accepts a SubscriptionStatus
enum value:
.unknown
- Status is not yet determined.active(Set<Entitlement>)
- User has active entitlements (set of entitlement identifiers).inactive
- User has no active entitlements
Returns / State
Returns the current SubscriptionStatus
. When using a PurchaseController
, you must set this property yourself. Otherwise, Superwall manages it automatically.
Usage
Set subscription status (when using PurchaseController):
Get current subscription status:
Observe changes with Combine:
SwiftUI observation:
How is this guide?