U3DXT IAP - prevent pending transactions from starting download after Init()

Hello there,

I’m struggling to get the process of my InAppPurchase - Download working smooth. The download itself is working just fine (thanks for that :wink: ), but if i close my App while downloading I have a problem when i restart the App.

Immediatly after initialising the IAPXT with all OR one of my “productIds” the pending download that was canceled, starts running again. It would be ok, if only the productID I selected starts again or even that i have to start the download all over.
The way it works now means, that i have to complete a started download before I can start another one or there a two downloads running, which I just dont want to support.

Is there a way to only restart specific downloads or to delete all downloads from the PaymentQueue?

Hi, you can use SKPaymentQueue.CancelDownloads() method passing in an array of SKDownload objects: http://u3dxt.com/api/?topic=html/M_U3DXT_iOS_Native_StoreKit_SKPaymentQueue_CancelDownloads.htm. The IAPXT.DownloadUpdated event has an array of SKDownload objects. You can give the user a cancel button which calls this method. But I would think if the app closes without pressing cancel, it should continue downloading when it launches.

SKDownload[] downloads; // get it from IAPXT.DownloadUpdated event

SKPaymentQueue.DefaultQueue().CancelDownload(downloads);

Hope this helps.