How do I ensure entitlements.isActive is false when the user cancels transaction?


Badge +1

Good day…

 

I am trying to ensure that when a user cancels their transaction (ie. is shown the iOS wallet / purchase sceen, clicks cancel) they are not provided with benefits of a subscribed user. At this time, I am following the suggestion of the example weather app which uses the below method…

 

@Published var customerInfo: CustomerInfo? { didSet subscriptionActive = customerInfo?.entitlements[entitlementID]?.isActive == true }}

How is a subscription active if they have cancelled the transaction and the transaction is nil?

 

(lldb) po customerInfo?.entitlements["hb-2022-premium"]?.isActive

▿ Optional<Bool>

  - some : true

 

(lldb) po transactionCancelled

true

 

(lldb) po transaction

nil


0 replies

Be the first to reply!

Reply