tooot-app / app

https://tooot.app
GNU General Public License v3.0
228 stars 21 forks source link

Support opening any Mastodon URL directly in the app #717

Open sindresorhus opened 1 year ago

sindresorhus commented 1 year ago

It would be useful to be able to open Mastodon links directly in the app. This is especially useful when running the app on macOS.

More details: https://github.com/mastodon/mastodon-ios/issues/968

xmflsct commented 1 year ago

@sindresorhus v4.9.2 is out with this change. Let me know if it doesn't work or needs any adjustments. Thanks!

sindresorhus commented 1 year ago

@xmflsct Thanks for handling this so quickly. I think you forgot the Info.plist changes mentioned in https://github.com/mastodon/mastodon-ios/issues/968

xmflsct commented 1 year ago

@sindresorhus I did not att https into Info.plist as it does seem to work without. Trying open -a 'tooot' 'https://mastodon.social/@sindresorhus/109983299847844086' on my machine does pass the link data correctly and open up the corresponding toot.

I am not an expert in native code though (that is why I went for React Native), let me know if I misunderstood any required declaration.

xmflsct commented 1 year ago

Separate topic, I will reopen this ticket as I notice none of the links work the first time the app is launched (including tooot's schema), only works if the app is already running. Not sure why though as the same Shortcut triggers correctly on iPhone but not on Mac.

sindresorhus commented 1 year ago

Trying open -a 'tooot' 'https://mastodon.social/@sindresorhus/109983299847844086' on my machine does pass the link data correctly and open up the corresponding toot.

It works from open because it's not sandboxed. It will not work from any sandboxed apps (any app in the App Store).

sindresorhus commented 1 year ago

Tested it now. It does not work if I run open -a 'tooot' 'https://mastodon.social/@sindresorhus/109983299847844086' and the app is not already open. This is expected to work.

ain commented 1 year ago

Great call, I could help test it, if needed. Please call it out here then :)