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-07-13 11:30:24 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
260bb2c70f119e1471a644c5795594679f0938b5
260bb2c7
1 parent
5ce6e779
fix deeplinking from campaigns
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
0 deletions
SwiftWarplyFramework/SwiftWarplyFramework.xcworkspace/xcuserdata/manos.xcuserdatad/UserInterfaceState.xcuserstate
SwiftWarplyFramework/SwiftWarplyFramework/CampaignViewController.swift
SwiftWarplyFramework/SwiftWarplyFramework.xcworkspace/xcuserdata/manos.xcuserdatad/UserInterfaceState.xcuserstate
View file @
260bb2c
No preview for this file type
SwiftWarplyFramework/SwiftWarplyFramework/CampaignViewController.swift
View file @
260bb2c
...
...
@@ -352,6 +352,35 @@ var timer2: DispatchSourceTimer?
}
public
func
webView
(
_
webView
:
WKWebView
,
decidePolicyFor
navigationAction
:
WKNavigationAction
,
decisionHandler
:
@escaping
(
WKNavigationActionPolicy
)
->
Void
)
{
// if(navigationAction.navigationType == .linkActivated) {
if
let
redirectedUrl
=
navigationAction
.
request
.
url
{
// Example Deeplink: https://cosmote.page.link/loyaltyWallet
// Example Deeplink: https://preview.page.link/cosmote.page.link/loyaltyWallet
// Example Deeplink: https://apps.apple.com/app/id482889196?mt=8
if
redirectedUrl
.
absoluteString
.
contains
(
"cosmote.page.link"
)
{
// check if link can be opened.
guard
UIApplication
.
shared
.
canOpenURL
(
redirectedUrl
)
else
{
decisionHandler
(
.
cancel
)
return
}
UIApplication
.
shared
.
open
(
redirectedUrl
,
options
:
[:],
completionHandler
:
nil
)
decisionHandler
(
.
cancel
)
return
}
}
// }
decisionHandler
(
.
allow
)
}
// MARK: - WKScriptMessageHandler
public
func
userContentController
(
_
userContentController
:
WKUserContentController
,
didReceive
message
:
WKScriptMessage
)
{
...
...
Please
register
or
login
to post a comment