-
Notifications
You must be signed in to change notification settings - Fork 185
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add manual transaction finish, getPendingPurchases #135
base: master
Are you sure you want to change the base?
Conversation
Add manual purchase finish
Awesome work @lunarraid. So one would typically call I think the readme should be updated to show this function and use-case. |
What is the status on this? |
I have been swamped with other projects and unable to look into this. If anyone else wants to take up the task of adding the requested documentation, feel free, since it may be a bit before I look at it. |
Nice work @lunarraid! |
@chirag04 I have updated the readme with an example for |
Awesome, @lunarraid 👏 |
Tried it but got this critical error:
|
Was trying to figure out it on my own, but I am not very familiar with debugging ObjC and in-app purchases sdk. The error basically kills the application. @lunarraid any ideas what may cause it? did you see something similar on your end? may it be due to sandbox environment? |
We're running this in production code right now without issue, so it is probably some permutation of environment-specific settings, target platform, etc. Has anyone else here run into this? I'm uncertain of how to reproduce this state. |
@lunarraid thank you for letting me know - good to know it is used in production, will update once/if figured out the real cause. |
@lunarraid We are using almost same code in the production too, without issue. |
@chirag04 can this get merged? The library without this is really wrong, and causes problems because the transaction gets finished before the app confirms that processed it. |
@idris You're totally right but forget the merge and just use forks which already merged this pr 😄 Mine is working that way but I made extra small changes |
I think this should be combined with #128 to create a proper API. My suggestion for the API is as follows:
One piece of functionality this allows, which the current PR does not, is if a purchase is initiated somewhere else in the app, for example from a native library. I'm happy to help implement if we think this is the right direction. |
@unao I finally ran into the issue you were mentioning. It happens if you have transactions in the queue that are retries of previous transactions and thus don't include certain pieces of data. I have updated my PR to address this edge case. |
This is a breaking change that requires
InAppUtils.purchaseFinish
to be called to finalize a transaction, where before this was called automatically prior to thepurchaseProduct
callback being fired. The methodgetPendingPurchases
to retrieve all unfinished transactions has also been added.