SubscriptionStoreView - Restoring Subscriptions

I'm using code similar to the following to conditionally show the SubscriptionStoreView and the .storeButton(.visible, for: .restorePurchases) modifier is used to allow the user to restore an existing subscription.

How can I listen for events that would allow me to close this view once the subscription is restored?

The .onInAppPurchaseCompletion closure does not handle this and it also appears that listening for results in Transaction.currentEntitlements also doesn't handle the fact that a subscription is restored.

Any guidance on how to determine if the subscription has been restored would be greatly appreciated.

Finally, how can this be tested effectively in both TestFlight and in Xcode with the simulator.

if subscriptionManager.subscription == .none {
                    SubscriptionStoreView(groupID: "1234567") {
                          SubscriptionMarketingView(transparency: false)
                            .containerBackground(for: .subscriptionStoreFullHeight) {
                                GradientBackground()
                            }
                    }
                    .backgroundStyle(.clear)
                    .storeButton(.visible, for: .restorePurchases)
                    .storeButton(.visible, for: .redeemCode)
                    .onInAppPurchaseCompletion { product, result in
                        Task {
                            await subscriptionManager.entitlements()
        }
    }
} 
SubscriptionStoreView - Restoring Subscriptions
 
 
Q