metabolist / metatext

A free, open-source iOS Mastodon client.
https://metabolist.org/metatext
GNU General Public License v3.0
726 stars 101 forks source link

Implement Open in Metatext action extension #207

Closed VyrCossont closed 1 year ago

VyrCossont commented 2 years ago

Summary

Fixes #32 by adding an action extension that allows the user to open web links in Metatext.

Other Information

VyrCossont commented 2 years ago

Demo:

https://user-images.githubusercontent.com/26195552/202938893-abf26b06-cab0-468d-922a-948a853132a3.mov

This is a draft PR because it still needs an error screen to handle the case where the user attempts to open a URL in Metatext without first having logged into a Mastodon instance.

VyrCossont commented 2 years ago

Actually, the user experience when logged out is that they are presented with the "Enter the URL of the Mastodon instance you wish to connect to:" screen. Logging in doesn't open the URL afterwards, because we don't have a way to pass it through to a navigation view model that doesn't exist yet, but this seems like an okay tradeoff for a very rare scenario.

VyrCossont commented 2 years ago

I'm not sure if there's an easy way to (automatically) test this. Are there existing tests for the share extension that I might have missed?

VyrCossont commented 2 years ago

Figured out how to translate the action name in the share sheet using an apparently-plist-specific mechanism. Tested manually on devices set to English and Spanish.