Browse Source

Revamp Rating View!!

pull/92/head
Abhishek 4 years ago
parent
commit
9487907f83
  1. 4
      Clocker/AppDelegate.swift
  2. 8
      Clocker/Clocker.xcodeproj/project.pbxproj
  3. 16
      Clocker/Clocker.xcodeproj/xcuserdata/abhishekbanthia.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
  4. 2
      Clocker/Panel/PanelController.swift
  5. 8
      Clocker/Panel/ParentPanelController.swift
  6. 11
      Clocker/Panel/Rate Controller/ReviewController.swift

4
Clocker/AppDelegate.swift

@ -58,7 +58,7 @@ open class AppDelegate: NSObject, NSApplicationDelegate {
showOnboardingFlowIfEligible()
// Ratings Controller initialization
RateController.applicationDidLaunch(UserDefaults.standard)
ReviewController.applicationDidLaunch(UserDefaults.standard)
#if RELEASE
Fabric.with([Crashlytics.self])
@ -140,7 +140,7 @@ open class AppDelegate: NSObject, NSApplicationDelegate {
statusBarHandler = StatusItemHandler()
if ProcessInfo.processInfo.arguments.contains(CLUITestingLaunchArgument) {
RateController.setPreviewMode(true)
ReviewController.setPreviewMode(true)
}
UserDefaults.standard.register(defaults: ["NSApplicationCrashOnExceptions": true])

8
Clocker/Clocker.xcodeproj/project.pbxproj

@ -66,7 +66,7 @@
35C36F612259DE67002FA5C6 /* NotesPopover.xib in Resources */ = {isa = PBXBuildFile; fileRef = 35C36F5F2259DE67002FA5C6 /* NotesPopover.xib */; };
35C36F622259DE67002FA5C6 /* NotesPopover.swift in Sources */ = {isa = PBXBuildFile; fileRef = 35C36F602259DE67002FA5C6 /* NotesPopover.swift */; };
35C36F662259DF4C002FA5C6 /* ReviewView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 35C36F642259DF4C002FA5C6 /* ReviewView.swift */; };
35C36F672259DF4C002FA5C6 /* RateController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 35C36F652259DF4C002FA5C6 /* RateController.swift */; };
35C36F672259DF4C002FA5C6 /* ReviewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 35C36F652259DF4C002FA5C6 /* ReviewController.swift */; };
35C36F692259DF55002FA5C6 /* TextViewWithPlaceholder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 35C36F682259DF55002FA5C6 /* TextViewWithPlaceholder.swift */; };
35C36F6B2259E0E1002FA5C6 /* FloatingWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 35C36F6A2259E0E1002FA5C6 /* FloatingWindow.xib */; };
35C36F6F2259E185002FA5C6 /* CustomSliderCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 35C36F6C2259E185002FA5C6 /* CustomSliderCell.swift */; };
@ -287,7 +287,7 @@
35C36F5F2259DE67002FA5C6 /* NotesPopover.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = NotesPopover.xib; sourceTree = "<group>"; };
35C36F602259DE67002FA5C6 /* NotesPopover.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NotesPopover.swift; sourceTree = "<group>"; };
35C36F642259DF4C002FA5C6 /* ReviewView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ReviewView.swift; sourceTree = "<group>"; };
35C36F652259DF4C002FA5C6 /* RateController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RateController.swift; sourceTree = "<group>"; };
35C36F652259DF4C002FA5C6 /* ReviewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ReviewController.swift; sourceTree = "<group>"; };
35C36F682259DF55002FA5C6 /* TextViewWithPlaceholder.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TextViewWithPlaceholder.swift; sourceTree = "<group>"; };
35C36F6A2259E0E1002FA5C6 /* FloatingWindow.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = FloatingWindow.xib; sourceTree = "<group>"; };
35C36F6C2259E185002FA5C6 /* CustomSliderCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CustomSliderCell.swift; sourceTree = "<group>"; };
@ -612,7 +612,7 @@
35C36F632259DE9D002FA5C6 /* Rate Controller */ = {
isa = PBXGroup;
children = (
35C36F652259DF4C002FA5C6 /* RateController.swift */,
35C36F652259DF4C002FA5C6 /* ReviewController.swift */,
35C36F642259DF4C002FA5C6 /* ReviewView.swift */,
);
path = "Rate Controller";
@ -1213,7 +1213,7 @@
35C36EF622595F14002FA5C6 /* OnboardingController.swift in Sources */,
9AB6F1622259D1B000A44663 /* PreferencesDataSource.swift in Sources */,
3508CC9A259A0001000E3530 /* StatusItemView.swift in Sources */,
35C36F672259DF4C002FA5C6 /* RateController.swift in Sources */,
35C36F672259DF4C002FA5C6 /* ReviewController.swift in Sources */,
35C36F472259D892002FA5C6 /* Reach.swift in Sources */,
35C36EF222595F14002FA5C6 /* OnboardingWelcomeViewController.swift in Sources */,
35C36F732259E1AA002FA5C6 /* FloatingWindowController.swift in Sources */,

16
Clocker/Clocker.xcodeproj/xcuserdata/abhishekbanthia.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

@ -15,5 +15,21 @@
stopOnStyle = "0">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "6C78F195-3037-4EDA-8650-D12235EAA1E9"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Preferences/General/PreferencesViewController.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "47"
endingLineNumber = "47"
landmarkName = "geocodingKey"
landmarkType = "24">
</BreakpointContent>
</BreakpointProxy>
</Breakpoints>
</Bucket>

2
Clocker/Panel/PanelController.swift

@ -91,7 +91,7 @@ class PanelController: ParentPanelController {
setTimezoneDatasourceSlider(sliderValue: 0)
reviewView.isHidden = !RateController.canPrompt()
reviewView.isHidden = !ReviewController.canPrompt()
reviewView.layer?.backgroundColor = NSColor.clear.cgColor

8
Clocker/Panel/ParentPanelController.swift

@ -842,7 +842,7 @@ class ParentPanelController: NSWindowController {
} else {
updateReviewView()
RateController.prompted()
ReviewController.prompted()
if let countryCode = Locale.autoupdatingCurrent.regionCode {
Logger.log(object: ["CurrentCountry": countryCode], for: "Remind Later for Feedback")
@ -857,7 +857,7 @@ class ParentPanelController: NSWindowController {
leftTitle: PanelConstants.noThanksTitle,
rightTitle: "Yes")
} else if sender.title == PanelConstants.yesWithQuestionMark {
RateController.prompted()
ReviewController.prompted()
updateReviewView()
feedbackWindow = AppFeedbackWindowController.shared()
@ -865,7 +865,7 @@ class ParentPanelController: NSWindowController {
NSApp.activate(ignoringOtherApps: true)
} else {
updateReviewView()
RateController.prompt()
ReviewController.prompt()
if let countryCode = Locale.autoupdatingCurrent.regionCode {
Logger.log(object: ["CurrentCountry": countryCode], for: "Remind Later for Feedback")
@ -876,7 +876,7 @@ class ParentPanelController: NSWindowController {
private func updateReviewView() {
reviewView.isHidden = true
showReviewCell = false
leftField.stringValue = NSLocalizedString("Enjoy using Clocker",
leftField.stringValue = NSLocalizedString("Enjoy using Clocker?",
comment: "Title asking users if they like the app")
let paragraphStyle = NSMutableParagraphStyle()

11
Clocker/Panel/Rate Controller/RateController.swift → Clocker/Panel/Rate Controller/ReviewController.swift

@ -1,8 +1,9 @@
// Copyright © 2015 Abhishek Banthia
import Cocoa
import StoreKit
final class RateController {
final class ReviewController {
private static var storage = UserDefaults.standard
private static let version: String = Bundle.main.object(forInfoDictionaryKey: "CFBundleVersion") as? String ?? "N/A"
private static var debugging = false
@ -62,7 +63,13 @@ final class RateController {
guard let ratingsURL = URL(string: AboutUsConstants.AppStoreLink) else {
return
}
NSWorkspace.shared.open(ratingsURL)
if #available(OSX 10.14, *) {
SKStoreReviewController.requestReview()
} else {
NSWorkspace.shared.open(ratingsURL)
}
prompted()
}
}
Loading…
Cancel
Save