-
Notifications
You must be signed in to change notification settings - Fork 798
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
Change Restore to return all products ids at once #18
Comments
I agree that this would be desirable behaviour. The Apple documentation for SKPaymentQueue.restoreCompletedTransactions() says the following: The payment queue will deliver a new transaction for each previously completed transaction that can be restored. Each transaction includes a copy of the original transaction. SwiftyStoreKit uses the This method is called after all restorable transactions have been processed by the payment queue. Your application is not required to do anything in this method. While in theory this means that it should be possible to gather all the transactions' productIDs and return then, in practice it appears that If this is the actual behaviour of StoreKit, there doesn't seem to be a way of returning all restored productIDs in one callback. Worse, I'm not sure that there is a way to tell which is the last callback. This is my interpretation though and I may have missed something. If anyone knows a way around this, please let me know. |
I have taken a quick look at the code and to me it looks like you should be able to just use the I think it could be done just iterating Does it make sense? |
Haven't investigated yet but yes. I'll try to look into it this week. |
Implemented tentative solution here: |
I have just tested it and it seems to work perfectly! - just as expected it restored multiple products in only one callback. |
This has now been merged and included in pod release 0.2.5 |
Could it be possible to change the Restore method to return all productIds at once?
Sometimes one needs some heavy computation after the restores, but like it is right now, it is not possible to know which callback is the last.
The text was updated successfully, but these errors were encountered: