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

ExternalURLNavigationAction Issue #81

Open
arlee17 opened this issue Feb 4, 2025 · 2 comments
Open

ExternalURLNavigationAction Issue #81

arlee17 opened this issue Feb 4, 2025 · 2 comments

Comments

@arlee17
Copy link

arlee17 commented Feb 4, 2025

Hi, I'm using the version 1.1.0.

The handle(externalURL: URL)method in my app it's not working as it should :

Image

The url builded in Swift in this way :

mainURL.appendingPathComponent("display/native_catalog")

are working well, but the web urls are opening Safari.

In the image the first line it's visiting a tabBar url (created in swift code), the last one a web url.
The documentation says :
"By default, all external urls outside of your app’s domain are opened in the default browser on the device." but I'm in my app domain.

To solve this I have to do :

    func handle(externalURL: URL) -> ExternalURLNavigationAction {
        if externalURL.absoluteString.starts(with: "https://www.\(appName)") 
            || externalURL.absoluteString.starts(with: "https://en.\(appName)")
            || externalURL.absoluteString.contains("native_login#")
        {
            return .reject
        }
        
        return .openViaSystem
    }

I'd like to avoid this as I can have much more cases.

Any help? Thanks

EDIT: In the image I have the dev urls , in the code the production urls, but it's not working anyway

EDIT2 : In Android there is the option to create a custom RouteDecisionHandler and it works as expected, there is something similar here?

@svara
Copy link
Contributor

svara commented Feb 14, 2025

@arlee17 We are currently working on bringing the same RouteDecisionHandler concept used in Android to iOS.

@arlee17
Copy link
Author

arlee17 commented Mar 3, 2025

This is creating several problems for me, I am forced to use the NavigatorDelegate otherwise my urls open in Safari, if I do not delegate the Navigator to itself Navigator(delegate: .self)

How can NavigatorDelegate and WKNavigationDelegate co-exist? Is there any way?

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants