|
@@ -50,8 +50,8 @@ enum KMInAppPurchaseState: String, CaseIterable {
|
|
|
case verSuccess = "Order Verification Successful"//"订单校验成功"
|
|
|
case verServerFailed = "Server Order Verification Failed"//"服务器订单校验失败"
|
|
|
case notArrow = "In-app Purchases not Allowed" //"不允许内购"
|
|
|
- case productSuccess = "Failed to Access Product"//"获取产品失败"
|
|
|
- case productFailed = "Access Product Successfully"//"获取产品成功"
|
|
|
+ case productFailed = "Failed to Access Product"//"获取产品失败"
|
|
|
+ case productSuccess = "Access Product Successfully"//"获取产品成功"
|
|
|
case productCorrespondenceFailed = "Product not Found"//"未找到对应产品"
|
|
|
case restoreSuccess = "Restore Successfully"//"restore成功"
|
|
|
case restoreFailed = "Restore Failed"//"restore失败"
|
|
@@ -173,10 +173,12 @@ class KMInAppPurchaseManager: NSObject {
|
|
|
purchaseProductCompletion?(false, state)
|
|
|
fetchProductCompletion?(false, [], state)
|
|
|
restoreCompletion?(false, state)
|
|
|
+ checkSubscriptionStatusCompletion?(false)
|
|
|
|
|
|
purchaseProductCompletion = nil
|
|
|
restoreCompletion = nil
|
|
|
fetchProductCompletion = nil
|
|
|
+ checkSubscriptionStatusCompletion = nil
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -408,7 +410,11 @@ extension KMInAppPurchaseManager: SKPaymentTransactionObserver {
|
|
|
// 获取购买凭证
|
|
|
if let receiptURL = Bundle.main.appStoreReceiptURL,
|
|
|
let receiptData = try? Data(contentsOf: receiptURL) {
|
|
|
-
|
|
|
+ if SKPaymentQueue.default().transactions.count > 0 {
|
|
|
+
|
|
|
+ } else {
|
|
|
+ self.handleAction(state: .noReceipt)
|
|
|
+ }
|
|
|
} else {
|
|
|
self.handleAction(state: .noReceipt)
|
|
|
}
|