Ios openUrlAccordingToType
Ios openUrlAccordingToType
return
}else if urlType == "phone"{
self.openUrlAccordingToType(urlType: urlType, number: urlPath)
if !MFMailComposeViewController.canSendMail() {
let alert = UIAlertController(title: "No Mail Accounts", message:
"Please set up a Mail account in order to send email.", preferredStyle:
UIAlertController.Style.alert)
alert.addAction(UIAlertAction(title: "OK", style: .default,
handler: nil))
self.present(alert, animated: true, completion: nil)
} else {
self.present(mailComposer, animated: true, completion: nil)
}
actionSheet.addAction(getDirection)
actionSheet.addAction(shareLocation)
actionSheet.addAction(showMap)
actionSheet.addAction(cancel)
if urlPath.contains("openEmail") {
var emailAddess = ""
if let email = urlPath.extractEmailAddress() {
emailAddess = email
}
self.sendEmail(emailid: emailAddess)
}
if !url.absoluteString.contains("@") {
self.pushToWebViewController(url.absoluteString)
} else {
APPUtility.shared.showAlertOnWindow(title:
AppManager.shared.getAppName(), msg: getAppLanguage(for: "Invalid_URL") ?? "Invalid
url!", firstBtnStr: nil)
}
}
}else if urlType == "img"{
print("img")
}else {
print("name")
}