|
@@ -60,6 +60,20 @@ class KMFreeGetAIWC: NSWindowController {
|
|
|
termsServiceLabel.isEditable = false
|
|
|
termsServiceLabel.isSelectable = true
|
|
|
termsServiceLabel.allowsEditingTextAttributes = true
|
|
|
+
|
|
|
+ NotificationCenter.default.addObserver(
|
|
|
+ self,
|
|
|
+ selector: #selector(IAPSubscriptionLoadedNotification(_:)),
|
|
|
+ name: NSNotification.Name(rawValue: "KMIAPSubscriptionLoadedNotification"),
|
|
|
+ object: nil
|
|
|
+ )
|
|
|
+
|
|
|
+ NotificationCenter.default.addObserver(
|
|
|
+ self,
|
|
|
+ selector: #selector(IAPSubscriptionLoadedNotification(_:)),
|
|
|
+ name: NSNotification.Name(rawValue: "KMIAPProductFailedNotification"),
|
|
|
+ object: nil
|
|
|
+ )
|
|
|
|
|
|
let privacyPolicy = NSLocalizedString("Privacy Policy", tableName: "MemberCenterLocalizable", comment: "")
|
|
|
let termsService = NSLocalizedString("Terms of Service", tableName: "MemberCenterLocalizable", comment: "")
|
|
@@ -92,11 +106,14 @@ class KMFreeGetAIWC: NSWindowController {
|
|
|
#if VERSION_DMG
|
|
|
// DMG
|
|
|
#else
|
|
|
+ self.window?.showWaitingView()
|
|
|
+
|
|
|
// AppStore 免费版本
|
|
|
IAPProductsManager.default().makeSubProduct(IAPProductsManager.default().aiAllAccessPack12month_lite, discount: IAPProductsManager.default().isCancelAutoRenew())
|
|
|
#endif
|
|
|
#else
|
|
|
// AppStore 付费版
|
|
|
+ self.window?.showWaitingView()
|
|
|
IAPProductsManager.default().makeSubProduct(IAPProductsManager.default().aiAllAccessPack12month_pro, discount: IAPProductsManager.default().isCancelAutoRenew())
|
|
|
#endif
|
|
|
|
|
@@ -130,4 +147,8 @@ class KMFreeGetAIWC: NSWindowController {
|
|
|
@IBAction func laterButtonAction(_ sender: NSButton) {
|
|
|
window?.close()
|
|
|
}
|
|
|
+
|
|
|
+ @objc func IAPSubscriptionLoadedNotification(_ notification: Notification) {
|
|
|
+ self.removeWaitingView((self.window?.contentView)!)
|
|
|
+ }
|
|
|
}
|