Zhenyi Tan And a Dinosaur

A silhouette of a T. rex A silhouette of a person running

Gotchas of Testing Subscriptions with Sandbox, Part 1

When you need to test in-app purchases in your apps, Apple lets you create sandbox tester accounts, so you don’t have to create real Apple IDs just to test the purchase flow.

But when you try to pay for in-app purchases with the sandbox account, the process is a bit weird:

  1. You sign in with the sandbox account.

    A “Sign in with Apple ID” dialog with empty Apple ID and password fields.

  2. A sheet slides up, and you tap Subscribe.

    A sandbox purchase sheet for Capsule Account - Yearly, with a Subscribe button.

  3. You enter the password for the sandbox account. (Didn’t you just sign in?)

    A sandbox sheet asking for the account password to authorise the transaction.

  4. The subscription appears successful.

    The sandbox purchase sheet showing a checkmark and the word “Done.”

  5. The subscription sheet slides up again, and you tap Subscribe again. (???)

    The sandbox purchase sheet with the Subscribe button, shown a second time.

  6. You enter the password for the sandbox account again.

    The sandbox password prompt, shown a second time.

  7. The Done animation shows up again.

    The sandbox purchase sheet showing the checkmark and “Done” a second time.

  8. An alert pops up, saying the subscription is finally successful.

    An alert reading “You’re all set. Your purchase was successful.”

Now, it’s not a bug in your code and will not happen in production. So I guess it’s… fine?