Clearing purchases from iOS in-app purchase sandbox for a test user

前端 未结 8 985
臣服心动
臣服心动 2020-12-02 07:18

Does anyone have any ideas on how to reset and/or clear the iOS in-app purchase sandbox?

I have an app that I\'m testing with the sandbox, and I\'d like to test new

8条回答
  •  旧时难觅i
    2020-12-02 08:11

    Just keep using the same test account, restoring purchases as opposed to completing new ones. After all, whether you start a new purchase or restore an old one, YOUR APP will do the same thing (at least initially, maybe the user interface will update differently upon completion). Apple are the folks handling things differently in those different situations - don't worry about it.

    Place your delivery logic in the SKPaymentTransactionStateRestored case within this method's implementation for testing:

    - (void)paymentQueue:(SKPaymentQueue *)queue
     updatedTransactions:(NSArray *)transactions;
    

    Then be sure to put that delivery logic into the SKPaymentTransactionStatePurchased case.

    At the end, because most of us are obsessive-compulsive to varying degrees, do a final test with a fresh account (not a big deal to make a second one for absolute certainty).

    The final thing to note: consider apple's position. If there was a problem with developers having to waste time creating tens or hundreds of accounts to test IAP thoroughly, they would have solved the problem. There is no problem.

提交回复
热议问题