GithubHelp home page GithubHelp logo

Comments (9)

devxoul avatar devxoul commented on July 17, 2024 1

screensort://home and screensort://home/share/1 is totally different. If you want to use such like /home/share/1, you should use URL pattern such like screensort://home/share/<id>.

from urlnavigator.

hilen avatar hilen commented on July 17, 2024 1

Cool, many thanks

from urlnavigator.

devxoul avatar devxoul commented on July 17, 2024

You have to map URLHandler.

Navigator.map("myapp://tab/profile") { url, values in
  let tabBarController = findTabBarController() // need your own method
  tabBarController.selectedIndex = 1
}

Then use open().

Navigator.open("myapp://tab/profile")

from urlnavigator.

hilen avatar hilen commented on July 17, 2024

Thanks for your reply. Here is my code:

  static func initialize() {
        Navigator.map("screensort://home") { url, values in
            let homeController = AppDelegate.shared().homeViewController
            guard let action = values["action"] as? String else { return false}
            guard let count = values["count"] as? Int else { return false}

            homeController.openURLAction = action
            homeController.openURLCount = count
            homeController.fromURL = true

            if homeController.openURLAction == "share" {
                homeController.doShare()
            } else if homeController.openURLAction == "delete" {
                homeController.doDelete()
            }
            return true
        }
    }

My URL is myapp://home/share/1
But it does not work.
And I should put the map URLHandler in func application(_ application: UIApplication, open url: URL, sourceApplication: String?, annotation: Any) -> Bool {} or in the NavigationMap.initialize() ?

from urlnavigator.

hilen avatar hilen commented on July 17, 2024

I had an another issue. And when the app is killed. I want to open it from openURL, launch the rootViewController and call its function, but it crashed. How to debug?

from urlnavigator.

devxoul avatar devxoul commented on July 17, 2024

@hilen I couldn't understand.

from urlnavigator.

hilen avatar hilen commented on July 17, 2024

I mean I want to test the case that app is not running on the background. I open a URL like navigator://home/share. The normal situation is that the app is launching and then call the methodfunc share(). But now it crashed. I don't know how to debug. Cause I can't make a breakpoint.

from urlnavigator.

devxoul avatar devxoul commented on July 17, 2024

@hilen, http://stackoverflow.com/questions/18521276/ios-how-to-debug-freshly-launching-an-app-from-a-url could help you.

from urlnavigator.

hilen avatar hilen commented on July 17, 2024

I will have a look at it. Thanks. @devxoul

from urlnavigator.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.