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
2024-09-04 12:30:08 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
48fe1645573816c7297fe8632ac02afa98caa797
48fe1645
1 parent
96833ef9
fix webview open maps
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
0 deletions
SwiftWarplyFramework/SwiftWarplyFramework/CampaignViewController.swift
SwiftWarplyFramework/SwiftWarplyFramework/CampaignViewController.swift
View file @
48fe164
...
...
@@ -469,6 +469,26 @@ var timer2: DispatchSourceTimer?
decisionHandler
(
.
cancel
)
return
}
// Example Deeplink: maps://?q=37.96951649191105,23.72242553856438
if
redirectedUrl
.
absoluteString
.
contains
(
"maps:"
)
{
// Extract the latitude and longitude from the query string
if
let
query
=
redirectedUrl
.
query
{
let
coordinates
=
query
.
replacingOccurrences
(
of
:
"q="
,
with
:
""
)
.
split
(
separator
:
","
)
if
coordinates
.
count
==
2
,
let
lat
=
coordinates
.
first
,
let
lon
=
coordinates
.
last
{
// Create a new Apple Maps URL
if
let
appleMapsUrl
=
URL
(
string
:
"http://maps.apple.com/?daddr=
\(
lat
)
,
\(
lon
)
"
)
{
// Open Apple Maps with the generated URL
UIApplication
.
shared
.
open
(
appleMapsUrl
,
options
:
[:],
completionHandler
:
nil
)
decisionHandler
(
.
cancel
)
return
}
}
}
}
}
// }
...
...
Please
register
or
login
to post a comment