iosxcodestorekitstorekittest

SKReceiptRefreshRequest always fails in Xcode 12.2 with .storekit configuration file


When I run the app with .storekit configuration file in Xcode 12.2 / iOS 14.2 Simulator, my SKReceiptRefreshRequest always fails, I get an error in my func request(_ request: SKRequest, didFailWithError error: Error) delegate method. Here are the logs:

# Printed by some Apple internal framework:

<SKReceiptRefreshRequest: 0x60000320d640>: Finished refreshing receipt with error: Error Domain=ASDServerErrorDomain Code=5002 "Unhandled exception" UserInfo={NSLocalizedDescription=Unhandled exception, NSLocalizedFailureReason=An unknown error occurred}

# Error logged by my code:

Failed to refresh app receipt: Error Domain=SKErrorDomain Code=0 "UNKNOWN_ERROR" UserInfo={NSLocalizedDescription=UNKNOWN_ERROR, NSUnderlyingError=0x600003c9a040 {Error Domain=ASDServerErrorDomain Code=5002 "Unhandled exception" UserInfo={NSLocalizedDescription=Unhandled exception, NSLocalizedFailureReason=An unknown error occurred}}}

I run the request as usual:

class ReceiptFetcher: NSObject {

    func fetchReceipt() {
        let request = SKReceiptRefreshRequest(receiptProperties: nil)
        request.delegate = self
        request.start()
    }
}

extension ReceiptFetcher: SKRequestDelegate {
    func requestDidFinish(_ request: SKRequest) {
        LogVerbose("App receipt refreshed!")
        // Handling success
    }

    func request(_ request: SKRequest, didFailWithError error: Error) {
        LogVerbose("Failed to refresh app receipt: \(error)")
        // Handling error
    }
}

Everything worked fine until I upgraded Xcode to 12.2. Now it fails for both Run and Test actions.

I found nothing about ASDServerErrorDomain with code 5002. Any help on that?


Solution

  • Everything works again since Xcode 12.4. I hope they won't break this thing again...