|
@@ -506,6 +506,11 @@ class KMProductModel: ObservableObject {
|
|
}
|
|
}
|
|
|
|
|
|
func appStoreEquityVerification(_ notification: Notification,_ complete: @escaping KMMemberProductComplete) -> Void {
|
|
func appStoreEquityVerification(_ notification: Notification,_ complete: @escaping KMMemberProductComplete) -> Void {
|
|
|
|
+#if VERSION_FREE
|
|
|
|
+#if VERSION_DMG
|
|
|
|
+ // DMG
|
|
|
|
+#else
|
|
|
|
+ // AppStore 免费版本
|
|
if let userInfo = notification.object as? SKPaymentTransaction,
|
|
if let userInfo = notification.object as? SKPaymentTransaction,
|
|
let transactionId = userInfo.transactionIdentifier as? String,
|
|
let transactionId = userInfo.transactionIdentifier as? String,
|
|
let productId = userInfo.payment.productIdentifier as? String {
|
|
let productId = userInfo.payment.productIdentifier as? String {
|
|
@@ -514,11 +519,6 @@ class KMProductModel: ObservableObject {
|
|
|
|
|
|
var productCode = ""
|
|
var productCode = ""
|
|
var isSubscribed = false
|
|
var isSubscribed = false
|
|
-#if VERSION_FREE
|
|
|
|
-#if VERSION_DMG
|
|
|
|
- // DMG
|
|
|
|
-#else
|
|
|
|
- // AppStore 免费版本
|
|
|
|
if productId == "com.pdfreaderpro.mac_free.member.all_access_pack_advanced_6months.001" {
|
|
if productId == "com.pdfreaderpro.mac_free.member.all_access_pack_advanced_6months.001" {
|
|
productCode = "advanced-annual-subscription-six-month"
|
|
productCode = "advanced-annual-subscription-six-month"
|
|
if IAPProductsManager.default().fourDevicesAllAccessPackNew6Months_lite.isSubscribed {
|
|
if IAPProductsManager.default().fourDevicesAllAccessPackNew6Months_lite.isSubscribed {
|
|
@@ -570,9 +570,30 @@ class KMProductModel: ObservableObject {
|
|
isSubscribed = true
|
|
isSubscribed = true
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ if isSubscribed {
|
|
|
|
+ KMMemberCenterManager.manager.appStoreEquityVerification(applePayProductId: productId, transactionId: transactionId, productCode: productCode) { success, result in
|
|
|
|
+ if success {
|
|
|
|
+ complete(true, result)
|
|
|
|
+ } else {
|
|
|
|
+ complete(false, result)
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ print("Transaction ID not found in notification.")
|
|
|
|
+ }
|
|
#endif
|
|
#endif
|
|
#else
|
|
#else
|
|
- // AppStore 付费版
|
|
|
|
|
|
+ // AppStore 付费版
|
|
|
|
+ if let userInfo = notification.object as? SKPaymentTransaction,
|
|
|
|
+ let transactionId = userInfo.transactionIdentifier as? String,
|
|
|
|
+ let productId = userInfo.payment.productIdentifier as? String {
|
|
|
|
+ print("Transaction ID: \(transactionId)")
|
|
|
|
+ print("product ID: \(productId)")
|
|
|
|
+
|
|
|
|
+ var productCode = ""
|
|
|
|
+ var isSubscribed = false
|
|
if productId == "com.pdfreaderpro.mac.ai_pack_1_month" {
|
|
if productId == "com.pdfreaderpro.mac.ai_pack_1_month" {
|
|
productCode = "ai-subscription-month"
|
|
productCode = "ai-subscription-month"
|
|
if IAPProductsManager.default().aiAllAccessPack1month_pro.isSubscribed {
|
|
if IAPProductsManager.default().aiAllAccessPack1month_pro.isSubscribed {
|
|
@@ -594,7 +615,6 @@ class KMProductModel: ObservableObject {
|
|
isSubscribed = true
|
|
isSubscribed = true
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-#endif
|
|
|
|
if isSubscribed {
|
|
if isSubscribed {
|
|
KMMemberCenterManager.manager.appStoreEquityVerification(applePayProductId: productId, transactionId: transactionId, productCode: productCode) { success, result in
|
|
KMMemberCenterManager.manager.appStoreEquityVerification(applePayProductId: productId, transactionId: transactionId, productCode: productCode) { success, result in
|
|
if success {
|
|
if success {
|
|
@@ -602,12 +622,13 @@ class KMProductModel: ObservableObject {
|
|
} else {
|
|
} else {
|
|
complete(false, result)
|
|
complete(false, result)
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
print("Transaction ID not found in notification.")
|
|
print("Transaction ID not found in notification.")
|
|
}
|
|
}
|
|
|
|
+#endif
|
|
}
|
|
}
|
|
|
|
|
|
var isCancelAutoRenew: Bool {
|
|
var isCancelAutoRenew: Bool {
|