Skip to content
This repository has been archived by the owner on Oct 5, 2023. It is now read-only.

Added feedback mail: Gmail, Outlook, and the default mail "app mail" REMEMBER TO CHANGE FeedbackMail in Info.plist - Use the appropriate mail address -. #13

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
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
7 changes: 7 additions & 0 deletions apps/ios/GuideDogs/Assets/PropertyLists/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>FeedbackMail</key>
<string>[email protected]</string>
<key>CFBundleDevelopmentRegion</key>
<string>en_US</string>
<key>CFBundleDisplayName</key>
Expand Down Expand Up @@ -52,6 +54,11 @@
<string>5</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>LSApplicationQueriesSchemes</key>
<array>
<string>googlegmail</string>
<string>ms-outlook</string>
</array>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>LSSupportsOpeningDocumentsInPlace</key>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,17 @@ enum MailClient: String, CaseIterable {
// TODO: Add Mail Clients that you would like to support
// These applications must also be defined in 'Queried URL Schemes' in Info.plist

// example: case .outlook
case example
case gmail
case outlook
case defaultMail

var localizedTitle: String {
// TODO: Return a localized title string for each mail client

switch self {
case .example: return GDLocalizedString("")
case .gmail: return GDLocalizationUnnecessary("Gmail")
case .outlook: return GDLocalizationUnnecessary("Outlook")
case .defaultMail: return GDLocalizationUnnecessary("Mail app")
}
}

Expand All @@ -31,7 +34,9 @@ enum MailClient: String, CaseIterable {
// TODO: Return appropriate URL for each mail client

switch self {
case .example: return URL(string: "URL TO OPEN EMAIL WITH SUBECT LINE")
case .gmail: return URL(string: "googlegmail://co?to=\(Bundle.main.object(forInfoDictionaryKey: "FeedbackMail") as! String)&subject=\(escapedSubject)")
case .outlook: return URL(string: "ms-outlook://compose?to=\(Bundle.main.object(forInfoDictionaryKey: "FeedbackMail") as! String)&subject=\(escapedSubject)")
case .defaultMail: return URL(string: "mailto:\(Bundle.main.object(forInfoDictionaryKey: "FeedbackMail") as! String)?subject=\(escapedSubject)")
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class MenuViewController: UIViewController {
menuView.addMenuItem(.settings)
menuView.addMenuItem(.help)
//menuView.addMenuItem(.learningResources)
// menuView.addMenuItem(.feedback)
menuView.addMenuItem(.feedback)
menuView.addMenuItem(.rate)
menuView.addMenuItem(.share)

Expand Down Expand Up @@ -122,7 +122,7 @@ class MenuViewController: UIViewController {
select(.help)

case .feedback:
let alertController = UIAlertController(email: GDLocalizationUnnecessary("[email protected]"),
let alertController = UIAlertController(email: Bundle.main.object(forInfoDictionaryKey: "FeedbackMail") as! String,
subject: GDLocalizedString("settings.feedback.subject"),
preferredStyle: .actionSheet) { [weak self] (mailClient) in
if let mailClient = mailClient {
Expand Down