Show and copy developer email if failed to open the Mail App
This commit is contained in:
parent
885319e2e1
commit
22877c8012
1 changed files with 6 additions and 0 deletions
|
|
@ -98,6 +98,12 @@ class BasicStaticTableViewController: UITableViewController, MFMailComposeViewCo
|
||||||
let subject = urlComponents.queryItems![0].value ?? ""
|
let subject = urlComponents.queryItems![0].value ?? ""
|
||||||
if MFMailComposeViewController.canSendMail() {
|
if MFMailComposeViewController.canSendMail() {
|
||||||
sendEmail(toRecipients: [urlComponents.path], subject: subject)
|
sendEmail(toRecipients: [urlComponents.path], subject: subject)
|
||||||
|
} else {
|
||||||
|
let email = urlComponents.path
|
||||||
|
let alertTitle = "Cannot open Mail App"
|
||||||
|
let alertMessage = "Email copied: \(email)"
|
||||||
|
Utils.copyToPasteboard(textToCopy: email)
|
||||||
|
Utils.alert(title: alertTitle, message: alertMessage, controller: self, completion: nil)
|
||||||
}
|
}
|
||||||
case "http", "https":
|
case "http", "https":
|
||||||
let svc = SFSafariViewController(url: URL(string: link)!, entersReaderIfAvailable: false)
|
let svc = SFSafariViewController(url: URL(string: link)!, entersReaderIfAvailable: false)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue