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

Open lemmy links in this app #60

Closed
BardiaB8 opened this issue Jun 24, 2023 · 7 comments
Closed

Open lemmy links in this app #60

BardiaB8 opened this issue Jun 24, 2023 · 7 comments
Labels
enhancement New feature or request fixed in upcoming release Indicates that an issue has been fixed, and will be released in the next version P2 Important issues not at the top of the work list
Milestone

Comments

@BardiaB8
Copy link

Is your feature request related to a problem? Please describe.
It currently isn't possible to open a post from a link in this app.

Describe the solution you'd like
Thunder to appear as an option to open Lemmy links.

Describe alternatives you've considered
Thunder could appear as an app that you can share links to, and open them if they are Lemmy links.

@hjiangsu
Copy link
Member

For this, did you mean that a lemmy link outside of Thunder (e.g., on the browser) should be redirected to Thunder?

@BardiaB8
Copy link
Author

Yes, that's exactly what I mean.

@hjiangsu
Copy link
Member

Ahh, okay - for that, it might take a bit more time to integrate that feature as I'm not too familiar with it. If there is anyone that might know how this could be implemented, feel free to discuss about it here

However, I agree that it would be a nice addition! I'll keep it in mind but it might be lower priority as compared to some other features (unless the community votes otherwise)

@suoko
Copy link

suoko commented Jun 30, 2023

I would Also like to share to thunder the links I visit with my browser

@everdred
Copy link

everdred commented Sep 7, 2023

If there is anyone that might know how this could be implemented, feel free to discuss about it here

@hjiangsu On the Android side, here's how a couple of other open source Android clients implement it:

https://github.com/dessalines/jerboa/blob/main/app/src/main/AndroidManifest.xml
https://codeberg.org/Bazsalanszky/Eternity/src/branch/master/app/src/main/AndroidManifest.xml

Those apps seem to include ~50 of the most common instances. The user can then go in to the OS's App Info (for the client) > Open by default > Add link, and check or uncheck as many of the listed domains as they want.

@micahmo
Copy link
Member

micahmo commented Sep 7, 2023

Looks like Jerboa queries https://api.fediverse.observer to auto-generate that list. Not a bad idea!

https://github.com/dessalines/jerboa/blob/d3c61ac712b171d2411f017142c5e82435f29886/app/update_instances.gradle.kts#L17-L21

As a fallback, we could also allow any link to be shared with Thunder, and if we detect that it's a Lemmy link, we can do smart navigation.

P.S. This same technique (either a hard-coded list, or auto-detect, or a combination) can be used for in-app nav from links in posts.


EDIT

If we want to follow a similar approach, we can use curl to perform a GraphQL query on https://api.fediverse.observer and then throw the results in a file. We should probably check their API terms, but right now it seems free with no limits. Here's an example query.

curl -H 'Content-Type: application/json' -X POST \
-d '{"query": "query {nodes(softwarename: \"lemmy\") {domain active_users_monthly}}"}' https://api.fediverse.observer 2> /dev/null | \
jq -r '.data.nodes | .[] | select(.active_users_monthly > 50) | .domain'
---
beehaw.org
www.hexbear.net
geddit.social
dataterm.digital
lemmy.ml
...

For handling these links in-app, looks like the app_links package is a good one-stop shop, although there is still platform-specific setup required.

@hjiangsu hjiangsu added P2 Important issues not at the top of the work list and removed priority-low labels Sep 11, 2023
@hjiangsu hjiangsu added in-progress Indicates that an issue is currently being worked on and removed help wanted Extra attention is needed labels Nov 11, 2023
@hjiangsu
Copy link
Member

This should now be done for Android with the nightly versions (0.2.5-x). Still working on iOS support in #868 so I'll keep this as in-progress

@hjiangsu hjiangsu added fixed in upcoming release Indicates that an issue has been fixed, and will be released in the next version and removed in-progress Indicates that an issue is currently being worked on labels May 11, 2024
@hjiangsu hjiangsu added this to the 0.4.0 milestone May 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request fixed in upcoming release Indicates that an issue has been fixed, and will be released in the next version P2 Important issues not at the top of the work list
Projects
None yet
Development

No branches or pull requests

5 participants