Testing In-App Purchase Products
You can test your app and In-App Purchase products without creating financial transactions. That’s because Apple provides a test environment that uses the infrastructure of the App Store but that doesn’t process actual payments. Using iTunes Connect test user accounts, it instead returns transactions as if payments were processed successfully.
For more information about what tests to perform, see “Suggested Testing Steps” in In-App Purchase Programming Guide.
Testing Your App and In-App Purchase Products
Use a test user account when you test In-App Purchase products.
You’ll need a test user for each territory you want to test the app in.
Clear any account information stored on your test device.
In Settings, go to the Store settings.
Click the Sign Out button.
This prevents an actual user account from automatically being used when testing.
Connect your test device to your Mac.
In Xcode, set your test device as your scheme’s destination.
Open your app, and perform your In-App Purchase product testing.
Use your test account credentials to test the purchase.
When your app uses the Store Kit API to request a payment, you’re asked to sign in. Select Use Existing Account and enter your test account user name and password. You are then asked to confirm the purchase. The transaction completes.
No financial transaction takes place, but a receipt is generated for a successful transaction.
Testing Auto-Renewable Subscriptions
When testing auto-renewable subscriptions in the test environment, keep in mind that the duration times are compressed. Additionally, test subscriptions only auto-renew a maximum of six times. Table 3-1 lists the compressed duration times.