Преглед на файлове

1.依照产品要求,在 App 冷启动是,主动调用下回复订阅
2.去除 App 冷启动后,主动拉取苹果订单
3.为会员权重增加注释

100Years преди 1 седмица
родител
ревизия
8a5b45e4b8

+ 7 - 7
AIEmoji/Common/Purchase/TSPurchaseManager+Enmu.swift

@@ -164,20 +164,20 @@ extension PremiumPeriod {
             return 0
         }
     }
-    
+    //会员的权重
     var weight:Int{
         switch self {
-        case .lifetime:
+        case .lifetime://永久会员
             return 6
-        case .year:
+        case .year://年会员
             return 5
-        case .month:
+        case .month://月会员
             return 4
-        case .week(.weekPromotional1):
+        case .week(.weekPromotional1)://首月优惠的周会员
             return 3
-        case .week(.week):
+        case .week(.week)://普通周会员
             return 2
-        case .none,.purchase(_):
+        case .none,.purchase(_)://没有会员或者是购买视频次数
             return 0
         }
     }

+ 5 - 5
AIEmoji/Common/Purchase/TSPurchaseManager.swift

@@ -59,11 +59,11 @@ public class PurchaseManager: NSObject {
     
     private lazy var onceVerifyPayResult: Void = {
         dePrint("这段代码只会执行一次")
-#if DEBUG
-    verifyPayResult(transaction: SKPaymentTransaction(), useSandBox: true,uiBlock:nil)
-#else
-    verifyPayResult(transaction: SKPaymentTransaction(), useSandBox: false,uiBlock:nil)
-#endif
+//#if DEBUG
+//    verifyPayResult(transaction: SKPaymentTransaction(), useSandBox: true,uiBlock:nil)
+//#else
+//    verifyPayResult(transaction: SKPaymentTransaction(), useSandBox: false,uiBlock:nil)
+//#endif
     }()
     
 

+ 5 - 5
AIEmoji/Common/Purchase/TSPurchaseTimesManager/TSPurchaseTimesManager.swift

@@ -44,11 +44,11 @@ extension TSPurchaseTimesManager {
             return
         }
 
-        guard SKPaymentQueue.default().transactions.count <= 0 else {
-            purchase(self, didChaged: .payFail, object: "You have outstanding orders that must be paid for before a new subscription can be placed.",transaction: nil)
-            debugPrint("TSPurchaseTimesManager pay period restorePremium = \(period)")
-            return
-        }
+//        guard SKPaymentQueue.default().transactions.count <= 0 else {
+//            purchase(self, didChaged: .payFail, object: "You have outstanding orders that must be paid for before a new subscription can be placed.",transaction: nil)
+//            debugPrint("TSPurchaseTimesManager pay period restorePremium = \(period)")
+//            return
+//        }
         
         if let product = kPurchaseDefault.product(for: period) {
             purchase(self, didChaged: .paying, object: nil,transaction: nil)

+ 1 - 0
AIEmoji/TSLaunchVC.swift

@@ -61,6 +61,7 @@ class TSLaunchVC: UIViewController {
             }
             
             PurchaseManager.default.requestProducts()
+            PurchaseManager.default.restorePremium()
         }
     }