- Home /
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 ;) ), 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?
Answer by u3dxt · Jun 11, 2014 at 04:27 PM
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.
Your answer
![](https://koobas.hobune.stream/wayback/20220613151254im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
IAP init failed? 3 Answers
Validating IAP Restore with U3DXT 0 Answers
U3DXT Init failed, everything is setup 1 Answer
How to get local currency u3dxt 1 Answer