mastodon-ios
mastodon-ios copied to clipboard
URL scheme for opening Mastodon links
Adding a URL scheme for opening web links to Mastodon entities would let me integrate it into Opener!
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.
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.
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.
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.
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.
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.