Browse Source

Merge branch 'develop'

tangchao 1 year ago
parent
commit
168fbef93d
23 changed files with 276 additions and 208 deletions
  1. 2 0
      PDF Office/PDF Master.xcodeproj/project.pbxproj
  2. 0 4
      PDF Office/PDF Master/AppDelegate.swift
  3. 6 2
      PDF Office/PDF Master/Class/Analytics/KMAnalytics.swift
  4. 6 0
      PDF Office/PDF Master/Class/ChromiumTabs/KMToolbarRightView.swift
  5. 4 1
      PDF Office/PDF Master/Class/ChromiumTabs/src/Browser Window/CTBrowserWindowController.m
  6. 4 4
      PDF Office/PDF Master/Class/ChromiumTabs/src/Browser Window/CTTabWindowController.m
  7. 13 0
      PDF Office/PDF Master/Class/ChromiumTabs/src/Tab Strip/CTTabStripView.m
  8. 11 11
      PDF Office/PDF Master/Class/KMLightMember/Config/KMLightMemberConfig.swift
  9. 4 6
      PDF Office/PDF Master/Class/KMLightMember/Controller/ComparativeTable/KMComparativeTableViewController.swift
  10. 43 66
      PDF Office/PDF Master/Class/KMLightMember/Controller/ComparativeTable/View/KMComparativeView/KMComparativeView.swift
  11. 5 5
      PDF Office/PDF Master/Class/KMLightMember/Controller/ComparativeTable/View/KMComparativeView/KMComparativeView.xib
  12. 12 11
      PDF Office/PDF Master/Class/KMLightMember/Controller/ComparativeTable/View/KMComparativeView/View/KMComparativeViewCollectionItem.swift
  13. 1 1
      PDF Office/PDF Master/Class/KMLightMember/Controller/ComparativeTable/View/KMComparativeView/View/KMComparativeViewCollectionItem.xib
  14. 8 3
      PDF Office/PDF Master/Class/KMLightMember/Controller/ComparativeTable/View/KMComparativeView/View/KMComparativeViewCollectionItemItem.swift
  15. 2 2
      PDF Office/PDF Master/Class/KMLightMember/Controller/Login&Register/View/KMLoginView.xib
  16. 11 17
      PDF Office/PDF Master/Class/KMLightMember/Controller/SubscriptionView/WaterMark/KMSubscribeWaterMarkWindowController.swift
  17. 33 26
      PDF Office/PDF Master/Class/KMLightMember/Controller/SubscriptionView/WaterMark/View/KMSubscribeWaterMarkView.swift
  18. 90 28
      PDF Office/PDF Master/Class/KMLightMember/InAppPurchase/Appstore/KMInAppPurchaseManager.swift
  19. 11 0
      PDF Office/PDF Master/Class/KMLightMember/InAppPurchase/KMPurchaseManager.swift
  20. 1 2
      PDF Office/PDF Master/Class/KMLightMember/Tools/Alert/KMPurchaseAlertView.xib
  21. 1 1
      PDF Office/PDF Master/Info.plist
  22. 1 9
      PDF Office/PDF Master/Strings/en.lproj/Localizable.strings
  23. 7 9
      PDF Office/PDF Master/Third Pard Library/FirebaseAnalytics/GoogleService-Info.plist

+ 2 - 0
PDF Office/PDF Master.xcodeproj/project.pbxproj

@@ -14006,6 +14006,7 @@
 				);
 				MACOSX_DEPLOYMENT_TARGET = 11.0;
 				MARKETING_VERSION = 1.2.0;
+				OTHER_LDFLAGS = "-ObjC";
 				OTHER_SWIFT_FLAGS = "-DVERSION_DMG";
 				PRODUCT_BUNDLE_IDENTIFIER = com.pdftechnologies.pdfreader.dmg;
 				PRODUCT_NAME = "$(TARGET_NAME)";
@@ -14140,6 +14141,7 @@
 				);
 				MACOSX_DEPLOYMENT_TARGET = 11.0;
 				MARKETING_VERSION = 1.2.0;
+				OTHER_LDFLAGS = "-ObjC";
 				OTHER_SWIFT_FLAGS = "-DVERSION_DMG";
 				PRODUCT_BUNDLE_IDENTIFIER = com.pdftechnologies.pdfreader.dmg;
 				PRODUCT_NAME = "$(TARGET_NAME)";

+ 0 - 4
PDF Office/PDF Master/AppDelegate.swift

@@ -46,15 +46,11 @@ class AppDelegate: NSObject, NSApplicationDelegate {
     func applicationDidFinishLaunching(_ aNotification: Notification) {
         // Insert code here to initialize your application
         
-        var appSecret = "416b8e45-69bd-4a16-8fec-b5206e913c4a"
 #if VERSION_DMG
         let updater = SUUpdater.shared()
         updater!.delegate = self
         updater!.automaticallyChecksForUpdates = true
-        
-        appSecret = "416b8e45-69bd-4a16-8fec-b5206e913c4a"
 #else
-        appSecret = "f0d082d0-9581-458c-9069-7aaf0a2b0a8c"
 #endif
 
         //        MARK: 广告数据初始化

+ 6 - 2
PDF Office/PDF Master/Class/Analytics/KMAnalytics.swift

@@ -76,8 +76,12 @@ extension KMAnalytics.Parameter {
     
     // 配置
     static func configure() {
-        var appSecret = "416b8e45-69bd-4a16-8fec-b5206e913c4a"
-        AppCenter.start(withAppSecret: appSecret, services: [Analytics.self, Crashes.self])
+ #if VERSION_DMG
+        AppCenter.start(withAppSecret: "416b8e45-69bd-4a16-8fec-b5206e913c4a", services: [Analytics.self, Crashes.self])
+ #else
+        AppCenter.start(withAppSecret: "f0d082d0-9581-458c-9069-7aaf0a2b0a8c", services: [Analytics.self, Crashes.self])
+ #endif
+        
         FirebaseApp.configure()
 //        Analytics.logEvent(AnalyticsEventSignUp, parameters: [
 //            AnalyticsParameterMethod: "method"

+ 6 - 0
PDF Office/PDF Master/Class/ChromiumTabs/KMToolbarRightView.swift

@@ -116,6 +116,12 @@ import Cocoa
         return resultSize
     }
     
+    func fetchAdvancedViewSize_update_rightSegmentControlConstraint() {
+        if self.rightSegmentControlConstraint != nil {
+            self.rightSegmentControlConstraint.constant = 89.0
+        }
+    }
+    
     func addNotification() {
         self.removeNotification()
         NotificationCenter.default.addObserver(self, selector: #selector(updateAdvancedContentView), name: NSNotification.Name(rawValue: ADVANCED_NOTIFICATION), object: nil)

+ 4 - 1
PDF Office/PDF Master/Class/ChromiumTabs/src/Browser Window/CTBrowserWindowController.m

@@ -884,8 +884,11 @@ static CTBrowserWindowController* _currentMain = nil; // weak
         ([KMLightMemberManager manager].purchaseState !=  KMPurchaseManagerStateSubscription&&
          [KMLightMemberManager manager].purchaseState != KMPurchaseManagerStateTrial)) {
 //        rightWidth = NSWidth([rightStripView frame]);
-        rightWidth = 56.0 + rightStripView.fetchAdvancedViewSize.width;
+//        rightWidth = 56.0 + rightStripView.fetchAdvancedViewSize.width;
 //        rightWidth += rightStripView.fetchAdvancedViewSize.width;
+        // TODO: 待优化。目前是写默认数值,上面注释的方式,在拖拽标签到新窗口时有问题。
+        rightWidth = 56.0 + 89;
+        [rightStripView fetchAdvancedViewSize_update_rightSegmentControlConstraint];
     } else {
         rightWidth = 56.0;
     }

+ 4 - 4
PDF Office/PDF Master/Class/ChromiumTabs/src/Browser Window/CTTabWindowController.m

@@ -79,8 +79,8 @@
     [topTabStripView_ setFrame:tabFrame];
     [self.rightStripView setFrame:rightFrame];
 
-//    NSView* contentParent = [[[self window] contentView] superview];
-    NSView* contentParent = [[self window] contentView];
+    NSView* contentParent = [[[self window] contentView] superview];
+//    NSView* contentParent = [[self window] contentView];
     [contentParent addSubview:topTabStripView_ positioned:NSWindowBelow relativeTo:nil];
     [contentParent addSubview:self.rightStripView positioned:NSWindowAbove relativeTo:nil];
 }
@@ -92,8 +92,8 @@
 	NSRect contentFrame = [[[self window] contentView] frame];
 	contentAreaHeightDelta_ = NSHeight(contentFrame) - NSHeight(tabFrame);
 	
-    self.window.styleMask |= NSWindowStyleMaskFullSizeContentView;
-    self.window.titlebarAppearsTransparent = YES;
+//    self.window.styleMask |= NSWindowStyleMaskFullSizeContentView;
+//    self.window.titlebarAppearsTransparent = YES;
     
 	if ([self hasTabStrip]) {
 		[self addTopTabStripToWindow];

+ 13 - 0
PDF Office/PDF Master/Class/ChromiumTabs/src/Tab Strip/CTTabStripView.m

@@ -52,6 +52,19 @@ static BOOL ShouldWindowsMiniaturizeOnDoubleClick() {
     [self removeObserverForAppearanceChange];
 }
 
+- (void)mouseDown:(NSEvent *)event {
+    if (event.clickCount == 2) {
+        BOOL isMaximized = self.window.zoomed;
+        if (isMaximized) {
+            [self.window zoom:nil];
+        } else {
+            [self.window zoom:nil];
+        }
+    } else {
+        [super mouseDown:event];
+    }
+}
+
 - (id)initWithFrame:(NSRect)frame {
 	self = [super initWithFrame:frame];
 	if (self) {

+ 11 - 11
PDF Office/PDF Master/Class/KMLightMember/Config/KMLightMemberConfig.swift

@@ -11,18 +11,18 @@ class KMLightMemberConfig: NSObject {
     var isDebug: Bool = true
     var kServerURL: String {
         get {
-//            #if DEBUG
-//            if self.isDebug {
-                //测试服务器
+            #if DEBUG
+            if self.isDebug {
+//                测试服务器
                 return "http://139.196.160.101:8081"
-//            } else {
-//                //正式服务器
-//                return "https://pdfmaster.pdfreaderpro.com"
-//            }
-//            #else
-//            //正式服务器
-//            return "https://pdfmaster.pdfreaderpro.com"
-//            #endif
+            } else {
+                //正式服务器
+                return "https://pdfmaster.pdfreaderpro.com"
+            }
+            #else
+            //正式服务器
+            return "https://pdfmaster.pdfreaderpro.com"
+            #endif
             
         }
     }

+ 4 - 6
PDF Office/PDF Master/Class/KMLightMember/Controller/ComparativeTable/KMComparativeTableViewController.swift

@@ -109,7 +109,7 @@ class KMComparativeTableViewController: NSWindowController {
         comparativeController = controller
         comparativeMainWindow = window
         
-        if type == .loginSuccess {
+        if type == .loginSuccess && KMLightMemberManager.manager.purchaseState != .subscription {
             controller.subscribeAction(controller: controller)
         }
         return controller
@@ -245,13 +245,11 @@ class KMComparativeTableViewController: NSWindowController {
                         KMPrint("订阅成功")
                         comparativeController = nil
                         comparativeMainWindow?.endSheet(controller.window!)
-                        comparativeMainWindow = nil
                         controller.close()
 
-                        DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 1.0) {
-                            if NSApp.mainWindow != nil {
-                                _ = KMSubscribeSuccessWindowController.show(window: NSApp.mainWindow!)
-                            }
+                        if comparativeMainWindow != nil {
+                            _ = KMSubscribeSuccessWindowController.show(window: comparativeMainWindow!)
+                            comparativeMainWindow = nil
                         }
                     } else {
                         KMComparativeTableViewController.purchasefailed(view: comparativeController?.comparativeView, state: error)

+ 43 - 66
PDF Office/PDF Master/Class/KMLightMember/Controller/ComparativeTable/View/KMComparativeView/KMComparativeView.swift

@@ -37,41 +37,52 @@ class KMComparativeView: KMBaseXibView {
         [
             "type": 0,
             "title": "Registered",
-            "subtitle": "Free",
+            "subtitle": "Free Plan",
+            "describe": "Simply log in and get benefits.",
             "content": [
-                ["title": "Basic functions like annotation and viewing",
-                 "state": true],
-                ["title": "Convert PDF to Office (Only first ten pages)",
-                 "state": true],
-                ["title": "Save without watermark",
-                 "state": false],
                 ["title": "AI translate, rewrite, correction",
-                 "state": false]
+                 "state": 0,
+                 "color": "#551CCD"],
+                ["title": "Save without watermark",
+                 "state": 0,
+                 "color": "#252629"],
+                ["title": "Convert with 10 pages per file",
+                 "state": 2,
+                 "color": "#252629"],
+                ["title": "Basic functions like annotation and viewing",
+                 "state": 2,
+                 "color": "#252629"]
             ],
-            "buttonTitle": "Sign up for Free"
+            "buttonTitle": "Free Trial"
         ],
         [
             "type": 1,
             "title": "Yearly Plan",
-            "subtitle": "$39.99",
+            "subtitle": "$79.99",
             "describe": "Save 50%@ for the first year, auto-renew at %@. Billed yearly.",
             "productId": PRODUCT_1,
             "content": [
-                ["title": "Enjoy all premium features",
-                 "state": true],
-                ["title": "Convert PDF to Office without limitation",
-                 "state": true],
-                ["title": "Save without watermark",
-                 "state": true],
                 ["title": "AI translate, rewrite, correction",
-                 "state": true]
+                 "state": 1,
+                 "color": "#551CCD"],
+                ["title": "Save without watermark",
+                 "state": 1,
+                 "color": "#252629"],
+                ["title": "Convert PDF to Office without limitation",
+                 "state": 1,
+                 "color": "#252629"],
+                ["title": "Unlock all premium features",
+                 "state": 1,
+                 "color": "#252629"]
             ],
-            "buttonTitle": "Subscribe Now"
+            "buttonTitle": "Buy Now"
         ]
     ]
     
     let popover = NSPopover()
     
+    var isSubscription: Bool = false
+    
     override func setup() {
         super.setup()
         
@@ -124,56 +135,22 @@ class KMComparativeView: KMBaseXibView {
     }
     
     override func updateLanguage() {
-//        + "  " + NSLocalizedString("Subscription", comment: ""
         self.restoreButton.title = NSLocalizedString("Restore Purchases", comment: "")
         self.titleLabel.stringValue = NSLocalizedString("Upgrade to Use All Features", comment: "")
-        
-//        let string = NSLocalizedString("""
-//Payment will be charged to your Apple ID account at the confirmation of purchase.
-//Subscription automatically renews unless it is canceled at least 24 hours before
-//the end of the current period. Your account will be charged for renewal within 24
-//hours prior to the end of the current period. You can manage and cancel your
-//subscriptions by going to your account settings on the App Store after purchase.
-//""", comment: "")
-//        let attributedString = NSMutableAttributedString.init(string: string)
-//        let paragraphStyle = NSMutableParagraphStyle()
-//        paragraphStyle.alignment = .left;
-//        paragraphStyle.lineHeightMultiple = 1.37
-//        attributedString.addAttributes([NSAttributedString.Key.font : NSFont.SFProTextRegular(11.0),
-//                                        NSAttributedString.Key.foregroundColor : NSColor(hex: "#94989C"),
-//                                        NSAttributedString.Key.paragraphStyle : paragraphStyle],
-//                                    range: NSRange(location: 0, length: string.count))
-//
-////        let range = string.range(of: NSLocalizedString("Subscription", comment: ""))
-////        attributedString.setAttributes([NSAttributedString.Key.font : NSFont.SFProTextRegular(12.0),
-////                                        NSAttributedString.Key.foregroundColor : NSColor(hex: "#1770F4"),
-////                                        NSAttributedString.Key.underlineColor : NSColor.clear,
-////                                        NSAttributedString.Key.link : "register://"],
-////                                       range: string.nsRange(from: range!)!)
-//
-//        self.textView.textStorage?.setAttributedString(attributedString)
     }
     
     override func reloadData() {
         self.beginLoading(backgroundColor: NSColor.black.withAlphaComponent(0.2))
         KMInAppPurchaseManager.manager.fetchProducts { [weak self] isSuccess, products, error in
-            self?.endLoading()
-            self?.collectionView.reloadData()
+            KMPurchaseManager.manager.checkSubscriptionStatus({ [weak self] isSubscription in
+                self?.isSubscription = isSubscription
+                self?.endLoading()
+                self?.collectionView.reloadData()
+            })
         }
     }
     
     @IBAction func infoButtonAction(_ sender: Any) {
-//        let contentViewController = NSViewController()
-//        contentViewController.view = NSView(frame: NSRect(x: 0, y: 0, width: 200, height: 100))
-//        contentViewController.view.wantsLayer = true
-//        contentViewController.view.layer?.backgroundColor = NSColor(hex:"#36383B").cgColor
-//        contentViewController.title =
-//
-//        let popover = NSPopover()
-//        popover.contentViewController = contentViewController
-//        popover.behavior = .transient
-//        popover.setValue(true, forKey: "shouldHideAnchor")
-//        popover.show(relativeTo: infoButton.bounds, of: infoButton, preferredEdge: .maxX)
         self.showPopover(sender)
     }
     
@@ -186,20 +163,18 @@ class KMComparativeView: KMBaseXibView {
     }
     
     func setupPopover() {
-        let string: NSString = NSLocalizedString("""
-            Payment will be charged to your Apple ID account at the confirmation of purchase.
-            Subscription automatically renews unless it is canceled at least 24 hours before
-            the end of the current period. Your account will be charged for renewal within 24
-            hours prior to the end of the current period. You can manage and cancel your
-            subscriptions by going to your account settings on the App Store after purchase.
-            """, comment: "") as NSString
+        let string: NSString = NSLocalizedString(
+"""
+Payment will be charged to your Apple ID account at the confirmation of purchase.\nSubscription automatically renews unless it is canceled at least 24 hours before the end of the current period. Your account will be charged for renewal within 24 hours prior to the end of the current period. You can manage and cancel your subscriptions by going to your account settings on the App Store after purchase.
+"""
+            , comment: "") as NSString
         
         let paragraphStyle = NSMutableParagraphStyle()
         paragraphStyle.lineHeightMultiple = 1.4
         paragraphStyle.alignment = .left
         let attributes = [NSAttributedString.Key.font : NSFont.SFProTextRegular(12), NSAttributedString.Key.paragraphStyle : paragraphStyle]
-        let size: NSSize = string.boundingRect(with: NSSize(width: 420, height: 400), options: NSString.DrawingOptions(rawValue: 3), attributes: attributes).size
-        
+        var size: NSSize = string.boundingRect(with: NSSize(width: 420, height: 600), options: NSString.DrawingOptions(rawValue: 3), attributes: attributes).size
+        size = CGSize(width: size.width, height: size.height + 30)
         
         popover.behavior = .transient
         popover.setValue(true, forKey: "shouldHideAnchor")
@@ -214,6 +189,7 @@ class KMComparativeView: KMBaseXibView {
         textField.drawsBackground = false
         textField.isEditable = false
         textField.isSelectable = false
+        textField.lineBreakMode = .byCharWrapping
         textField.textColor = NSColor(hex: "#FFFFFF")
         
         popover.contentViewController?.view.addSubview(textField)
@@ -242,6 +218,7 @@ extension KMComparativeView: NSCollectionViewDataSource {
     public func collectionView(_ collectionView: NSCollectionView, itemForRepresentedObjectAt indexPath: IndexPath) -> NSCollectionViewItem {
 //        let data = self.dataArray[indexPath.item]
         let view = collectionView.makeItem(withIdentifier: NSUserInterfaceItemIdentifier(rawValue: "KMComparativeViewCollectionItem"), for: indexPath) as! KMComparativeViewCollectionItem
+        view.isSubscription = isSubscription
         view.data = self.dataArray[indexPath.section] as! [String : Any]
         view.doneAction = { [unowned self] view, data in
             if data["type"] as! Int == 0 {

+ 5 - 5
PDF Office/PDF Master/Class/KMLightMember/Controller/ComparativeTable/View/KMComparativeView/KMComparativeView.xib

@@ -173,16 +173,16 @@
                             </constraints>
                         </customView>
                         <customView translatesAutoresizingMaskIntoConstraints="NO" id="tuB-UO-PhU">
-                            <rect key="frame" x="0.0" y="56" width="807" height="505"/>
+                            <rect key="frame" x="0.0" y="76" width="807" height="485"/>
                             <subviews>
                                 <scrollView wantsLayer="YES" borderType="none" autohidesScrollers="YES" horizontalLineScroll="10" horizontalPageScroll="10" verticalLineScroll="10" verticalPageScroll="10" hasVerticalScroller="NO" usesPredominantAxisScrolling="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ScA-aL-r0P">
-                                    <rect key="frame" x="40" y="0.0" width="727" height="505"/>
+                                    <rect key="frame" x="40" y="0.0" width="727" height="485"/>
                                     <clipView key="contentView" drawsBackground="NO" id="O9C-OM-ue0">
-                                        <rect key="frame" x="0.0" y="0.0" width="727" height="505"/>
+                                        <rect key="frame" x="0.0" y="0.0" width="727" height="485"/>
                                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                                         <subviews>
                                             <collectionView allowsEmptySelection="NO" id="tXY-fl-8XY">
-                                                <rect key="frame" x="0.0" y="0.0" width="727" height="505"/>
+                                                <rect key="frame" x="0.0" y="0.0" width="727" height="485"/>
                                                 <autoresizingMask key="autoresizingMask" heightSizable="YES"/>
                                                 <collectionViewFlowLayout key="collectionViewLayout" minimumInteritemSpacing="10" minimumLineSpacing="10" scrollDirection="horizontal" id="cPd-fj-JkJ">
                                                     <size key="itemSize" width="50" height="50"/>
@@ -203,6 +203,7 @@
                                 </scrollView>
                             </subviews>
                             <constraints>
+                                <constraint firstAttribute="height" constant="485" id="LRq-ib-ghz"/>
                                 <constraint firstAttribute="trailing" secondItem="ScA-aL-r0P" secondAttribute="trailing" constant="40" id="bke-OZ-98o"/>
                                 <constraint firstAttribute="bottom" secondItem="ScA-aL-r0P" secondAttribute="bottom" id="hcN-ec-kQR"/>
                                 <constraint firstItem="ScA-aL-r0P" firstAttribute="leading" secondItem="tuB-UO-PhU" secondAttribute="leading" constant="40" id="igv-8h-OSz"/>
@@ -212,7 +213,6 @@
                     </subviews>
                     <constraints>
                         <constraint firstAttribute="trailing" secondItem="nXE-h3-HLH" secondAttribute="trailing" id="4he-uf-tjb"/>
-                        <constraint firstItem="cMm-TO-WQD" firstAttribute="top" secondItem="tuB-UO-PhU" secondAttribute="bottom" constant="16" id="D9M-uh-Bn0"/>
                         <constraint firstItem="tuB-UO-PhU" firstAttribute="top" secondItem="nXE-h3-HLH" secondAttribute="bottom" constant="20" id="RR2-l8-5UO"/>
                         <constraint firstItem="cMm-TO-WQD" firstAttribute="leading" secondItem="yhM-ic-Qb1" secondAttribute="leading" constant="40" id="VTx-Ir-6RI"/>
                         <constraint firstItem="nXE-h3-HLH" firstAttribute="leading" secondItem="yhM-ic-Qb1" secondAttribute="leading" id="Xvu-rI-QaT"/>

+ 12 - 11
PDF Office/PDF Master/Class/KMLightMember/Controller/ComparativeTable/View/KMComparativeView/View/KMComparativeViewCollectionItem.swift

@@ -24,6 +24,7 @@ class KMComparativeViewCollectionItem: NSCollectionViewItem {
     @IBOutlet weak var iconImageView: NSImageView!
     
     var doneAction: KMComparativeViewCollectionItemDoneAction?
+    var isSubscription: Bool = false
     var data: [String: Any] = [:] {
         didSet {
             self.reloadData()
@@ -127,7 +128,7 @@ class KMComparativeViewCollectionItem: NSCollectionViewItem {
             
             if data["type"] as! Int == 1 {
                 self.describeLabel.isHidden = false
-                self.iconImageView.isHidden = false
+                self.iconImageView.isHidden = true
                 
                 self.subtitleLabel.textColor = NSColor(hex: "#252629")
                 self.doneContentView.backgroundColor(NSColor(hex: "#FF852E"))
@@ -136,13 +137,6 @@ class KMComparativeViewCollectionItem: NSCollectionViewItem {
                 self.doneButton.font = NSFont.SFProTextSemibold(16)
                 self.describeLabel.stringValue = "Save 50% for the first year, auto-renew at $79.9. Billed yearly."
                 
-                if KMLightMemberManager.manager.purchaseState == .trialExpired ||
-                    KMLightMemberManager.manager.purchaseState == .subscriptionExpired {
-                    self.iconImageView.isHidden = true
-                } else {
-                    self.iconImageView.isHidden = false
-                }
-                
                 self.updatePrice()
                 
             } else {
@@ -176,12 +170,19 @@ class KMComparativeViewCollectionItem: NSCollectionViewItem {
                 KMPrint(product.introductoryPrice?.price)
                 KMPrint(product.price)
                 KMPrint("-----------------------------")
+        
                 let currencySymbol: String = product.priceLocale.currencySymbol ?? "$"
                 let currencyCode: String = product.priceLocale.currencyCode ?? "$"
                 let price: String = product.introductoryPrice?.price.description ?? "39.9"
                 let originPrice: String = product.price.description
-                self.subtitleLabel.stringValue = "\(currencyCode)\(price)"
-//                self.describeLabel.stringValue = "\(currencyCode)\(originPrice) \(describe)"
+                
+                if self.isSubscription {
+                    self.iconImageView.isHidden = true
+                    self.subtitleLabel.stringValue = "\(currencyCode)\(originPrice)"
+                } else {
+                    self.iconImageView.isHidden = false
+                    self.subtitleLabel.stringValue = "\(currencyCode)\(price)"
+                }
                 
                 let paragraphStyle = NSMutableParagraphStyle()
                 paragraphStyle.lineHeightMultiple = 1.32
@@ -191,7 +192,7 @@ class KMComparativeViewCollectionItem: NSCollectionViewItem {
                 let describeString = NSString(format: describe as NSString, "%",priceString)
                 let attributedString = NSMutableAttributedString(string: describeString as String)
                 let range = (describeString as NSString).range(of: priceString)
-                attributedString.addAttribute(NSAttributedString.Key.strikethroughStyle, value: NSNumber(value: NSUnderlineStyle.single.rawValue), range: range)
+//                attributedString.addAttribute(NSAttributedString.Key.strikethroughStyle, value: NSNumber(value: NSUnderlineStyle.single.rawValue), range: range)
                 attributedString.addAttribute(NSAttributedString.Key.paragraphStyle, value: paragraphStyle, range: NSRange(location: 0, length: describeString.length))
                 self.describeLabel.attributedStringValue = attributedString
             }

+ 1 - 1
PDF Office/PDF Master/Class/KMLightMember/Controller/ComparativeTable/View/KMComparativeView/View/KMComparativeViewCollectionItem.xib

@@ -134,7 +134,7 @@
                         <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
                     </textFieldCell>
                 </textField>
-                <imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="sHp-vc-P9l">
+                <imageView hidden="YES" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="sHp-vc-P9l">
                     <rect key="frame" x="67" y="383" width="80" height="24"/>
                     <imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="Badge" id="aiz-s6-Vnu"/>
                 </imageView>

+ 8 - 3
PDF Office/PDF Master/Class/KMLightMember/Controller/ComparativeTable/View/KMComparativeView/View/KMComparativeViewCollectionItemItem.swift

@@ -25,13 +25,18 @@ class KMComparativeViewCollectionItemItem: NSCollectionViewItem {
     
     func reloadData() {
         if data.count != 0 {
-            let state: Bool = data["state"] as? Bool ?? false
-            if state == false {
+            let color = NSColor(hex: data["color"] as! String)
+            let state: Int = data["state"] as? Int ?? 0
+            if state == 2 {
                 self.iconImageView.image = NSImage(named: "icon_info")
-            } else {
+            } else if state == 1 {
                 self.iconImageView.image = NSImage(named: "tips")
+            } else if state == 0 {
+                self.iconImageView.image = NSImage(named: "tips 1")
             }
             
+            self.titleLabel.textColor = color
+            
             let string = NSLocalizedString(data["title"] as! String, comment: "")
             
             let paragraphStyle = NSMutableParagraphStyle()

+ 2 - 2
PDF Office/PDF Master/Class/KMLightMember/Controller/Login&Register/View/KMLoginView.xib

@@ -146,11 +146,11 @@ DQ
                                     <constraints>
                                         <constraint firstAttribute="height" constant="24" id="3gs-kE-D1v"/>
                                     </constraints>
-                                    <scroller key="horizontalScroller" hidden="YES" verticalHuggingPriority="750" horizontal="YES" id="fsY-op-cRp">
+                                    <scroller key="horizontalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" horizontal="YES" id="fsY-op-cRp">
                                         <rect key="frame" x="-100" y="-100" width="225" height="15"/>
                                         <autoresizingMask key="autoresizingMask"/>
                                     </scroller>
-                                    <scroller key="verticalScroller" hidden="YES" verticalHuggingPriority="750" horizontal="NO" id="jnd-eF-0ZU">
+                                    <scroller key="verticalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" horizontal="NO" id="jnd-eF-0ZU">
                                         <rect key="frame" x="-100" y="-100" width="15" height="24"/>
                                         <autoresizingMask key="autoresizingMask"/>
                                     </scroller>

+ 11 - 17
PDF Office/PDF Master/Class/KMLightMember/Controller/SubscriptionView/WaterMark/KMSubscribeWaterMarkWindowController.swift

@@ -133,17 +133,19 @@ class KMSubscribeWaterMarkWindowController: NSWindowController {
                         subscribeWaterMarkMainWindow?.endSheet(controller.window!)
                         controller.window?.close()
                         subscribeWaterMarkController = nil
-                        subscribeWaterMarkMainWindow = nil
+//                        subscribeWaterMarkMainWindow = nil
                         
-                        DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 1.0) {
-                            if NSApp.mainWindow != nil {
-                                let controller = KMSubscribeSuccessWindowController.show(window: NSApp.mainWindow!)
-                                controller.closeAction = { controller in
-                                    controller.closeWindow()
-                                    completion(true, false, false)
-                                }
+                        if subscribeWaterMarkMainWindow != nil {
+                            let controller = KMSubscribeSuccessWindowController.show(window: subscribeWaterMarkMainWindow!)
+                            controller.closeAction = { controller in
+                                controller.closeWindow()
+                                completion(true, false, false)
                             }
+                            subscribeWaterMarkMainWindow = nil
+                        } else {
+                            completion(true, false, false)
                         }
+                        
                     } else {
                         KMComparativeTableViewController.purchasefailed(view: subscribeWaterMarkController?.waterMarkView, state: error)
                         completion(false, false, false)
@@ -162,15 +164,7 @@ class KMSubscribeWaterMarkWindowController: NSWindowController {
                         subscribeWaterMarkController = nil
                         subscribeWaterMarkMainWindow = nil
                         
-                        DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 1.0) {
-                            if NSApp.mainWindow != nil {
-                                let controller = KMSubscribeSuccessWindowController.show(window: NSApp.mainWindow!)
-                                controller.closeAction = { controller in
-                                    controller.closeWindow()
-                                    completion(true, false, false)
-                                }
-                            }
-                        }
+                        completion(true, false, false)
                     } else {
                         if error != .restoreSuccess {
                             KMComparativeTableViewController.purchasefailed(view: subscribeWaterMarkController?.waterMarkView, state: error)

+ 33 - 26
PDF Office/PDF Master/Class/KMLightMember/Controller/SubscriptionView/WaterMark/View/KMSubscribeWaterMarkView.swift

@@ -55,6 +55,7 @@ class KMSubscribeWaterMarkView: KMBaseXibView {
     ]
     
     let popover = NSPopover()
+    var isSubscription: Bool = false
     
     override func setup() {
         self.closeBox.moveCallback = { [weak self] (mouseEntered, mouseBox) in
@@ -128,11 +129,7 @@ class KMSubscribeWaterMarkView: KMBaseXibView {
         self.subscribeLabel.stringValue = NSLocalizedString("Subscribe", comment: "")
 //        + "  " + NSLocalizedString("Subscription", comment: ""
         let string = NSLocalizedString("""
-Payment will be charged to your Apple ID account at the confirmation of purchase.
-Subscription automatically renews unless it is canceled at least 24 hours before
-the end of the current period. Your account will be charged for renewal within 24
-hours prior to the end of the current period. You can manage and cancel your
-subscriptions by going to your account settings on the App Store after purchase.
+            Payment will be charged to your Apple ID account at the confirmation of purchase.Subscription automatically renews unless it is canceled at least 24 hours before the end of the current period. Your account will be charged for renewal within 24 hours prior to the end of the current period. You can manage and cancel your subscriptions by going to your account settings on the App Store after purchase.
 """, comment: "")
         let attributedString = NSMutableAttributedString.init(string: string)
         let paragraphStyle = NSMutableParagraphStyle()
@@ -163,8 +160,11 @@ subscriptions by going to your account settings on the App Store after purchase.
         
         self.beginLoading(backgroundColor: NSColor.black.withAlphaComponent(0.2))
         KMInAppPurchaseManager.manager.fetchProducts { [weak self] isSuccess, products, error in
-            self?.endLoading()
-            self?.updatePrice()
+            KMPurchaseManager.manager.checkSubscriptionStatus({ [weak self] isSubscription in
+                self?.isSubscription = isSubscription
+                self?.endLoading()
+                self?.updatePrice()
+            })
         }
 #endif
 
@@ -173,13 +173,14 @@ subscriptions by going to your account settings on the App Store after purchase.
         self.restoreButton.isHidden = true
 //        self.textView.isHidden = true
 #endif
-        if KMLightMemberManager.manager.purchaseState == .trialExpired ||
-            KMLightMemberManager.manager.purchaseState == .subscriptionExpired {
-            self.discountImageView.isHidden = true
-        } else {
-            self.discountImageView.isHidden = false
-        }
-            
+        self.discountImageView.isHidden = true
+        
+//        if KMLightMemberManager.manager.purchaseState == .trialExpired ||
+//            KMLightMemberManager.manager.purchaseState == .subscriptionExpired {
+//            self.discountImageView.isHidden = true
+//        } else {
+//            self.discountImageView.isHidden = false
+//        }
     }
     
     func updatePrice() {
@@ -195,7 +196,14 @@ subscriptions by going to your account settings on the App Store after purchase.
                 let currencyCode: String = product.priceLocale.currencyCode ?? "$"
                 let price: String = product.introductoryPrice?.price.description ?? "39.9"
                 let originPrice: String = product.price.description ?? "79.9"
-                self.subscribeLabel.stringValue = "\(currencyCode)\(price) / year"
+                
+                if isSubscription {
+                    self.discountImageView.isHidden = true
+                    self.subscribeLabel.stringValue = "\(currencyCode)\(originPrice) / year"
+                } else {
+                    self.discountImageView.isHidden = false
+                    self.subscribeLabel.stringValue = "\(currencyCode)\(price) / year"
+                }
             }
         }
     }
@@ -240,20 +248,18 @@ extension KMSubscribeWaterMarkView {
     }
     
     func setupPopover() {
-        let string: NSString = NSLocalizedString("""
-            Payment will be charged to your Apple ID account at the confirmation of purchase.
-            Subscription automatically renews unless it is canceled at least 24 hours before
-            the end of the current period. Your account will be charged for renewal within 24
-            hours prior to the end of the current period. You can manage and cancel your
-            subscriptions by going to your account settings on the App Store after purchase.
-            """, comment: "") as NSString
+        let string: NSString = NSLocalizedString(
+"""
+Payment will be charged to your Apple ID account at the confirmation of purchase.\nSubscription automatically renews unless it is canceled at least 24 hours before the end of the current period. Your account will be charged for renewal within 24 hours prior to the end of the current period. You can manage and cancel your subscriptions by going to your account settings on the App Store after purchase.
+"""
+            , comment: "") as NSString
         
         let paragraphStyle = NSMutableParagraphStyle()
         paragraphStyle.lineHeightMultiple = 1.4
         paragraphStyle.alignment = .left
         let attributes = [NSAttributedString.Key.font : NSFont.SFProTextRegular(12), NSAttributedString.Key.paragraphStyle : paragraphStyle]
-        let size: NSSize = string.boundingRect(with: NSSize(width: 420, height: 400), options: NSString.DrawingOptions(rawValue: 3), attributes: attributes).size
-        
+        var size: NSSize = string.boundingRect(with: NSSize(width: 420, height: 600), options: NSString.DrawingOptions(rawValue: 3), attributes: attributes).size
+        size = CGSize(width: size.width, height: size.height + 30)
         
         popover.behavior = .transient
         popover.setValue(true, forKey: "shouldHideAnchor")
@@ -265,9 +271,10 @@ extension KMSubscribeWaterMarkView {
         let textField = NSTextField(frame: NSRect(x: 16, y: 8, width: size.width - 32, height: size.height - 16))
         textField.attributedStringValue = NSMutableAttributedString(string: NSLocalizedString(string as String, comment: ""), attributes: attributes)
         textField.backgroundColor(NSColor(hex: "#000000"))
+        textField.drawsBackground = false
         textField.isEditable = false
-        textField.isSelectable = true
-        textField.backgroundColor(NSColor.clear)
+        textField.isSelectable = false
+        textField.lineBreakMode = .byCharWrapping
         textField.textColor = NSColor(hex: "#FFFFFF")
         
         popover.contentViewController?.view.addSubview(textField)

+ 90 - 28
PDF Office/PDF Master/Class/KMLightMember/InAppPurchase/Appstore/KMInAppPurchaseManager.swift

@@ -59,12 +59,15 @@ enum KMInAppPurchaseState: String, CaseIterable {
     case restoreVerFailed = "Restore 2-step Verification Failed"//"restore二次验证失败"
     case noReceipt = "No Order Information"//"无票据信息"
     case orderFailed = "Order Creation Failed"//"订单创建失败"
+    case checkSubscriptionSuccess = "checkSubscriptionSuccess" //检测是否订阅成功
+    case checkSubscriptionFailed = "checkSubscriptionFailed" //检测是否订阅失败
 }
 
 class KMInAppPurchaseManager: NSObject {
     public static let manager = KMInAppPurchaseManager()
     
     var restoreCompletion: KMPurchaseRestoreCompletion?
+    var checkSubscriptionStatusCompletion: KMPurchaseCheckSubscriptionStatusCompletion?
     var fetchProductCompletion: KMPurchaseFetchProductCompletion?
     var purchaseProductCompletion: KMPurchaseCompletion?
     var availableProducts: [SKProduct] = []
@@ -76,10 +79,8 @@ class KMInAppPurchaseManager: NSObject {
     }
 
     var orderId: String?
-    var isPurchase: Bool = false
     
     deinit {
-        isPurchase = false
         SKPaymentQueue.default().remove(self)
     }
     
@@ -106,7 +107,6 @@ class KMInAppPurchaseManager: NSObject {
     func purchaseProduct(productIdentifier: String, orderId: String = "", completion: @escaping KMPurchaseCompletion) {
         self.purchaseProductCompletion = completion
         self.orderId = orderId
-        isPurchase = true
         if SKPaymentQueue.canMakePayments() {
             if let product = availableProducts.first(where: { $0.productIdentifier == productIdentifier }) {
                 KMPrint("\("购买产品") + \(productIdentifier)")
@@ -147,11 +147,12 @@ class KMInAppPurchaseManager: NSObject {
 #endif
         DispatchQueue.main.async { [unowned self] in
             if state == .verSuccess {
-                isPurchase = false
                 purchaseProductCompletion?(true, state)
+                purchaseProductCompletion = nil
             } else if state == .restoreVerFailed ||
                         state == .restoreVerFailed {
                 restoreCompletion?(false, state)
+                restoreCompletion = nil
             } else if state == .restoreVerSuccess ||
                         state == .restoreSuccess {
                 if state == .restoreVerSuccess {
@@ -159,14 +160,33 @@ class KMInAppPurchaseManager: NSObject {
                 } else {
                     restoreCompletion?(false, state)
                 }
+                
+                restoreCompletion = nil
+            } else if state == .checkSubscriptionSuccess ||
+                        state == .checkSubscriptionFailed {
+                if state == .checkSubscriptionSuccess {
+                    checkSubscriptionStatusCompletion?(true)
+                } else {
+                    checkSubscriptionStatusCompletion?(false)
+                }
+                checkSubscriptionStatusCompletion = nil
             } else {
-                isPurchase = false
                 purchaseProductCompletion?(false, state)
                 fetchProductCompletion?(false, [], state)
                 restoreCompletion?(false, state)
+                
+                purchaseProductCompletion = nil
+                restoreCompletion = nil
+                fetchProductCompletion = nil
             }
         }
     }
+    
+    //判断是否订阅过
+    func checkSubscriptionStatus(_ completion: @escaping KMPurchaseCheckSubscriptionStatusCompletion) {
+        self.checkSubscriptionStatusCompletion = completion
+        SKPaymentQueue.default().restoreCompletedTransactions()
+    }
 }
 
 extension KMInAppPurchaseManager: SKProductsRequestDelegate {
@@ -193,6 +213,8 @@ extension KMInAppPurchaseManager: SKProductsRequestDelegate {
         
         DispatchQueue.main.async { [unowned self] in
             callBack(true, availableProducts, .productSuccess)
+            
+            fetchProductCompletion = nil
         }
     }
     
@@ -204,6 +226,16 @@ extension KMInAppPurchaseManager: SKProductsRequestDelegate {
 }
 
 extension KMInAppPurchaseManager: SKPaymentTransactionObserver {
+    func paymentQueueDidChangeStorefront(_ queue: SKPaymentQueue) {
+        KMPrint("paymentQueueDidChangeStorefront")
+    }
+
+    
+    // Sent when entitlements for a user have changed and access to the specified IAPs has been revoked.
+    func paymentQueue(_ queue: SKPaymentQueue, didRevokeEntitlementsForProductIdentifiers productIdentifiers: [String]) {
+        KMPrint("didRevokeEntitlementsForProductIdentifiers")
+    }
+    
     func paymentQueue(_ queue: SKPaymentQueue, shouldAddStorePayment payment: SKPayment, for product: SKProduct) -> Bool {
         // Handle the purchase intent here
         // Return true to allow the purchase or false to deny it
@@ -211,36 +243,57 @@ extension KMInAppPurchaseManager: SKPaymentTransactionObserver {
     }
     
     func paymentQueue(_ queue: SKPaymentQueue, updatedTransactions transactions: [SKPaymentTransaction]) {
-        KMPrint("服务器返回数据")
+        KMPrint("苹果服务器返回数据")
         if transactions.count > 0 {
-            let transaction = transactions.first!
+            var isSuccess = false
             for transaction in transactions {
                 if kPRODUCTS.contains(transaction.original?.payment.productIdentifier ?? PRODUCT_1) {
                     // 检查购买的产品是否是订阅产品
                     switch transaction.transactionState {
                         case .purchased:
-                        if isPurchase {
-                            // 购买成功,进行本地二次验证
-                            KMPrint("购买成功,进行本地二次验证")
-                            validatePurchase(transaction: transaction)
-                        }
+                        isSuccess = true
                         case .failed:
-                            // 购买失败,处理错误
-                            KMPrint("购买失败,处理错误")
-                            handleError(transaction: transaction)
+                        break
                         case .restored:
-                        KMPrint("恢复购买,进行本地二次验证")
-                        validatePurchase(transaction: transaction)
+                        isSuccess = true
                         default:
                             break
                     }
-                    break
                 }
             }
+            if isSuccess {
+                if let purchase = purchaseProductCompletion {
+                    KMPrint("购买成功,进行本地二次验证")
+                    validatePurchase(transaction: nil)
+                } else if let  callBack = self.checkSubscriptionStatusCompletion {
+                    KMPrint("恢复购买 checkSubscriptionStatusCompletion")
+                    handleAction(state: .checkSubscriptionSuccess)
+                } else if let restore = self.restoreCompletion {
+                    KMPrint("恢复购买,进行本地二次验证")
+                    validatePurchase(transaction: nil)
+                }
+            } else {
+                KMPrint("购买失败,处理错误")
+                if let callBack = self.checkSubscriptionStatusCompletion {
+                    handleAction(state: .checkSubscriptionFailed)
+                } else if let restore = self.restoreCompletion {
+                    handleAction(state: .restoreFailed)
+                } else if let purchase = purchaseProductCompletion {
+                    handleAction(state: .productFailed)
+                }
+            }
+        } else {
+            self.handleAction(state: .productCorrespondenceFailed)
+        }
+        
+        for transaction in queue.transactions {
+            if transaction.transactionState != .purchasing {
+                SKPaymentQueue.default().finishTransaction(transaction)
+            }
         }
     }
     
-    func validatePurchase(transaction: SKPaymentTransaction) {
+    func validatePurchase(transaction: SKPaymentTransaction?) {
         // 获取购买凭证
         if let receiptURL = Bundle.main.appStoreReceiptURL,
            let receiptData = try? Data(contentsOf: receiptURL) {
@@ -264,12 +317,13 @@ extension KMInAppPurchaseManager: SKPaymentTransactionObserver {
      21007 订单信息是测试用(sandbox),但却被发送到产品环境中验证
      21008 订单信息是产品环境中使用,但却被发送到测试环境中验证
      */
-    func sendReceiptToServer(receiptData: Data, transaction: SKPaymentTransaction) {
+    func sendReceiptToServer(receiptData: Data, transaction: SKPaymentTransaction?) {
         // 构建请求
         let receiptString = receiptData.base64EncodedString(options: [])
         let tempOrderId = self.orderId ?? ""
         KMPrint(receiptString)
-        if transaction.transactionState == .restored {
+//        if transaction.transactionState == .restored {
+        if let restore = restoreCompletion {
             KMRequestServerManager.manager.parseVerification(applePayProductId: PRODUCT_1, orderId: tempOrderId, receipt: receiptString, restore: 1) { [unowned self] success, result in
                 if success, let data = result?.result {
                     // 处理服务器返回的验证结果
@@ -284,7 +338,7 @@ extension KMInAppPurchaseManager: SKPaymentTransactionObserver {
                     self.handleAction(state: .restoreVerFailed)
                 }
             }
-        } else {
+        } else if let purchase = purchaseProductCompletion {
             KMRequestServerManager.manager.parseVerification(applePayProductId: PRODUCT_1, orderId: tempOrderId, receipt: receiptString) { [unowned self] success, result in
                 if success, let data = result?.result {
                     // 处理服务器返回的验证结果
@@ -300,7 +354,7 @@ extension KMInAppPurchaseManager: SKPaymentTransactionObserver {
                 }
             }
         }
-        SKPaymentQueue.default().finishTransaction(transaction)
+//        SKPaymentQueue.default().finishTransaction(transaction)
     }
     
     func sendReceiptToAppleServer(receiptData: Data, transaction: SKPaymentTransaction) {
@@ -354,6 +408,11 @@ extension KMInAppPurchaseManager: SKPaymentTransactionObserver {
     }
     
     func paymentQueue(_ queue: SKPaymentQueue, restoreCompletedTransactionsFailedWithError error: Error) {
+        restoreCompletion?(false,.success)
+        restoreCompletion = nil
+        
+        checkSubscriptionStatusCompletion?(false)
+        checkSubscriptionStatusCompletion = nil
         KMPrint("restoreCompletedTransactionsFailedWithError")
     }
     
@@ -409,15 +468,18 @@ extension KMInAppPurchaseManager: SKPaymentTransactionObserver {
         return true
     }
     
-    func handleError(transaction: SKPaymentTransaction) {
+    func handleError(transaction: SKPaymentTransaction?) {
         // 处理购买失败的逻辑
-        SKPaymentQueue.default().finishTransaction(transaction)
-        if transaction.transactionState == .restored {
-            self.handleAction(state: .restoreFailed)
+        if let t = transaction {
+            SKPaymentQueue.default().finishTransaction(t)
+            if t.transactionState == .restored {
+                self.handleAction(state: .restoreFailed)
+            } else {
+                self.handleAction(state: .failed)
+            }
         } else {
             self.handleAction(state: .failed)
         }
-        // ...
     }
     
     func verifyPurchase(purchase: [String: Any]) -> KMPurchaseManagerState {

+ 11 - 0
PDF Office/PDF Master/Class/KMLightMember/InAppPurchase/KMPurchaseManager.swift

@@ -22,6 +22,7 @@ import Cocoa
 typealias KMPurchaseCompletion = (_ isSuccess: Bool, _ error: KMInAppPurchaseState) -> Void
 typealias KMPurchaseFetchProductCompletion = (_ isSuccess: Bool, _ products: Array<Any>, _ error: KMInAppPurchaseState?) -> Void
 typealias KMPurchaseRestoreCompletion = (_ isSuccess: Bool, _ error: KMInAppPurchaseState) -> Void
+typealias KMPurchaseCheckSubscriptionStatusCompletion = (_ isSubscription: Bool) -> Void
 class KMPurchaseManager: NSObject {
     public static let manager = KMPurchaseManager()
     
@@ -114,6 +115,16 @@ class KMPurchaseManager: NSObject {
 #if VERSION_DMG
         KMDMGPurchaseManager.manager.restorePurchases()
         KMPrint("正在restore DMG")
+#endif
+    }
+    
+    func checkSubscriptionStatus(_ completion: @escaping KMPurchaseCheckSubscriptionStatusCompletion) {
+#if VERSION_FREE
+        KMInAppPurchaseManager.manager.checkSubscriptionStatus(completion)
+#endif
+        
+#if VERSION_DMG
+        
 #endif
     }
 }

+ 1 - 2
PDF Office/PDF Master/Class/KMLightMember/Tools/Alert/KMPurchaseAlertView.xib

@@ -1,7 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="21701" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
     <dependencies>
-        <deployment identifier="macosx"/>
         <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="21701"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
@@ -34,7 +33,7 @@
                         <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="ojP-eQ-jrF">
                             <rect key="frame" x="38" y="16" width="177" height="16"/>
                             <textFieldCell key="cell" lineBreakMode="clipping" title="阿萨德发斯蒂芬去玩儿武器二" id="eZd-NL-okI">
-                                <font key="font" size="13" name=".PingFangSC-Regular"/>
+                                <font key="font" metaFont="system"/>
                                 <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
                                 <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
                             </textFieldCell>

+ 1 - 1
PDF Office/PDF Master/Info.plist

@@ -308,7 +308,7 @@
 	<key>Fabric</key>
 	<dict>
 		<key>APIKey</key>
-		<string>AIzaSyDex9auPUJBSvPMMu4UhIAtpwwzKutdmiQ</string>
+		<string>AIzaSyCalcVW-WrKHxsm4O-AU6MjV31fI9CLaLY</string>
 		<key>Kits</key>
 		<array>
 			<dict>

File diff suppressed because it is too large
+ 1 - 9
PDF Office/PDF Master/Strings/en.lproj/Localizable.strings


+ 7 - 9
PDF Office/PDF Master/Third Pard Library/FirebaseAnalytics/GoogleService-Info.plist

@@ -3,21 +3,21 @@
 <plist version="1.0">
 <dict>
 	<key>CLIENT_ID</key>
-	<string>956267872181-qb5rg2s8aghsn8c5ub1qri8o3o5i8o6k.apps.googleusercontent.com</string>
+	<string>850957615648-3tdp8r5023ej4fhduuub6fl80ralmftl.apps.googleusercontent.com</string>
 	<key>REVERSED_CLIENT_ID</key>
-	<string>com.googleusercontent.apps.956267872181-qb5rg2s8aghsn8c5ub1qri8o3o5i8o6k</string>
+	<string>com.googleusercontent.apps.850957615648-3tdp8r5023ej4fhduuub6fl80ralmftl</string>
 	<key>API_KEY</key>
-	<string>AIzaSyDex9auPUJBSvPMMu4UhIAtpwwzKutdmiQ</string>
+	<string>AIzaSyCalcVW-WrKHxsm4O-AU6MjV31fI9CLaLY</string>
 	<key>GCM_SENDER_ID</key>
-	<string>956267872181</string>
+	<string>850957615648</string>
 	<key>PLIST_VERSION</key>
 	<string>1</string>
 	<key>BUNDLE_ID</key>
 	<string>com.pdftechnologies.pdfreader.mac</string>
 	<key>PROJECT_ID</key>
-	<string>peerless-clock-269502</string>
+	<string>pdf-master-mac-app-store</string>
 	<key>STORAGE_BUCKET</key>
-	<string>peerless-clock-269502.appspot.com</string>
+	<string>pdf-master-mac-app-store.appspot.com</string>
 	<key>IS_ADS_ENABLED</key>
 	<false></false>
 	<key>IS_ANALYTICS_ENABLED</key>
@@ -29,8 +29,6 @@
 	<key>IS_SIGNIN_ENABLED</key>
 	<true></true>
 	<key>GOOGLE_APP_ID</key>
-	<string>1:956267872181:ios:18262b4ddbd0365ceda3fc</string>
-	<key>DATABASE_URL</key>
-	<string>https://peerless-clock-269502.firebaseio.com</string>
+	<string>1:850957615648:ios:08fdeb33ff0aa4667cb245</string>
 </dict>
 </plist>