Closed chrisradford closed 6 years ago
@chrisradford , thanks a ton. You're absolutely right that PM-iap really needs somewhat of a rewrite, already. Unfortunately, when I built the gem I had one use case in mind, and didn't really plan ahead to support subscriptions and some other parts. Granted, the Apple documentation on this really sucks.
I'm very interested in this rewrite. I'm happy to help out how I can, although my availability to code is limited given my current position and attempting to build a house.
Your work is hugely appreciated! Let me know what I can do to help.
The other consideration here is that automated testing is near impossible due to the fact that StoreKit is essentially disabled on the simulator.
There is an undocumented flow as part of the StoreKit framework that means some payments don't trigger the callback for a successful payment. I'll do my best to explain but for more information see this thread and specifically the post by Rich from Apple: https://forums.developer.apple.com/thread/6431
Per Apple's Best Practices for In App Payments document (https://developer.apple.com/library/ios/technotes/tn2387/_index.html) the observer should be added to SKPaymentQueue when the app loads. There are two reasons for this:
ProMotion-iap
is a really nice gem and I did attempt to rework the logic to fix our issue relating to the StoreKit Flow however it proved quite difficult and would mean a reworking of the basic functionality of the gem which wasn't something that I felt comfortable doing on a PR without discussion first.Hope that helps and do ask if anything isn't clear, I've spent the best part of a week working on this :)