Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IOS-2400 Universal Links | Add handle for launch #1204

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
deepLinkParser = di.serviceLocator.deepLinkParser()

connectionOptions.shortcutItem.flatMap { _ = handleQuickAction($0) }
if let userActivity = connectionOptions.userActivities.first {
handleUserActivity(userActivity)
}
handleURLContext(openURLContexts: connectionOptions.urlContexts)


Expand All @@ -57,6 +60,10 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
UIApplication.shared.shortcutItems = builder?.buildShortcutItems()
}

func scene(_ scene: UIScene, continue userActivity: NSUserActivity) {
handleUserActivity(userActivity)
}

func windowScene(_ windowScene: UIWindowScene, performActionFor shortcutItem: UIApplicationShortcutItem, completionHandler: @escaping (Bool) -> Void) {
completionHandler(handleQuickAction(shortcutItem))
}
Expand All @@ -78,7 +85,7 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
appActionStorage.action = .deepLink(deepLink)
}

func scene(_ scene: UIScene, continue userActivity: NSUserActivity) {
private func handleUserActivity(_ userActivity: NSUserActivity) {
guard userActivity.activityType == NSUserActivityTypeBrowsingWeb,
let url = userActivity.webpageURL else { return }

Expand Down
Loading