-
Notifications
You must be signed in to change notification settings - Fork 91
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
Expose a new handle(externalURL)
function
#165
Expose a new handle(externalURL)
function
#165
Conversation
I agree with the issues that @olivaresf pointed out. The current behavior of |
safariViewController.preferredControlTintColor = .tintColor | ||
} | ||
|
||
rootViewController.present(safariViewController, animated: true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we are presenting then this needs to be activeNavigationController
in case we are already in a modal context.
Which makes me wonder if we should only expose that property and remove the idea of "root". The active one should always be used from an external API perspective.
I like this approach a lot! I added a comment that should be a quick fix. I also like that we aren't taking on the responsibility of |
Thanks! There's been a lot on my plate, but I'm circling back to this PR tomorrow to fix that issue + any unit tests that are failing. |
@svara @joemasilotti this is good to go, I believe. Hit subscribe and smash that approve button pls 😇 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a great, and a very useful improvement @olivaresf 👏🏻
I found two issues that I think need solving in
TurboNavigationHierarchyController.openExternal(url: URL, navigationType: NavigationStackType)
.UIApplication
(for example, a deeplink to another app).For the hard-coded behavior, I've moved the behavior to TurboNavigator and exposed another function in
TurboNavigatorDelegate
,handle(externalURL:) -> ExternalURLNavigationAction
. The default I chose is to send it to the system so it opens Safari (the app). The framework consumer may choose to open it in-app via a SafariController or it can choose to handle it on its own, maybe alerting the user before navigating away.The delegation pattern solves handling non-http/https URLs. We'll report all external URLs to
TurboNavigator
's delegate, http/https or otherwise.Again, I'm opening a draft so we can discuss it. Happy to change the approach and add unit tests once we're ok with it.