Unable to make a sandbox purchasing with SubscriptionStoreView

Hi I'm writing my first in-app purchase app, and I'm trying to do some testing with sandbox accounts. I wrote my subscription page use SwiftUI SubscriptionStoreView. And I read the documentation it says :

  • The sandbox account appears in Settings > App Store after the first time you use the device to attempt a purchase in a development-signed app.

But I have no idea how to make a sandbox purchasing. Every time I click the subscription button it just making a purchase in xcode environment. Did I missed anything? What can I do to make a sandbox pruchasing?

The sandbox account section finally appears in my Settings > App Store. But I still couldn't find a way to make a sandbox purchase. I've already login a sandbox account in the sandbox section. But when I click the subscription button it still shows [Environment: xcode]

But when I click the subscription button it still shows [Environment: xcode]

The above indicate that you testing in-app purchases in the local environment. StoreKit uses the local environment when StoreKit Testing in Xcode is enabled in your Xcode project and the sandbox, when it is disabled.

how to make a sandbox purchasing.

Disable StoreKit Testing in your Xcode project to test your in-app purchases in the sandbox. For more information, see Testing at all stages of development with Xcode and the sandbox and Testing In-App Purchases with sandbox.

Unable to make a sandbox purchasing with SubscriptionStoreView
 
 
Q