Can an App detect a subscription's cancellation in itself?

StoreKit2 provide great API AppStore.showManageSubscription(in:) to downgrade, upgrade or cancel the user's subscription, however, can the App detect the cancellation in App? (without server to server notification)

I understand the upgrade and downgrade can be detected in Transaction.updates, but I'm not sure about the cancellation.

I want to update my label's text from Next billing date: \(date) to Expires \(date) if the user cancels the subscription in showManageSubscription(in:) sheet.

Can I implement that?

Hi, I'm in the same situation as you. did you find a solution?

Fortunately, I found a solution! A @MainActor static func showManageSubscriptions(in scene: UIWindowScene) async throws suspends the task until the user selects "Done" or "Cancel" in the manage subscription screen, so you can manually check the updated state in the next line.

Task {

    do {

        // The method suspends the execution until the user selects "Done" or "Cancel"
        try await AppStore.showManageSubscriptions(in: view.window!.windowScene!)

        // The line is executed after dismissing the screen. You can check the latest state of your app's subscription, then update your UI.
        await checkAndUpdateAppSubscriptionStateI()

     } catch let storeKitEerror as StoreKitError {

      // Error handling

     }

}

I'm in the same situation. Your solution does work, but it's based on manual intervention.

I would like my app to be informed of subs renewing, cancellation, refunds, billing issues etc...all the stuff a proper app would want, in order to make business decisions. I'm not using my own server, so I want to do all of this within my app. In my (limited) experience, this info doesn't appear to get posted via Transaction.currentEntitlements

Looking at the Transaction Manager in Xcode, entries in the log update automatically when things change. Apple are either polling for this, or they have a notification solution that I've so far been unable to discover. I've tried listening for subscription status changes, but my listener never fires for the above listed cases.

You can manually get some stuff if you call Transaction.all and wade through it. When you call it, it does often cause any listeners you've set up to fire, leading me to believe there are some synch issues there.

Can an App detect a subscription's cancellation in itself?
 
 
Q