store api questions

The common workflow is to set a timer.  If you get restored items then cancel the timer. 

Rob

Seriously, a timer? How do I know how slow the internet is at that point?

What kind of limit would you suggest, 5 seconds? 10?

 Jay

Set it for something like 20-30 seconds, if the response comes back faster than that (which it almost always will) then have it cancel the timer. Normally, restores take a couple of seconds. I also like to check for an internet connection and for the store before I send the request. If they can’t actually reach the store then fail immediately. So, now you are only really covering yourself in case the person hits the restore button and they have nothing to restore.

Thanks for the advice, Mark. I’m already checking for connection and store availability, so I guess a longer wait is no big deal.

 Jay

I would think 5-10 seconds should be sufficient.

In my case I don’t care about alerting people.  If they don’t have the purchases that they payed for, I’ll get the restore event and I can do any unlocks and then show an alert thanking them.  If there is nothing to restore no need to alert them.  The app will stay unlocked.

Rob

Rob, if someone *thinks* they have stuff to restore and they hit the button and nothing happens, they’d likely think there was a bug in the app. At least with a message they know I looked. :slight_smile:

I’m having trouble testing this – if I use the same sandbox test account on two devices should I be able to “buy” on one device and restore on the other?

 Jay

Just to kind of bump this…in case anyone else has trouble testing the store.restore() functionality.

I was able to test it by putting the app on two devices, “buying” on one device with a sandbox test account, and then hitting the game’s Restore button on the other device (using the same test account).

I ran into a problem at first because I was trying to restore consumable items, which is a no-no. You can only restore a non-consumable item. Once I switched that, my test worked.

 Jay