mastodon / mastodon-android

Official Android app for Mastodon
https://app.joinmastodon.org/android
GNU General Public License v3.0
1.72k stars 266 forks source link

Idea: Open Links through Share #772

Open torgeros opened 9 months ago

torgeros commented 9 months ago

I have an idea and am open to discussing it.

It has always been a problem that there is no good way to have this app open mastodon websites when you click a link. Instead of the app automatically open mastodon URLs, you have to copy the link and paste it in the mastodon app.

Now to my suggestion.

What if we used androids share functionality to solve this? Imagine the following:

  1. You see a mastodon link in your android browser.
  2. You long-click it to open up the context menu and select "share this link", in the share menu you click Mastodon.
  3. Now, if this is a relevant url, whatever that means, it opens the profile/page/post in your app. If it is just a random url that cannot be opened in the app, it does what it does already, i.e., creating a new post with the link as it's content.

Downsides: a) It's hard to create signifiers for this, how do you tell the user they can do this? b) You can no longer share links to mastodon profiles & posts through this function. bb) But, in general, it opens the page you want in the app, so you can repost / mention the page which might be preferred over sharing a link anyways.

grishka commented 9 months ago

Now, if this is a relevant url, whatever that means, it opens the profile/page/post in your app. If it is just a random url that cannot be opened in the app, it does what it does already, i.e., creating a new post with the link as it's content.

No need to do this. A single app can have multiple share targets (activities with intent filters matching action android.intent.action.SEND). Instagram is like this for example.

torgeros commented 9 months ago

But we don't know whether the url can be opened in the app before the user shares it.

With a share intent that accept all URLs, the user will be able to have the open "google.com" as a profile. That would require a pop-up telling them "the url you shared is not a mastodon profile" which imho is worse ux than having a select switch for opening vs sharing after mastodon has been opened

Dubzer commented 9 months ago

With a share intent that accept all URLs, the user will be able to have the open "google.com" as a profile

tbh I don't see a real problem there. You just open a default browser with that URL if the app can't