StoreKit showManageSubscriptions API

Hi,

How to use showManageSubscriptions() properly from an IBAction in Swift language? Can anyone give me an example code? https://developer.apple.com/documentation/storekit/appstore/3803198-showmanagesubscriptions

    func manageSubscriptionsPage() async {

        // Fetch the current scene, then attempt to show the sheet. If there was an issue, print the error.

        if let scene = view.window?.windowScene {

            do {

                try  await AppStore.showManageSubscriptions(in: scene)

            } catch {

                print("Error:(error)")

            }

        }

    }

    // When called, attempt to present App Store sheet for managing subscriptions from within your app.

    @IBAction func showManageSubscriptionsPage(_ sender: UIButton)  {

        Task {

            await manageSubscriptionsPage()

        }

    }

StoreKit showManageSubscriptions API
 
 
Q