Skip to content

Commit a807a44

Browse files
committed
Update framework to version 3.8.0-beta
1 parent 499dd3b commit a807a44

File tree

51 files changed

+39218
-31951
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+39218
-31951
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# Version 3.8.0-beta
2+
2025-26-05
3+
- Added new supported URI `FTRURLType.usernamelessAuth` to handle usernameless authentication and transaction confirmation. `FTRUtils` has been enhanced to support this new URI.
4+
15
# Version 3.7.1-beta
26
2025-11-03
37
- [Changed] Added method `getSessionInfoWithoutUnlock` for retrieving session information without prior unlocking and deprecated `getSessionInfoUnprotected`

CarthageJson/FuturaeKit.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,6 @@
1111
"3.1.7-beta": "https://github.com/Futurae-Technologies/ios-sdk-beta/releases/download/v3.1.7-beta/FuturaeKit-v3.1.7-framework.zip",
1212
"3.4.1-beta": "https://github.com/Futurae-Technologies/ios-sdk-beta/releases/download/v3.4.1-beta/FuturaeKit-v3.4.1-framework.zip",
1313
"3.7.0-beta": "https://github.com/Futurae-Technologies/ios-sdk-beta/releases/download/v3.7.0-beta/FuturaeKit-v3.7.0-framework.zip",
14-
"3.7.1-beta": "https://github.com/Futurae-Technologies/ios-sdk-beta/releases/download/v3.7.1-beta/FuturaeKit-v3.7.1-framework.zip"
14+
"3.7.1-beta": "https://github.com/Futurae-Technologies/ios-sdk-beta/releases/download/v3.7.1-beta/FuturaeKit-v3.7.1-framework.zip",
15+
"3.8.0-beta": "https://github.com/Futurae-Technologies/ios-sdk-beta/releases/download/v3.8.0-beta/FuturaeKit-v3.8.0-framework.zip"
1516
}

FuturaeDemo.xcodeproj/project.pbxproj

Lines changed: 30 additions & 62 deletions
Large diffs are not rendered by default.

FuturaeDemo/AppDelegate.swift

Lines changed: 71 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,9 @@ extension AppDelegate: FTROpenURLDelegate {
294294
case .authentication:
295295
authenticate(url: url, options: options)
296296
return true
297+
case .usernamelessAuth:
298+
usernamelessAuthenticate(url: url)
299+
return true
297300
default:
298301
break
299302
}
@@ -306,24 +309,24 @@ extension AppDelegate: FTROpenURLDelegate {
306309
continue userActivity: NSUserActivity,
307310
restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void
308311
) -> Bool {
312+
print("Received Universal Link: \(userActivity.webpageURL)")
313+
309314
// Check if the activity type is a Universal Link
310315
guard userActivity.activityType == NSUserActivityTypeBrowsingWeb,
311316
let url = userActivity.webpageURL else { return false }
312-
313-
print("Received Universal Link: \(url)")
314317

315318
// Handle the universal link URL here
316319
switch FTRUtils.typeFromURL(url) {
317320
case .activation:
318-
print("ernoll")
319321
enroll(url: url)
320322
return true
321323
case .authentication:
322-
print("authentication")
323324
authenticate(url: url)
324325
return true
326+
case .usernamelessAuth:
327+
usernamelessAuthenticate(url: url)
328+
return true
325329
default:
326-
print("default")
327330
break
328331
}
329332

@@ -395,6 +398,69 @@ extension AppDelegate: FTROpenURLDelegate {
395398
}
396399
}
397400

401+
private func usernamelessAuthenticate(url: URL) {
402+
guard let data = FTRUtils.usernamelessAuthDataFromURL(url),
403+
let userId = try? FTRClient.shared.getAccounts().first?.userId,
404+
let vc = window?.rootViewController else { return }
405+
406+
guard FTRUtils.typeFromURL(url) == .usernamelessAuth,
407+
let usernamelessData = FTRUtils.usernamelessAuthDataFromURL(url)
408+
else { return }
409+
410+
FTRClient.shared.sessionInfo(.with(token: data.sessionToken, userId: userId)) { session in
411+
let extras = session.extraInfo ?? []
412+
let mutableFormattedExtraInfo = extras.reduce("") { result, extraInfo in
413+
result + "\(extraInfo.key): \(extraInfo.value)\n"
414+
}
415+
416+
let title = "Approve"
417+
let message = "Request Information\n\(mutableFormattedExtraInfo)"
418+
let alert = UIAlertController(title: title, message: message, preferredStyle: .alert)
419+
alert.addAction(UIAlertAction(title: "Deny", style: .destructive, handler: nil))
420+
alert.addAction(UIAlertAction(title: "Approve", style: .default, handler: { _ in
421+
do {
422+
let accounts = try FTRClient.shared.getAccounts()
423+
let ac = UIAlertController(title: "Usernameless Auth", message: "Select an account", preferredStyle: .actionSheet)
424+
425+
for account in accounts {
426+
ac.addAction(UIAlertAction(title: account.username ?? "Username N/A", style: .default, handler: { _ in
427+
FTRClient.shared.replyAuth(AuthReplyParameters.approveUsernamelessAuth(data.sessionToken, userId: account.userId, extraInfo: extras), success: {
428+
vc.dismiss(animated: true) {
429+
vc.showAlert(title: "Success", message: "User authenticated successfully!") { _ in
430+
if let redirect = data.mobileAuthRedirectUri {
431+
self.authenticationURLFinished(redirect)
432+
}
433+
}
434+
}
435+
}, failure: { error in
436+
vc.dismiss(animated: true) {
437+
vc.showAlert(title: "Error", message: error.localizedDescription){ _ in
438+
if let redirect = data.mobileAuthRedirectUri {
439+
self.authenticationURLFinished(redirect)
440+
}
441+
}
442+
}
443+
})
444+
}))
445+
}
446+
447+
ac.addAction(UIAlertAction(title: "Cancel", style: .cancel, handler: nil))
448+
449+
vc.dismiss(animated: true) {
450+
vc.present(ac, animated: true, completion: nil)
451+
}
452+
} catch {
453+
vc.showAlert(title: "Error", message: error.localizedDescription)
454+
}
455+
}))
456+
vc.present(alert, animated: true, completion: nil)
457+
} failure: { error in
458+
vc.dismiss(animated: true) {
459+
self.showAlert(title: "Error", message: error.localizedDescription)
460+
}
461+
}
462+
}
463+
398464
private func authenticate(
399465
url authenticationUrl: URL,
400466
options: [UIApplication.OpenURLOptionsKey : Any] = [:]

FuturaeDemo/Other/UIViewController+.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
import UIKit
1010

1111
extension UIViewController {
12-
func showAlert(title:String, message:String) {
12+
func showAlert(title:String, message:String, handler: ((UIAlertAction) -> Void)? = nil) {
1313
let alert = UIAlertController(title: title, message: message, preferredStyle: UIAlertController.Style.alert)
14-
alert.addAction(UIAlertAction(title: "OK", style: UIAlertAction.Style.default, handler: nil))
14+
alert.addAction(UIAlertAction(title: "OK", style: UIAlertAction.Style.default, handler: handler))
1515
self.present(alert, animated: true, completion: nil)
1616
}
1717

FuturaeDemo/SDKConstants.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import Foundation
1111
class SDKConstants: NSObject {
1212
static let SDKID = ""
1313
static let SDKKEY = ""
14-
static let SDKURL = "https://api-test.futurae.com"
14+
static let SDKURL = ""
1515

1616
static let APP_GROUP = "group.futuraedemo"
1717
static let APP_ID = "T82Z6CGNMT.com.futurae.FuturaeDemo"

0 commit comments

Comments
 (0)