mastodon-ios icon indicating copy to clipboard operation
mastodon-ios copied to clipboard

URL scheme for opening Mastodon links

Open timonus opened this issue 2 years ago • 5 comments

Adding a URL scheme for opening web links to Mastodon entities would let me integrate it into Opener!

timonus avatar Apr 27 '22 17:04 timonus

Is there a way to tell from the URL if its destination is a Mastodon instance or not?

Adding such a URL scheme would probably also fix #423.

vollkorntomate avatar May 10 '22 12:05 vollkorntomate

I think OP meant doing something like mastodon-app://encoded-url-here to open resources in the app assuming that something makes the mastodon-app:// link from some other app. But no, while we do have a somewhat distinct URL structure (/@username/123), this is not unique to Mastodon and things like that should not be hardcoded in my opinion.

Gargron avatar May 10 '22 13:05 Gargron

I came across this because I am adding a Follow on Mastodon button to my app, Unread. I would love the ability to open a URL, something like mastodon-app://user@host, that would open my app's profile in the Mastodon app.

jbrayton avatar Nov 15 '22 02:11 jbrayton

Yes please! Adding x-callback-url functionality would let us do lots of interesting things:

  • Open a user profile
  • Open a post
  • Do a search or open hashtag
  • Compose a new post
  • Open pages of other instances (different from the currently logged-in account), e.g., their Explore, Local, Federated, and about pages.

quinncomendant avatar Nov 23 '22 04:11 quinncomendant

This would be great to have for Android and iOS apps. Currently Mastodon Android apps just hardcode a bunch of instances in the manifest file to allow their links to be handled by the app, instead of the web browser.

A solution would be:

  • A simple URL scheme in the style of mailto:, could be as simple as e.g. mastodon://host, mastodon://user@host, mastodon://user@host/post, etc.
  • A non-intrusive suggestion on the mobile web interface to open the current page "in an app", with an appopriate mastodon: link.

gardenappl avatar Dec 07 '22 08:12 gardenappl

I’d love to have this added as well.

Code would go in here: https://github.com/mastodon/mastodon-ios/blob/e208aedb7a68814682e4b8a82367f31a7279de3e/Mastodon/Supporting%20Files/AppDelegate.swift#L60

I am asking, because I would like to link to my app’s mastodon account from within the app. Usually, users have the native client installed.

Big advantage would be, compared to opening the URL on the web, that the user could directly follow the account because they view it from their own instance.

frogg avatar Dec 29 '22 10:12 frogg