How to reset a purchase (in sandbox)?

Hi,

I am in the process of implementing IAP and the RESTORE button.

I have already bought the item with my test-user account.

I would like to reset (delete) the purchase so I can test how the RESTORE behaves if the user hits the button before he makes the purchase.

So, how to reset a purchase in sandbox ?

Regards,
Damir. [import]uid: 108334 topic_id: 29578 reply_id: 329578[/import]

Damir @ubj3d.android, the easiest route might be for you to create more test user accounts. (Just add fake user with non-existent email addresses.) That said, some of my test users’ purchased state was eventually reset to non-purchased state without me doing anything in particular.

Naomi [import]uid: 67217 topic_id: 29578 reply_id: 118743[/import]

Hi Naomi,

thank you for the solution.

Simple and effective!

Regards,
Damir.

P.S. As I have read on other threads, if the user hits RESTORE (store.restore()) before he made any purchase, there is no callback.

Would be nice if there is a callback informing there was no purchases. [import]uid: 108334 topic_id: 29578 reply_id: 118753[/import]

Hi guys. I am finally playing with IAP (using the simple IAP code) and also want to test he restore button. If I buy an item (remove ads) and then delete the app to test the restore button, how using another test user would help in this? I will think that if I login with a different test user then ITC would say the new user has not bought the app earlier (since it was bought by the previous test user no? I am sure I am missing something since I am brand new to the wonderful world of IAP! Any suggestions on how to best test restore? Thank you guys! Mo Ps: by the way I will think that each product needs it own restore button OR do store.restore() restores all bought product at once?

Hey, Mo, did you work this out okay?  You probably have, but I thought I’d follow up.

About testing restore, you do want to use the same test user.  If a test user “A” buys an item and then delete the app and reinstall the app, you’d want test user “A” to sign in and restore it.  If you sign in using test user “B” instead, as you assumed, test user “B” won’t be able to restore what test user “A” purchased.

About restore button, with my app, a single restore button restores all non-consumable items.

Naomi

Hi Naomi, I hope you are doing great!

I am working on it as we speak! One of my beta user was able to buy coins and restore the ad-free version (which I bought earlier using the same test user) I have sent him a new tester user info as you suggested earlier. Waiting for that result. Another beta tester is not able to use that same tester user (the one I already used) and the message saying he is not authorized to make a in-app purchase in the sandbox  Not sure what is different so tonight i sent that beta tester a new test user that was not used before.

I guess for beta testing with many people, it is best to send them each a different test user login info that were never used.

Thanks again for all the suggestions here. I appreciated.

Mo

ps: By the way, how do you deal with multiple product restore. Thank God I only deal with one product restore (ad removal) but my understanding is that the store send back something for each product. How do you differentiate between the multiple restore in the callback? Just curious for the future…

Hey, Mo, about the beta test user, you might want to touch base and make sure s/he is signed out of app store before s/he tries to make an in-app purchase in your app.  If s/he is already signed in to app store with his/her regular account, then s/he won’t be able to make the in-app purchase in the sandbox.

About the multiple product restore, as far as I am aware, it works the same as single product.

Naomi

Thanks Naomi. Yes I told them about that. Good news!, the beta tester finally got it working. Scott, suggested for me to provide people a never used test user ID instead of me asking people to use their own test users. That did it! It seems that each test user is attach to an app so it work if beta testers use their own define test user.

In term of multiple restore, it seems that the store send a callback for each product previously bought and it is our job to manage the multiple restore callbacks. I could see it when by accident I added a second “remove ads” as an IAP. At that point I was receiving two alerts that I restored a product. Once I deleted one of the “ad-free” IAP then I can now only see one alert window saying that I successfully restored.  Not really important for me since i only have one product to sale!

Thanks a lot Naomi, I think you are one of the best expert in IAP that I know (judging from your posts about it:)

By the way I was afraid (I know i am chicken!)  so I used the “simple IAP” that you can find in the code exchange. SOOO much easier!

Mo

Hi guys. I am finally playing with IAP (using the simple IAP code) and also want to test he restore button. If I buy an item (remove ads) and then delete the app to test the restore button, how using another test user would help in this? I will think that if I login with a different test user then ITC would say the new user has not bought the app earlier (since it was bought by the previous test user no? I am sure I am missing something since I am brand new to the wonderful world of IAP! Any suggestions on how to best test restore? Thank you guys! Mo Ps: by the way I will think that each product needs it own restore button OR do store.restore() restores all bought product at once?

Hey, Mo, did you work this out okay?  You probably have, but I thought I’d follow up.

About testing restore, you do want to use the same test user.  If a test user “A” buys an item and then delete the app and reinstall the app, you’d want test user “A” to sign in and restore it.  If you sign in using test user “B” instead, as you assumed, test user “B” won’t be able to restore what test user “A” purchased.

About restore button, with my app, a single restore button restores all non-consumable items.

Naomi

Hi Naomi, I hope you are doing great!

I am working on it as we speak! One of my beta user was able to buy coins and restore the ad-free version (which I bought earlier using the same test user) I have sent him a new tester user info as you suggested earlier. Waiting for that result. Another beta tester is not able to use that same tester user (the one I already used) and the message saying he is not authorized to make a in-app purchase in the sandbox  Not sure what is different so tonight i sent that beta tester a new test user that was not used before.

I guess for beta testing with many people, it is best to send them each a different test user login info that were never used.

Thanks again for all the suggestions here. I appreciated.

Mo

ps: By the way, how do you deal with multiple product restore. Thank God I only deal with one product restore (ad removal) but my understanding is that the store send back something for each product. How do you differentiate between the multiple restore in the callback? Just curious for the future…

Hey, Mo, about the beta test user, you might want to touch base and make sure s/he is signed out of app store before s/he tries to make an in-app purchase in your app.  If s/he is already signed in to app store with his/her regular account, then s/he won’t be able to make the in-app purchase in the sandbox.

About the multiple product restore, as far as I am aware, it works the same as single product.

Naomi

Thanks Naomi. Yes I told them about that. Good news!, the beta tester finally got it working. Scott, suggested for me to provide people a never used test user ID instead of me asking people to use their own test users. That did it! It seems that each test user is attach to an app so it work if beta testers use their own define test user.

In term of multiple restore, it seems that the store send a callback for each product previously bought and it is our job to manage the multiple restore callbacks. I could see it when by accident I added a second “remove ads” as an IAP. At that point I was receiving two alerts that I restored a product. Once I deleted one of the “ad-free” IAP then I can now only see one alert window saying that I successfully restored.  Not really important for me since i only have one product to sale!

Thanks a lot Naomi, I think you are one of the best expert in IAP that I know (judging from your posts about it:)

By the way I was afraid (I know i am chicken!)  so I used the “simple IAP” that you can find in the code exchange. SOOO much easier!

Mo

Naomi,  with your single restore button, does the callback function give you back an array of restored items or does the event fire multiple times, once for each restored item, even if store.restore was only called once?

@stardustJerry, I believe restore button returns restored event for each restored item one at  a time (if I remember this correctly.)  

Naomi

Thanks Naomi,   Do you happen to know if Apple really requires a restore button or if it is ok to do an automatic call to store.restore near the beginning of the app, just to handle it transparently for the user.

Hey, @stardustJerry, I don’t know if restore button is required.  I’ve never shipped an app without it, so I don’t know if Apple would reject an app that has non-consumable IAP items for sale without restore button somewhere in the app.

Naomi

Hi,

Last week I was approved on first in-app version (consumables only) and I did not have a restore button for that one. I showed a screenshot with all the consumables. Did not get any issue. I also released the same time a free version of the app with both consumables (Gold coins…real gold you know…LOL) and one non-consumable (ie: buy the ad free version) For that one I made sure i had a restore button (and showed it in the screenshots) I also did not get issue with that one either.  BUT I recently found out that the restore button for some reason hangs when the app was not yet purchased. Once the app is purchased then it works fine (the restore happens and the ads goes away) I need to figure why the hangs (never receive the callback)

So, no, you do not need a restore for consumables.

Mo

Thanks Mo,  My purchases are non-consumables, but I was just wanting to not bug the user with a button and automatically do the restore.  I’ll have to research further to see if Apple allows that.  The hanging doesn’t sound good though…

-Jerry

Hi Jerry, My understanding is that you need a restore for those but please check the info. Yes I will need to look at that issue. Fun… Mo