|
@@ -1155,48 +1155,8 @@ private extension ViewController {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private func openRateUsDestination() {
|
|
private func openRateUsDestination() {
|
|
|
- let configured = (Bundle.main.object(forInfoDictionaryKey: "RateUsURL") as? String)?
|
|
|
|
|
- .trimmingCharacters(in: .whitespacesAndNewlines)
|
|
|
|
|
- let placeholder = (Bundle.main.object(forInfoDictionaryKey: "AppLaunchPlaceholderURL") as? String)?
|
|
|
|
|
- .trimmingCharacters(in: .whitespacesAndNewlines)
|
|
|
|
|
- let hardcodedRateUsURL = "https://apps.apple.com/pk/app/meeting-app-for-google-meet/id6654920763?mt=12"
|
|
|
|
|
-
|
|
|
|
|
- var candidateStrings = [String]()
|
|
|
|
|
- if let configured, !configured.isEmpty {
|
|
|
|
|
- candidateStrings.append(configured)
|
|
|
|
|
- if let appID = extractAppleAppID(from: configured) {
|
|
|
|
|
- candidateStrings.append("macappstore://apps.apple.com/app/id\(appID)")
|
|
|
|
|
- candidateStrings.append("macappstore://itunes.apple.com/app/id\(appID)")
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- candidateStrings.append(hardcodedRateUsURL)
|
|
|
|
|
- candidateStrings.append("macappstore://apps.apple.com/app/id6654920763")
|
|
|
|
|
- candidateStrings.append("macappstore://itunes.apple.com/app/id6654920763")
|
|
|
|
|
- if let placeholder, !placeholder.isEmpty {
|
|
|
|
|
- candidateStrings.append(placeholder)
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- for candidate in candidateStrings {
|
|
|
|
|
- guard let url = URL(string: candidate) else { continue }
|
|
|
|
|
- if NSWorkspace.shared.open(url) {
|
|
|
|
|
- return
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- showSimpleAlert(
|
|
|
|
|
- title: "Unable to Open Rate Page",
|
|
|
|
|
- message: "Could not open the App Store rating page. Please try again."
|
|
|
|
|
- )
|
|
|
|
|
-
|
|
|
|
|
- requestAppRatingIfEligible(markAsRated: true)
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- private func extractAppleAppID(from urlString: String) -> String? {
|
|
|
|
|
- guard let match = urlString.range(of: "id[0-9]+", options: .regularExpression) else {
|
|
|
|
|
- return nil
|
|
|
|
|
- }
|
|
|
|
|
- let token = String(urlString[match])
|
|
|
|
|
- return String(token.dropFirst())
|
|
|
|
|
|
|
+ SKStoreReviewController.requestReview()
|
|
|
|
|
+ UserDefaults.standard.set(true, forKey: userHasRatedDefaultsKey)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private func openInSafari(url: URL) {
|
|
private func openInSafari(url: URL) {
|