Toggle navigation
Toggle navigation
This project
Loading...
Sign in
open-source
/
warply_sdk_framework
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Authored by
Manos Chorianopoulos
2023-10-20 14:56:00 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
0bb8a6d18b8fbd8243c5b77425436adf13cc517b
0bb8a6d1
1 parent
d639b5cf
fix open websiteUrl at MapVC
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
16 deletions
SwiftWarplyFramework/SwiftWarplyFramework/MapsViewController.swift
SwiftWarplyFramework/SwiftWarplyFramework/MapsViewController.swift
View file @
0bb8a6d
...
...
@@ -209,26 +209,53 @@ 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
{
let
eshopWebsite
=
item
.
_website
if
(
eshopWebsite
!=
""
)
{
guard
let
websiteUrl
=
URL
(
string
:
eshopWebsite
)
else
{
print
(
"Error creating URL"
)
return
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"
)
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
;
}
}
// 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
;
}
}
}
// 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"
)
...
...
Please
register
or
login
to post a comment