From 2bf7923d56de8ffaf938786ccb411009cde51014 Mon Sep 17 00:00:00 2001 From: Oleg Date: Fri, 24 May 2024 14:25:15 +0700 Subject: [PATCH] MOB-1955 - Added support & feedback for all mail clients (#563) * MOB-1955 - Added support & feedback for all mail clients * Localize feedback subject string --- .../Extensions/Extension-String+Preview.swift | 3 ++- .../Modules/Settings/SettingsView.swift | 21 +++++++++++++------ .../Localization/en.lproj/Localizable.strings | 1 + 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/unstoppable-ios-app/domains-manager-ios/Extensions/Extension-String+Preview.swift b/unstoppable-ios-app/domains-manager-ios/Extensions/Extension-String+Preview.swift index f218effc8..b5b737f3d 100644 --- a/unstoppable-ios-app/domains-manager-ios/Extensions/Extension-String+Preview.swift +++ b/unstoppable-ios-app/domains-manager-ios/Extensions/Extension-String+Preview.swift @@ -453,7 +453,8 @@ extension String { static let settingsAppearanceThemeDark = "SETTINGS_APPEARANCE_THEME_DARK" static let settingsAppearanceChooseTheme = "SETTINGS_APPEARANCE_CHOOSE_THEME" static let youAreUnstoppable = "YOU_ARE_UNSTOPPABLE" - + static let feedbackEmailSubject = "FEEDBACK_EMAIL_SUBJECT" + // Wallets list static let manageICloudBackups = "MANAGE_ICLOUD_BACKUPS" static let restoreFromICloudBackup = "RESTORE_FROM_ICLOUD_BACKUP" diff --git a/unstoppable-ios-app/domains-manager-ios/Modules/Settings/SettingsView.swift b/unstoppable-ios-app/domains-manager-ios/Modules/Settings/SettingsView.swift index 6859f16f6..98c4aca90 100644 --- a/unstoppable-ios-app/domains-manager-ios/Modules/Settings/SettingsView.swift +++ b/unstoppable-ios-app/domains-manager-ios/Modules/Settings/SettingsView.swift @@ -448,12 +448,21 @@ private extension SettingsView { @MainActor func openFeedbackMailForm() { - let mail = MFMailComposeViewController() - - mail.setToRecipients([Constants.UnstoppableSupportMail]) - mail.setSubject("Unstoppable Domains App Feedback - iOS (\(UserDefaults.buildVersion))") - - appContext.coreAppCoordinator.topVC?.present(mail, animated: true) + let canSendMail = MFMailComposeViewController.canSendMail() + let recipientMailAddress = Constants.UnstoppableSupportMail + let subject = String.Constants.feedbackEmailSubject.localized(UserDefaults.buildVersion) + if canSendMail { + let mail = MFMailComposeViewController() + mail.setToRecipients([recipientMailAddress]) + mail.setSubject(subject) + + appContext.coreAppCoordinator.topVC?.present(mail, animated: true) + } else { + let mailURLString = "mailto:\(recipientMailAddress)?subject=\(subject)" + guard let url = URL(string: mailURLString) else { return } + + UIApplication.shared.open(url) + } } } diff --git a/unstoppable-ios-app/domains-manager-ios/SupportingFiles/Localization/en.lproj/Localizable.strings b/unstoppable-ios-app/domains-manager-ios/SupportingFiles/Localization/en.lproj/Localizable.strings index 1e558dee3..16a126245 100644 --- a/unstoppable-ios-app/domains-manager-ios/SupportingFiles/Localization/en.lproj/Localizable.strings +++ b/unstoppable-ios-app/domains-manager-ios/SupportingFiles/Localization/en.lproj/Localizable.strings @@ -343,6 +343,7 @@ "SETTINGS_APPEARANCE_THEME_DARK" = "Dark"; "SETTINGS_APPEARANCE_CHOOSE_THEME" = "Choose theme"; "YOU_ARE_UNSTOPPABLE" = "You are Unstoppable!"; +"FEEDBACK_EMAIL_SUBJECT" = "Unstoppable Domains App Feedback - iOS (%@)"; // Wallets list "MANAGE_ICLOUD_BACKUPS" = "Manage iCloud backups";