-
Notifications
You must be signed in to change notification settings - Fork 65
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
Receive share intents android #843
Receive share intents android #843
Conversation
@micahmo |
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, this LGTM! This is something I've been wanting for a while, so thanks for taking it on!!
I left some comments on the code.
I also tested this feature and had the following comments.
- Is it possible to add a "subtitle" to the share intent? For example, Boost says "Create post" so it's obvious what's going to happen when you share.
- Is it possible to detect when a URL is shared and place it in the URL field instead of the body of the post? I would guess (but may be wrong) that the most common use case will be sharing news articles, which we would want to post as links.
- This is just a general note, but it would be super cool if we could grab the article title from link and use that as suggested post title, like the Lemmy web UI does. Something for the future. 😊
BTW, I have a coding style note which is totally just a personal preference but I'd like to mention and maybe get some feedback. When checking the value of a nullable bool, I prefer to use an equality test against the value I want, rather than a fallback to the value I don't. For example, I find...
bool? myVal;
if (myVal == true) {}
much more clear than
bool? myVal;
if (myVal ?? false) {}
However again, that's just a preference on my part. 😊
This would be awesome. I'll add it as a feature request. |
Done. final uri = Uri.tryParse(initialText!);
if (uri?.isAbsolute == true) { |
deep links chrome override behavior docs, if text is url in receive intents,
This has been done. Although currently only works for urls coming from intents. |
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.
Thank you so much for responding to all the feedback! I tested again and it works great. I'd say it's good to go! 😊
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.
LGTM! Thanks again for doing this. I think this package also supports iOS so I can work on getting the iOS to handle this properly
It looks like all link handling (i.e., the "open by default" feature) is now triggering the create post page. 😞 I'll see if I can look into this but might need your help @ggichure. EDIT: Looks like it's because EDIT 2: The other problem is that both qemu-system-x86_64_hxPuk0utVy.mp4 |
Interesting. I'll aslo look into it. |
Pull Request Description
This PR adds support to handle incoming intents to create posts.
supporting images, text and URI.
~URIs are handled as plain text and as such will be in the body of the text. ~
Ability to handle URIs and derive title from links.
Issue Being Fixed
Issue Number: #639 #850
Screenshots / Recordings
Checklist
semanticLabel
s where applicable for accessibility?