From e29002e666fa8f8c0f4b83a782cab7167a5bf33a Mon Sep 17 00:00:00 2001 From: Anthony Nicholls Date: Fri, 5 Apr 2024 11:22:10 +0100 Subject: [PATCH] iOS: Replace deprecated references to downloadState with state --- .../native/juce_InAppPurchases_ios.cpp | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/modules/juce_product_unlocking/native/juce_InAppPurchases_ios.cpp b/modules/juce_product_unlocking/native/juce_InAppPurchases_ios.cpp index 03933171c2..d571a27102 100644 --- a/modules/juce_product_unlocking/native/juce_InAppPurchases_ios.cpp +++ b/modules/juce_product_unlocking/native/juce_InAppPurchases_ios.cpp @@ -54,10 +54,10 @@ struct InAppPurchases::Pimpl String getProductId() const override { return nsStringToJuce (download.contentIdentifier); } String getContentVersion() const override { return nsStringToJuce (download.contentVersion); } + Status getStatus() const override { return SKDownloadStateToDownloadStatus (download.state); } #if JUCE_IOS int64 getContentLength() const override { return download.contentLength; } - Status getStatus() const override { return SKDownloadStateToDownloadStatus (download.downloadState); } #else int64 getContentLength() const override { @@ -66,7 +66,6 @@ struct InAppPurchases::Pimpl return download.contentLength.longLongValue; } - Status getStatus() const override { return SKDownloadStateToDownloadStatus (download.state); } #endif SKDownload* download; @@ -111,11 +110,8 @@ struct InAppPurchases::Pimpl { for (SKDownload* d in transaction.downloads) { - #if JUCE_IOS - SKDownloadState state = d.downloadState; - #else SKDownloadState state = d.state; - #endif + if (state != SKDownloadStateFinished && state != SKDownloadStateFailed && state != SKDownloadStateCancelled) @@ -358,11 +354,7 @@ struct InAppPurchases::Pimpl { if (auto* pdt = getPendingDownloadsTransactionSKDownloadFor (download)) { - #if JUCE_IOS - SKDownloadState state = download.downloadState; - #else SKDownloadState state = download.state; - #endif auto contentURL = state == SKDownloadStateFinished ? URL (nsStringToJuce (download.contentURL.absoluteString)) @@ -779,11 +771,7 @@ private: { if (auto* pendingDownload = t.getPendingDownloadFor (download)) { - #if JUCE_IOS - switch (download.downloadState) - #else switch (download.state) - #endif { case SKDownloadStateWaiting: break;