Provide helpful information in the email template

pull/2/head
Michael Scoff 7 years ago
parent 665cf14311
commit 137829bc26
  1. 6
      Trust/Extensions/Bundle.swift
  2. 21
      Trust/Settings/ViewControllers/SettingsViewController.swift

@ -13,6 +13,12 @@ extension Bundle {
var buildNumberInt: Int {
return Int(Bundle.main.buildNumber ?? "-1") ?? -1
}
var fullVersion: String {
let versionNumber = Bundle.main.versionNumber ?? ""
let buildNumber = Bundle.main.buildNumber ?? ""
return "\(versionNumber) (\(buildNumber))"
}
}
var isDebug: Bool {

@ -228,7 +228,7 @@ class SettingsViewController: FormViewController {
<<< TextRow { [weak self] in
$0.title = NSLocalizedString("settings.version.label.title", value: "Version", comment: "")
$0.value = self?.version()
$0.value = Bundle.main.fullVersion
$0.disabled = true
}
}
@ -242,12 +242,6 @@ class SettingsViewController: FormViewController {
}
}
private func version() -> String {
let versionNumber = Bundle.main.versionNumber ?? ""
let buildNumber = Bundle.main.buildNumber ?? ""
return "\(versionNumber) (\(buildNumber))"
}
private func linkProvider(
type: URLServiceProvider
) -> ButtonRow {
@ -289,13 +283,24 @@ class SettingsViewController: FormViewController {
composerController.mailComposeDelegate = self
composerController.setToRecipients([Constants.supportEmail])
composerController.setSubject(NSLocalizedString("settings.feedback.email.title", value: "Trust Feedback", comment: ""))
composerController.setMessageBody("", isHTML: false)
composerController.setMessageBody(emailTemplate(), isHTML: false)
if MFMailComposeViewController.canSendMail() {
present(composerController, animated: true, completion: nil)
}
}
private func emailTemplate() -> String {
return """
\n\n\n
Helpful information to developers:
iOS Version: \(UIDevice.current.systemVersion)
Device Model: \(UIDevice.current.model)
Trust Version: \(Bundle.main.fullVersion)
"""
}
required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}

Loading…
Cancel
Save