phoboslab / Ejecta

A Fast, Open Source JavaScript, Canvas & Audio Implementation for iOS
2.81k stars 322 forks source link

Callback function problem with sandbox test user (IAP) #679

Closed boris342 closed 3 years ago

boris342 commented 3 years ago

I test in-app purchases on ios with sandbox test user and real test device.

Steps:

And problem is that sometimes callback function is not called. When i click on buy button again (right after closing the successful transaction popup window) it instantly call callback function (without previous steps). When i click on buy button again it start over so it prompted me for an ID/Password (sandbox user). So i must click on buy button again after purchase dialog (with the text that the payment was successful) is closed. The same problem with consumable and non-consumable purchases.

But sometimes it works as expected so callback function is called automaticlly after purchase dialog with positive result is closed. Also restoring transactions works always as expected.

phoboslab commented 3 years ago

Hard to tell what's going on. I suspect a problem in the client (JavaScript) code, since this all worked nicely for me last time I used it - granted, a few years ago.

Set a breakpoint here and step through it, to see where it fails: https://github.com/phoboslab/Ejecta/blob/master/Source/Ejecta/EJUtils/IAP/EJBindingIAPManager.m#L95

If this function isn't called after the purchase completes, there's an underlying issue in Ejecta. Let me know!

boris342 commented 3 years ago

I have tried it again but it works as expected (callback function called automatically after popup). Due to the number of problems with the sandbox environment last months (what i have read on apple forum) it will be probably problem of sandbox. I decided not to use iAP but game will be paid so i cant try it on testflight.