Reputation: 12366
The standard in app purchase flow when there is hosted content is:
This is fine. Imagine we want to restore all purchased contents, this is because we delete and re-installed our app or simply because we installed it in another device. Now, and this is confirmed by WWDC 2012 session on the subject, when you restore all purchases you will get the full list of contents to restore but probably you don't want to download all of them. In such case you should offer the user the choice of which content to download and then queue the SKDownload of the chosen product; once the the download terminates and the content is successfully installed, you can declare the transaction finished. What the session video didn't say instead is what you should do with the rejected or delayed downloads. As far as I know there is no way to save the SKDownload somewhere and retrieve it later and there is no API to ask iTunes a thing like this "give me the SKDownload of this already purchased product". So according to me there are two options to walk-around this case:
Did someone else faced this issue and found a better solution? does it make sense to open an enhancement request with Apple?
Upvotes: 3
Views: 968
Reputation: 4336
I always do it is as you suggested, and just "rebuy" the purchased items so it goes through the normal purchase flow. You can't mark the transaction as finished until your done with the download. So if you pause it and the app dies when your app is launched again the queue will go off and try to finish the purchase which would start your download logic again. That seems more annoying as a user constantly having this thing popup when I open the app to finish the purchase.
The SKDownload docs say;
Your app never directly creates a SKDownload object. Instead, after a payment is processed, your app reads the transaction object’s downloads property to retrieve an array of SKDownload objects associated with the transaction.
Upvotes: 1