Browse Source

【订阅】当前处于订阅状态才开机restore

lizhe 1 year ago
parent
commit
5de5b252fc
1 changed files with 6 additions and 3 deletions
  1. 6 3
      PDF Office/PDF Master/AppDelegate.swift

+ 6 - 3
PDF Office/PDF Master/AppDelegate.swift

@@ -64,9 +64,12 @@ class AppDelegate: NSObject, NSApplicationDelegate {
         UserDefaults.standard.set(count, forKey: "kFirstOpenAppCount")
         UserDefaults.standard.synchronize()
         
-        //restore
-        KMPurchaseManager.manager.restorePurchases { isSuccess, error in
-            
+//        //restore
+        if KMInAppPurchaseManager.manager.state == .subscription {
+            debugPrint("是订阅状态 需要restore")
+            KMPurchaseManager.manager.restorePurchases { isSuccess, error in
+                
+            }
         }