I was trying to add most of my reddit subs to lemmy. But it is redirected to the website.

  • m-p{3}A
    link
    fedilink
    English
    arrow-up
    6
    ·
    2 years ago

    I think this is more complex to achieve in a clean manner than we think.

    Since the system is federated, which URLs are considered an instance need to either be hardcoded (if you want only links to those to be intercepted as a URL handler) since the Android permission system only allows these to be defined during compile time;

    or you make the app intercepts all https://* websites, basically how a web browser would request permissions to capture all these domains, but then if you tell Connect to always open these links and it’s not a Lemmy website, things will start to break down.

    • provomeister
      link
      fedilink
      English
      arrow-up
      2
      ·
      edit-2
      2 years ago

      Can it be configured to intercept but not launch the app automatically? I’m on Android using the DDG Private Browser and can manually open in the app or use the browser. Is it application or browser dependent?

      Unfortunately, without a proper way to open all instances of Lemmy in an app, this will deter some from this platform.

      • m-p{3}A
        link
        fedilink
        English
        arrow-up
        5
        ·
        2 years ago

        The only way I can see a federated system like this to open links reliably and constantly would be to avoid dealing with hostnames, and instead define a protocol handler.

        Similar to how email client works. You email client is set-up with your mail provider, and the OS will handle the protocol and pass that info to the client

        ie: mailto:username@example.com?subject=Hello&body=Test will make your email client make a new email to be sent to username@example.com, with the Title Hello and Test as the email’s body.

        Something for Lemmy could be make such as lemmy://!lemmyconnect@lemmy.ca to make you open that community in the Lemmy app of your choice. The syntax and parameters could be different than what email defines, I’m just setting an example. Parameters could be made to send a DM to another user, set up filters, sort order, etc.

        Using a protocol handler would make home instance irrelevant and redirections wouldn’t be necessary, as the client/app would do all the heavy lifting.