I've been using the Storekit module from the marketplace to do in-app purchases through Apple. I'm running in to an issue when users are redirected outside of the app to review Apple's TOS or to update their credit card information. The issue is that my callback function is not being invoked when they return to the app. I have had 400 purchases, and only about 5 issues, but I'd still like to alleviate the issue all together. Has anyone run in to this issue before? Thanks in advance!
This is my code:
Storekit.purchase(product, function (evt) { switch (evt.state) { case Storekit.FAILED: if(callback) callback(); if (!evt.cancelled) { alert('ERROR: Buying failed! ' + evt.message); } break; case Storekit.PURCHASED: case Storekit.RESTORED: alert("You have successfully purchased this content."); unlockItem(user, callback); break; } });