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