Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
DebugSettingsDelegate,
SearchBarLocationProvider,
SharedSettingsDelegate {

// MARK: - Properties
private var showDebugSettings = false
private var debugSettingsClickCount: Int = 0
Expand Down Expand Up @@ -137,7 +138,7 @@
case .creditCard:
authenticateUserFor(route: route)
case .rateApp:
RatingPromptManager.goToAppStoreReview()
interceptNegativeReviews()
default:
break
}
Expand All @@ -153,7 +154,24 @@
}
}

// MARK: - User Authentication
// MARK: Ecosia

private func interceptNegativeReviews() {
let rateAction = UIAlertAction(title: .localized(.settingsRatingPromptYes), style: .default) { _ in
UIApplication.shared.open(Environment.current.urlProvider.storeWriteReviewPage)
}

let helpAction = UIAlertAction(title: .localized(.settingsRatingPromptNo), style: .destructive) { [weak self] _ in
self?.settingsDelegate?.settingsOpenURLInNewTab(Environment.current.urlProvider.helpPage)
}

let alertController = UIAlertController(title: .localized(.settingsRatingPromptTitle), message: nil, preferredStyle: .alert)
alertController.addAction(rateAction)
alertController.addAction(helpAction)
present(alertController, animated: true)
}

// MARK: - User AutheSntication

// Authenticates the user prior to allowing access to sensitive sections
private func authenticateUserFor(route: Route.SettingsSection) {
Expand Down Expand Up @@ -387,6 +405,8 @@
}

private func getAboutSettings() -> [SettingSection] {

Check failure on line 408 in firefox-ios/Client/Frontend/Settings/Main/AppSettingsTableViewController.swift

View workflow job for this annotation

GitHub Actions / build

Lines should not have trailing whitespace (trailing_whitespace)

Check failure on line 409 in firefox-ios/Client/Frontend/Settings/Main/AppSettingsTableViewController.swift

View workflow job for this annotation

GitHub Actions / build

Limit vertical whitespace to a single empty line; currently 2 (vertical_whitespace)

Check failure on line 409 in firefox-ios/Client/Frontend/Settings/Main/AppSettingsTableViewController.swift

View workflow job for this annotation

GitHub Actions / build

Lines should not have trailing whitespace (trailing_whitespace)
let aboutSettings = [
AppStoreReviewSetting(settingsDelegate: parentCoordinator),
VersionSetting(settingsDelegate: self),
Expand Down
15 changes: 15 additions & 0 deletions firefox-ios/Ecosia/Core/Environment/URLProvider.swift
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,17 @@
return URL(string: "https://ecosia.typeform.com/to/LlUGlFT9")!
}
}

Check failure on line 155 in firefox-ios/Ecosia/Core/Environment/URLProvider.swift

View workflow job for this annotation

GitHub Actions / build

Lines should not have trailing whitespace (trailing_whitespace)
public var helpPage: URL {
switch Language.current {
case .de:
return URL(string: "https://de.support.ecosia.org/category/695-ecosia-ios-app")!
case .fr:
return URL(string: "https://fr.support.ecosia.org/category/805-ecosia-ios-app")!
default:
return URL(string: "https://support.ecosia.org/category/827-ecosia-ios-app")!
}
}

public var notifications: URL {
var components = URLComponents(url: URL(string: "https://api.ecosia.org/v1/notifications")!, resolvingAgainstBaseURL: false)!
Expand All @@ -162,4 +173,8 @@
]
return components.url!
}

public var storeWriteReviewPage: URL {
URL(string: "https://itunes.apple.com/app/id1474845552/action=write-review")!
}
}
5 changes: 4 additions & 1 deletion firefox-ios/Ecosia/L10N/String.swift
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@
case defaultBrowserCardDetailInstructionStep2 = "Select **Default Browser App**"
case defaultBrowserCardDetailInstructionStep3 = "Choose **Ecosia**"
case defaultBrowserCardDetailButton = "Make default in settings"

Check failure on line 236 in firefox-ios/Ecosia/L10N/String.swift

View workflow job for this annotation

GitHub Actions / build

Lines should not have trailing whitespace (trailing_whitespace)
// MARK: - Feedback View
case reportIssue = "Report an issue"
case helpCenter = "Help Center"
Expand All @@ -242,5 +242,8 @@
case send = "Send"
case close = "Close"
case thankYouForYourFeedback = "Thank you for your feedback!"
case settingsRatingPromptTitle = "Do you enjoy Ecosia?"
case settingsRatingPromptYes = "Yes"
case settingsRatingPromptNo = "No"
}
}
Loading