Problem restoring IAPs

Hi,

We’re developing our 1st children app and we have 6 different IAPs in our free app. There is no apparent problem buying the IAP with our test accounts. But we do face a problem of restoring IAPs. When we click the designated restore button, it only restores 2 of the 6 IAPs. Repeating the restore process does not restore any of the remaining 4. However, if we manually buy each of the 4 IAPs again, iTunes says it has been purchased and we could restore each of them successfully.

We’re building our app with Corona SDK v748 & Kwik 1.8.1 for iOS. Below is the code:

 local onrestorebuyTouch = function(event)   
 if event.phase=="ended" then   
 store.restore()   
 transitionStash.newTransition\_768 = transition.to( restoring, {alpha=restoring.oldAlpha, time=0, delay=0})   
 local myClosure\_switch = function()   
 disposeAudios()   
 disposeTweens()   
 director:changeScene( "page\_1", "overFromLeft" )   
 end   
 timerStash.newTimer\_773 = timer.performWithDelay(10000, myClosure\_switch, 1)   
 end   
 end   
--(10) regular layer   
 restorebuy = ui.newButton{   
 defaultSrc=imgDir.."p20\_restorebuy.png",   
 defaultX = 141,   
 defaultY = 113,   
 overSrc=imgDir.."p20\_restorebuy.png",   
 overX = 141,   
 overY = 113,   
 onRelease=onrestorebuyTouch,   
 id="restorebuyButton"   
 }   
  
 restorebuy.x = 953; restorebuy.y = 712; restorebuy.alpha = 1; restorebuy.oldAlpha = 1   
 menuGroup:insert(restorebuy)   
 menuGroup.restorebuy = restorebuy   

Thanks,
Ben. [import]uid: 55445 topic_id: 22471 reply_id: 322471[/import]

I think I had a similar thing. I had added two items intitially in connect and then later once they were working added some more.
I could purchase all items but only the first two restored.

I re-uploaded the binary and I think this may of fixed it. Although I was trying all sorts of different solutions so I can’t be 100% sure that this was what caused it to work again. [import]uid: 51494 topic_id: 22471 reply_id: 90549[/import]

Hi Gareth,

I saw from another post, an developer by the name of Naomi did a hard reset on his device and he managed to restore everything.

I’m going to try this later, and hopefully using the latest version of Corona, this could be solved.

Ben. [import]uid: 55445 topic_id: 22471 reply_id: 90667[/import]

Hey, Ben, I’m she, not he. Hahaha.

Yeah, I have to hard-reset (erase all content and settings) when my IAP mechanics somehow gets screwed up. It happens often enough. Honestly, I don’t understand why it does that. Testing against iTC Sandbox can be so annoying. Oh well, at least, hard-reset does wonders for me. Hopefully, this only happens with testing against sandbox and never with the final release…

Naomi [import]uid: 67217 topic_id: 22471 reply_id: 90765[/import]

Restoring from Sandbox doesn’t always seem to work. After testing with a bunch of sandbox accounts it just seems to be a result either of the testing environment, or simply the short time gap between purchasing and then trying to restore repeatedly.

I think you should be fine as long as the code is all there, and it does work semi-randomly (and there’s no reason it shouldn’t be). [import]uid: 87138 topic_id: 22471 reply_id: 90848[/import]

Sorry about that Naomi.

Revaerie, thanks for the comments. I’ve taken a leap of faith and uploaded my app to iTC. Hopefully it works fine live when Apple approves it.

Have a nice weekend.

Ben [import]uid: 55445 topic_id: 22471 reply_id: 90921[/import]

No problem, Ben. Good luck with your submission!

Naomi [import]uid: 67217 topic_id: 22471 reply_id: 90995[/import]

one thing that screwed me up is that in-app purchases will not get a callback for “consumable” products.

“Store Kit provides built-in functionality to restore transactions for non-consumable products, auto-renewable subscriptions and free subscriptions”

http://developer.apple.com/library/ios/#documentation/NetworkingInternet/Conceptual/StoreKitGuide/MakingaPurchase/MakingaPurchase.html [import]uid: 122310 topic_id: 22471 reply_id: 120355[/import]

one thing that screwed me up is that in-app purchases will not get a callback for “consumable” products.

“Store Kit provides built-in functionality to restore transactions for non-consumable products, auto-renewable subscriptions and free subscriptions”

http://developer.apple.com/library/ios/#documentation/NetworkingInternet/Conceptual/StoreKitGuide/MakingaPurchase/MakingaPurchase.html [import]uid: 122310 topic_id: 22471 reply_id: 120355[/import]