|
@@ -129,7 +129,6 @@ class AIPurchaseWindowController: NSWindowController, NSWindowDelegate {
|
|
|
NotificationCenter.default.addObserver(self, selector: #selector(IAPProductRestoreFinishedNotification), name: NSNotification.Name(rawValue: NSNotification.Name.KMIAPProductRestoreFinished.rawValue), object: nil)
|
|
|
NotificationCenter.default.addObserver(self, selector: #selector(IAPProductRestoreFailedNotification), name: NSNotification.Name(rawValue: NSNotification.Name.KMIAPProductRestoreFailed.rawValue), object: nil)
|
|
|
NotificationCenter.default.addObserver(self, selector: #selector(AIDeviceStatusChangeNotification), name: NSNotification.Name(rawValue: "kDeviceAIStatusChangeNotification"), object: nil)
|
|
|
-
|
|
|
}
|
|
|
|
|
|
func refreshUI() -> Void {
|
|
@@ -143,9 +142,9 @@ class AIPurchaseWindowController: NSWindowController, NSWindowDelegate {
|
|
|
func reloadData() -> Void {
|
|
|
self.purchaseButton.isEnabled = true
|
|
|
#if VERSION_FREE
|
|
|
- let priceLabel = IAPProductsManager.default().liteAIProduct.price()
|
|
|
+ let priceLabel = IAPProductsManager.default().aiAllAccessPack1month_lite.price()
|
|
|
#else
|
|
|
- let priceLabel = IAPProductsManager.default().proAIProduct.price()
|
|
|
+ let priceLabel = IAPProductsManager.default().aiAllAccessPack1month_pro.price()
|
|
|
#endif
|
|
|
|
|
|
let aiInfoValid = KMMemberInfo.shared.isPermitAI
|
|
@@ -162,9 +161,9 @@ class AIPurchaseWindowController: NSWindowController, NSWindowDelegate {
|
|
|
func appStoreRestoreFinish() -> Void {
|
|
|
var didPurchased: Bool = false
|
|
|
#if VERSION_FREE
|
|
|
- didPurchased = IAPProductsManager.default().liteAIProduct.isSubscribed
|
|
|
+ didPurchased = IAPProductsManager.default().aiAllAccessPack1month_lite.isSubscribed
|
|
|
#else
|
|
|
- didPurchased = IAPProductsManager.default().proAIProduct.isSubscribed
|
|
|
+ didPurchased = IAPProductsManager.default().aiAllAccessPack1month_pro.isSubscribed
|
|
|
#endif
|
|
|
if didPurchased {
|
|
|
AIInfoManager.default().restoreAI(withInfo: ["receipt_str":IAPProductsManager.default().temptransactioReceipt as Any]) { dict, error in
|
|
@@ -201,9 +200,9 @@ class AIPurchaseWindowController: NSWindowController, NSWindowDelegate {
|
|
|
//MARK: - IBAction
|
|
|
@IBAction func purchaseAction(_ sender: KMButton) {
|
|
|
#if VERSION_FREE
|
|
|
- IAPProductsManager.default().make(IAPProductsManager.default().liteAIProduct)
|
|
|
+ IAPProductsManager.default().make(IAPProductsManager.default().aiAllAccessPack1month_lite)
|
|
|
#else
|
|
|
- IAPProductsManager.default().make(IAPProductsManager.default().proAIProduct)
|
|
|
+ IAPProductsManager.default().make(IAPProductsManager.default().aiAllAccessPack1month_pro)
|
|
|
#endif
|
|
|
self.addWaingView((self.window?.contentView)!)
|
|
|
FMTrackEventManager.defaultManager.trackOnceEvent(event: "PUW", withProperties: ["PUW_Btn":"PUW_Btn_BuyAITools"])
|
|
@@ -254,7 +253,7 @@ class AIPurchaseWindowController: NSWindowController, NSWindowDelegate {
|
|
|
|
|
|
//Appstore购买结束后绑定票据信息
|
|
|
#if VERSION_FREE
|
|
|
- if IAPProductsManager.default().liteAIProduct.isSubscribed {
|
|
|
+ if IAPProductsManager.default().aiAllAccessPack1month_lite.isSubscribed {
|
|
|
AIInfoManager.default().activateAI(withInfo: ["receipt_str":IAPProductsManager.default().temptransactioReceipt as Any]) { dict, error in
|
|
|
self.reloadData()
|
|
|
if KMMemberInfo.shared.isPermitAI {
|
|
@@ -263,7 +262,7 @@ class AIPurchaseWindowController: NSWindowController, NSWindowDelegate {
|
|
|
}
|
|
|
}
|
|
|
#else
|
|
|
- if IAPProductsManager.default().proAIProduct.isSubscribed {
|
|
|
+ if IAPProductsManager.default().aiAllAccessPack1month_pro.isSubscribed {
|
|
|
AIInfoManager.default().activateAI(withInfo: ["receipt_str":IAPProductsManager.default().temptransactioReceipt as Any]) { dict, error in
|
|
|
self.reloadData()
|
|
|
if KMMemberInfo.shared.isPermitAI {
|