2 Replies
      Latest reply on Apr 15, 2019 1:57 PM by KMT
      allspark Level 1 Level 1 (0 points)

        Hello,

         

        We have an app which sells extra content as individual IAP items. The content packs may be quite large, and for some players these take a long time to download. Some of our players are in remote Scottish Isles or far off the beaten track in Australia, and for these people a simple download can take 20 mins. For this reason, we've implemented background downloads. So a typical example is a download will complete when the player has closed the app, and gone on to something else. My question is, what is the best way to finish the SKPaymentTransaction in this situation?

         

        On purchase, we get the callback with 'SKPaymentTransactionStatePurchased'  and we start the download.

        Much later, when the download has been completed, we need to tell StoreKit's SKPaymentQueue to finishTransaction.

        But if the app has been terminated we no longer have a reference to the SKPaymentTransaction.

         

        So whould we maintain our own dictionary of SKPaymentTransactions that are in progress, and preserve this across app launches, so we have a copy of the SKPaymentTransaction so that we can finish it much later? 

         

        Or should we rely on another StoreKit callback when the app is re-launched (perhaps the SKPaymentTransactionStatePurchasing) and compare that to recently completed downloads, and finish the transaction that way?

         

        What is the best approach in this scenario?

         

        Thank you.