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

  • 8 May 2022
  • 1 reply

Badge +2

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



(lldb) po transaction


1 reply


Check the login method, there is a chance that you login user with the template name (“not_found” or something like that) which has the subscription and sdk gives the user premium content.