Skip to content
Snippets Groups Projects
Commit 55a3ed09 authored by Bruno Muniz's avatar Bruno Muniz :apple:
Browse files

Added deeplink using router

parent 2fcaf4fa
No related branches found
No related tags found
3 merge requests!71Releasing v1.1.5 (214),!67v1.1.5 b(203),!59Invite friends
......@@ -143,8 +143,12 @@ public class AppDelegate: UIResponder, UIApplicationDelegate {
open url: URL,
options: [UIApplication.OpenURLOptionsKey : Any] = [:]
) -> Bool {
if let invitationUsername = getUsernameFromInvitationDeepLink(url) {
self.invitation = invitationUsername
if let username = getUsernameFromInvitationDeepLink(url),
let _ = try? DependencyInjection.Container.shared.resolve() as SessionType,
let router = try? DependencyInjection.Container.shared.resolve() as PushRouter {
invitation = username
router.navigateTo(.search, {})
return true
} else {
return dropboxService.handleOpenUrl(url)
......
......@@ -259,6 +259,11 @@ extension PushRouter {
launchController.pendingPushRoute = route
} else {
switch route {
case .search:
if (navigationController.viewControllers.last as? SearchContainerController) == nil {
navigationController.setViewControllers([SearchContainerController()], animated: true)
}
case .requests:
if (navigationController.viewControllers.last as? RequestsContainerController) == nil {
navigationController.setViewControllers([RequestsContainerController()], animated: true)
......
......@@ -54,6 +54,9 @@ public final class LaunchController: UIViewController {
case .chats:
if let pushRoute = pendingPushRoute {
switch pushRoute {
case .search:
coordinator.toSearch(from: self)
case .requests:
coordinator.toRequests(from: self)
......
......@@ -4,6 +4,7 @@ public struct PushRouter {
public typealias NavigateTo = (Route, @escaping () -> Void) -> Void
public enum Route {
case search
case requests
case groupChat(id: Data)
case contactChat(id: Data)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment