本文介绍了SKReceiptRefreshRequest始终在带有.storekit配置文件的Xcode 12.2中失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时删除!!

当我在Xcode 12.2/iOS 14.2 Simulator中使用 .storekit 配置文件运行应用程序时,我的 SKReceiptRefreshRequest 总是失败,我的 func中出现错误request(_ request:SKRequest,didFailWithError错误:Error)委托方法.这是日志:

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}}}

我照常运行请求:

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
    }
}

一切正常,直到我将Xcode升级到12.2.现在,它对于运行"和测试"操作均失败.

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

我找不到有关代码为 5002 ASDServerErrorDomain 的任何信息.有什么帮助吗?

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

推荐答案

从Xcode 12.4开始,一切都恢复了.我希望他们不会再破坏这个东西...

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

这篇关于SKReceiptRefreshRequest始终在带有.storekit配置文件的Xcode 12.2中失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

1403页,肝出来的..

09-06 16:32