-
Notifications
You must be signed in to change notification settings - Fork 67
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
Add support for opening lemmy links #832
Add support for opening lemmy links #832
Conversation
This is awesome, thanks for working on this!! I know it's still a draft, so I didn't officially review, but I wanted to jot down some thoughts before I forgot. Note that I'm not asking for you to do any of these things. Just notes for reference. 😊
Again, super awesome, and please don't take any comments as criticism or asking for extra work. 😊 |
I have in the past used
Correct, only posts for now. Although, I'll look into the comments and user profiles too.
Given that we are using deep links we don't have to verify we own the domains. Deep links are general links that point to specific content within an app. App links on the other hand are designed to verify and ensure that links are opened within the designated app rather than through a web browser, if the app is installed.
I thoroughly enjoy working on Thunder, and I welcome constructive criticism. |
I understand that we don't need to (and can't) verify all the domains. However, I believe we still need to instruct users to enable link handling for all of those domains in the Android settings. For example, if I grab and run your branch, Thunder does not automatically handle those domains. I have to enable them, like this. qemu-system-x86_64_ow54t3xYYh.mp4This is what I mean when I say we should document the process to enable link handling (unless I am misunderstanding something!).
Me too. 😊 Thanks for all the help! |
Yeah, we need to add a guide. |
Hey again! I opened PR #834 to help with auto-generating the supported domain list in the Android manifest file via the GitHub workflows. It assumes that the file already contains... ...
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https"/>
<!-- TODO(lemmy_server_domain_finder): Setup a script to update available lemmy domains -->
<!-- Obtained from github.com/dessalines/jerboa/blob/main/app/src/main/AndroidManifest.xml-->
<!--#AUTO_GEN_INSTANCE_LIST_DO_NOT_TOUCH#-->
...
<data android:host="WHATEVER" />
...
<!--#INSTANCE_LIST_END#-->
</intent-filter>
... We can either...
I have no preference. :) |
Your PR can go in separately. |
I had intended to do a followup to #818 by refactoring a EDIT: #835 adds a P.S. I was thinking you could use the instance page from #824 if they navigate to the root domain and maybe also if they navigate to an unsupported link. |
This is pretty awesome, thanks again for initiating work on this! I don't have too much experience with integrating deep links but I'll see what I can do on the iOS side of things to make it work as well.
I wonder if we can make it easier by having a button which opens up the app settings page for the user to be able to select the applicable domains? I'm not sure if this is possible but it would be a nice QoL feature! |
Using |
Hopefully it should just involve creating/editing an entitlements file, and the code should be the same for both platforms.
That's a great idea, and I'm pretty sure it's possible on Android! |
@micahmo Default instance being used lemmy.ml final ResolveObjectResponse resolveObjectResponse = await lemmy.run(ResolveObject(q: text));
|
That's awesome! Is there any way to get it to the specific settings page for links? Maybe not with permission_manager but maybe with app_settings? Also do you want to add an icon to that setting so that it aligns with the other ones?
It won't be able to resolve an object that is not federated to the current instance. I'm not sure what we can do about that. Maybe just show a message? We could still open it in the browser in the app I suppose. |
app_settings seems like it will do the job. Edit:
Sure.
Sure |
So I've played around a little bit with this yesterday, and unfortunately, there doesn't seem to be a good way to handle this on iOS (that I know of so far). Using Universal Links means that we would need to verify the domains we add to the entitlements/info.plist files. However, since we don't directly own those domains, thats not a possibility. We can use Custom URL schemes, but it doesn't work entirely the same as it does on Android. What happens here is that we need to add any unique custom url schemes that we want to associate with our app which also does not clash with another installed app (e.g., What would need to happen then in this case, is that we would need to have users replace the |
Ah man, that's too bad. I was hoping it would work like Android where the domains are simply disabled by default. But it makes sense from a security perspective why Apple would be a little more restrictive about this. Oh well! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @ggichure, since you marked this ready for review, I went ahead and reviewed. Hope that's ok. 😊 Looks great overall! I left a couple comments on the code. I also took this for a test run.
The UI for the new setting still looks a bit funny, with the leading icon misaligned and the trailing very large. It also doesn't have the same stadium border and inkwell as the rest of the settings. Not sure if it's possible to reuse one of the existing setting widgets with a custom action. Also it still just opens to the main settings page (if you did not intend to change that in this PR, that's totally fine!!).
The main issue is that things don't seem to be working very well for me! I'm sure I'm doing something wrong, but here's what I'm seeing. This is with a post on the same instance that I'm logged in with, so shouldn't be a federation issue. (The same thing happens whether Thunder is already open or not.)
qemu-system-x86_64_OHz2PhdXB8.mp4
P.S. Thanks as always for the additional localization.
So far I haven't found a way to send the user to the page we need . |
|
I'm unable to reproduce this. |
Just did a quick code review and everything seems to be fine with me, nothing too much to point out aside from what was already discussed previously (thanks @micahmo for doing a code review as well!) I unfortunately can't test this myself since I don't have a physical Android device, so I'll leave it up to @micahmo to approve of this if thats okay |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If @ggichure can't reproduce the issue I was seeing, then I approve! Might as well get it into the nightly and get some feedback. 😊
Sounds good! Just to confirm, @ggichure is this PR ready to go? |
Yes it Is. |
Pull Request Description
Add support for opening Lemmy links in app using uni_links
Android support for now.
Issue Being Fixed
Issue Number: #60
Screenshots / Recordings
Checklist
semanticLabel
s where applicable for accessibility?