Skip to content
New issue

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

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

Already on GitHub? # to your account

ExternalURLNavigationAction Issue #81

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

ExternalURLNavigationAction Issue #81

arlee17 opened this issue Feb 4, 2025 · 0 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?

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

No branches or pull requests

1 participant