Skip to content

Commit

Permalink
Merge pull request #23 from TrustlyInc/dev-236314-oauth-demo-bank-app…
Browse files Browse the repository at this point in the history
…-supports-citibank-auth-flow

[DEV-236314] oauth demo bank app supports citibank auth flow
  • Loading branch information
marcosrivereto authored Nov 11, 2024
2 parents 7d84d54 + 0bba538 commit e6d0cb9
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions Sources/TrustlySDK/TrustlyView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ public class TrustlyView : UIView, TrustlyProtocol, WKNavigationDelegate, WKScri
}

func initView() {
self.createNotifications()

if let tempCid = generateCid() {
cid = tempCid
Expand Down Expand Up @@ -181,6 +180,8 @@ public class TrustlyView : UIView, TrustlyProtocol, WKNavigationDelegate, WKScri
public func establish(establishData eD: [AnyHashable : Any], onReturn: TrustlyCallback?, onCancel: TrustlyCallback?) -> UIView? {
establishData = eD

self.createNotifications()

self.addSessionCid()

let deviceType = establishData?["deviceType"] ?? "mobile" + ":ios:native"
Expand Down Expand Up @@ -503,7 +504,7 @@ public class TrustlyView : UIView, TrustlyProtocol, WKNavigationDelegate, WKScri
}

if ("local" == env), let urlLocal = localUrl {
url = "http://"+urlLocal+"/start/selectBank/"+fn+"?v="+build+"-ios-sdk"
url = "http://"+urlLocal+":8000/start/selectBank/"+fn+"?v="+build+"-ios-sdk"
isLocalEnvironment = true

} else {
Expand Down Expand Up @@ -634,7 +635,9 @@ extension TrustlyView {
}

private func proceedToChooseAccount(){
self.mainWebView.evaluateJavaScript("window.Trustly.proceedToChooseAccount();", completionHandler: nil)
DispatchQueue.main.asyncAfter(deadline: .now() + 1.0) {
self.mainWebView.evaluateJavaScript("window.Trustly.proceedToChooseAccount();", completionHandler: nil)
}
}

// MARK: - Utility Functions
Expand All @@ -643,6 +646,9 @@ extension TrustlyView {
}

@objc func closeWebview(notification: Notification){

NotificationCenter.default.removeObserver(self, name: .trustlyCloseWebview, object: nil)

if webSession != nil {
webSession.cancel()
}
Expand Down

0 comments on commit e6d0cb9

Please sign in to comment.