[Solved] How to reset the purchased state on a device? Once purchased, I can't return the device to non-purchased state.

Solved: I didn’t need to do anything after all. iTunes Connect seems to reset the purchase status of the test user every now and then. I haven’t really paid attention to the frequency, but it’s often enough for me to test the purchasing experience as I make changes to how I set up my In-App Purchase.

Naomi


Original post here:

I set up an In-App Purchase, and I tested in iTunes Connect Sandbox with test user 1. After test user 1 has successfully purchased the product, I am unable to revert the device back to the state where no purchase has been made.

Here’s what I’ve tried:

Fact 1) I have store.init (transactionCallback) and transactionCallback(event) function in main.lua

Fact 2) transactionCallback function includes the standard if-statement that checks the status of event.transaction.state along with the print-statement, letting me know what it returns.

Step 1) Test User 1 successfully bought the product.

Step 2) Deleted the ad hoc build from the device on which Test User 1 bought the product.

Step 3) Created Test User 2 in iTunes Connect.

Step 4) Build and installed the new ad hoc build to the device.

Step 5) Checked to make sure the device isn’t signed in by any user.

Step 6) Launched the game app on the device.

Step 7) As I monitor the terminal, I see that event.transaction.state is in “purchased” status. Because it’s now always in “purchased” status, I can’t check/test how my game should look & behave before & after the transaction, including what I want it to look when transaction fails or cancelled, etc.

How can I revert the “purchased” state to non-purchased state on a test device to test In-App Purchase in the sandbox environment? I need to tweak, update and test the store purchase experience. I don’t think it’s expected of any developers to have dozens and dozens of fresh device to test this. There must be a setting or function that I’m missing.

I’d very much appreciate any and all help. If you have key words suggestions for me to use in google search to find the solution to this problem, I’d be so happy to hear about it too. [import]uid: 67217 topic_id: 16526 reply_id: 316526[/import]

It’s not perfect but why don’t you just create a new test id and never actually “purchase” the item during your tests? Have one for purchased and one for not purchased. [import]uid: 23649 topic_id: 16526 reply_id: 63063[/import]

Hey Jeremy, thanks for the note. The device with which I went through the entire purchase process in the sandbox refuses to go back to non-purchased state – even after I created two additional test users in iTunes Connect. It’s a pity. I really want to fine tune the purchase experience, but it seems like it’s one shot deal. (Unless there’s something I’m not aware of… and if so, I’d love to hear how to go about testing this thing properly.)

So, with other device I have, I do not dare go through the purchase process. I’ll wait until I have the final build that I’m ready to truly submit for review, and then, do the final In-App Purchase test.

This feels very wrong, though. What if the final test reveals some issues that I’d need to fix?

Naomi [import]uid: 67217 topic_id: 16526 reply_id: 63068[/import]

Ah sorry I didn’t read your note fully I guess. I’ve been having some odd issues with iTunes test users (besides dealing with my own mistakes with in apps) today which could be causing your
issues.

This thread has some advice on how to reset the device but I think you’ll need xcode: http://stackoverflow.com/questions/1660886/how-to-test-in-app-purchase-again-and-again-and-again

If that doesn’t work one last think I can think of would to just create a new in app purchase (or create a bunch) and just change the code in the app and test that. [import]uid: 23649 topic_id: 16526 reply_id: 63071[/import]

Thank you, Jeremy. I use XCode just to install device build and monitor the console to see if there’s any issues running the game on device. That’s all I do with XCode – but I’ll try what stackoverflow suggests, and hopefully I’ll figure out how to run “Clean” from the Product menu in XCode somehow.

Thanks again!

Naomi [import]uid: 67217 topic_id: 16526 reply_id: 63073[/import]

Ooops, sorry, comment posted on thwe wrong thread, moving it to this one instead:

http://developer.anscamobile.com/forum/2011/10/13/app-purchases-help-needed?page=1#comment-109556 [import]uid: 13811 topic_id: 16526 reply_id: 109555[/import]