Manos Chorianopoulos

fix open websiteUrl at MapVC

......@@ -209,9 +209,13 @@ import MapKit
alert.addAction(UIAlertAction(title: "Δες το eshop", style: .default, handler: { action in
switch action.style{
case .default:
if (self.merchantsArray.count > 0) {
for item in self.merchantsArray {
if (self.couponSet != nil) {
if let merchantUuid: String = self.couponSet?.merchant_uuid {
for item in swiftApi().getMerchantList() {
if (item._uuid == merchantUuid) {
let eshopWebsite = item._website
if (eshopWebsite != "") {
guard let websiteUrl = URL(string: eshopWebsite) else {
print("Error creating URL")
......@@ -229,6 +233,29 @@ import MapKit
}
}
}
}
}
// if (self.merchantsArray.count > 0) {
// for item in self.merchantsArray {
// let eshopWebsite = item._website
//
// if (eshopWebsite != "") {
// guard let websiteUrl = URL(string: eshopWebsite) else {
// print("Error creating URL")
// return
// }
//
// // check if link can be opened.
// guard UIApplication.shared.canOpenURL(websiteUrl) else {
// return
// }
//
// swiftApi().logTrackersEvent("click", "SeeShopWebsite")
// UIApplication.shared.open(websiteUrl, options: [:], completionHandler: nil)
// break;
// }
// }
// }
case .cancel:
print("cancel")
......