|
@@ -220,6 +220,36 @@ class AppDelegate: NSObject, NSApplicationDelegate, iRateDelegate{
|
|
}
|
|
}
|
|
|
|
|
|
NotificationCenter.default.addObserver(self, selector: #selector(deviceActivateStatusChangeNotification), name: NSNotification.Name(rawValue: "kDeviceActivateNotification"), object: nil)
|
|
NotificationCenter.default.addObserver(self, selector: #selector(deviceActivateStatusChangeNotification), name: NSNotification.Name(rawValue: "kDeviceActivateNotification"), object: nil)
|
|
|
|
+
|
|
|
|
+ initDidFinish()
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ func initDidFinish() {
|
|
|
|
+#if VERSION_DMG
|
|
|
|
+ let memberInfo: KMMemberInfo = KMMemberInfo.shared
|
|
|
|
+ if IAPProductsManager.default().isAvailableAllFunction() == false && memberInfo.isLogin == false {
|
|
|
|
+ checkLoginAndPrompt()
|
|
|
|
+ }
|
|
|
|
+#endif
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ func checkLoginAndPrompt() {
|
|
|
|
+ let lastPromptDateKey = "kUserfreehaveDMGAIlastPromptDate"
|
|
|
|
+
|
|
|
|
+ let userDefaults = UserDefaults.standard
|
|
|
|
+ let lastPromptDate = userDefaults.object(forKey: lastPromptDateKey) as? Date
|
|
|
|
+
|
|
|
|
+ if let lastDate = lastPromptDate {
|
|
|
|
+ // 如果距离上次提示超过7天,则再次提示
|
|
|
|
+ if Calendar.current.date(byAdding: .day, value: 7, to: lastDate)! <= Date() {
|
|
|
|
+ KMOpenDMGPopupBootWC.shared.showWindow(nil)
|
|
|
|
+ userDefaults.set(Date(), forKey: lastPromptDateKey) // 更新提示日期
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ // 如果没有记录,则显示提示
|
|
|
|
+ KMOpenDMGPopupBootWC.shared.showWindow(nil)
|
|
|
|
+ userDefaults.set(Date(), forKey: lastPromptDateKey) // 保存提示日期
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
func initiRateData() {
|
|
func initiRateData() {
|