Testing In App Purchases on iOS
Before testing you must follow all the other steps for creating in app purchases.
- Create a sandbox tester on app store connect
- Login as the sandbox tester
- Rebuild your app with a development certificate and install on your device (cannot be a wildcard)
- Test the in app purchase
Create a Sandbox Tester on App Store Connect
If you'd like to test this purchase, you need to create a Sandbox Tester.
Go to the top main menu and select Users and Access. Click Sandbox Testers, and add a new one.
Keep track of your email and password, you will need this to test your in app purchase.
When you are testing in app purchases, you do not need to use the release version of your app. You can go to PhoneGap Build and change the signing key back to your developer cert and then download it using the QR code like normal.
Login to Your Sandbox Account on Your iOS Device
Go to settings, click your profile picture at the top.
Go to iTunes & App Stores, and scroll to the bottom. You should see Sandbox Accounts like in the image below.
Click sign in, and login with the email and password you created on app store connect.
Test the Purchase
Finally, build the app in PhoneGap Build with a development certificate and provisioning profile.
- Your device must be on the profile
- It cannot be a wildcard profile, it must use your app ID
- The app ID must have in app purchases enabled
Install the app on your device by scanning the QR code, then test the purchase.
You can use any email/user/pass in the purchase form, then try the purchase. It should say [Sandbox Environment] at the bottom, then you should have to confirm your purchase.
If you do not see any errors, you are good to go.