Replies: 2 comments 1 reply
-
|
Answering my own question: Added this to AppDelegate: It might not be the best approach for everyone as it removes another handler (see list here: https://native.hotwired.dev/reference/navigation#route-decision-handlers) but if all your URLs are accounted for in your configurations this is a perfectly viable approach AFAIK. If anyone has a better suggestion I'd love to hear. |
Beta Was this translation helpful? Give feedback.
-
|
You could also do something like this and not lose any other functionality. The route decision handlers are executed in order, so the Google Calendar one would catch before the Safari View Controller one. class GoogleCalendarRouteDecisionHandler: RouteDecisionHandler {
public let name = "google-calendar"
func matches(location: URL, configuration: Navigator.Configuration) -> Bool {
if #available(iOS 16, *) {
location.host() == "google.com" && location.pathComponents.first == "calendar"
} else {
location.host == "google.com" && location.pathComponents.first == "calendar"
}
}
func handle(location: URL, configuration: Navigator.Configuration, navigator: HotwireNative.Navigator) -> HotwireNative.Router.Decision {
UIApplication.shared.open(location)
return .cancel
}
}
Hotwire.registerRouteDecisionHandlers([
AppNavigationRouteDecisionHandler(),
GoogleCalendarRouteDecisionHandler(),
SafariViewControllerRouteDecisionHandler(),
SystemNavigationRouteDecisionHandler()
]) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I have an Add To Google Calendar link in my app which looks like this: https://www.google.com/calendar/render?action=TEMPLATE&ctz=UTC&dates=20250907T180000Z%2F20250907T210000Z&details=A+classic+spot+for+the+poly+crowd.&location=Bar+Le+Record&sprop=https%3A%2F%2Fmyappurl.app%2Fevents%2F3&text=Corn+Moon
On iOS if I click the link from the web application inside of the browser it opens up Google Calendar app but in the iOS Hotwire Native app it opens a browser inside my application which unfortunately is not logged in to my Google account.
Can I force the opening of URLs with the default device browser instead of one inside my application?
Beta Was this translation helpful? Give feedback.
All reactions