zulip / zulip-flutter

Upcoming Zulip mobile apps for Android and iOS, using Flutter
Apache License 2.0
179 stars 170 forks source link

Share to Zulip from other apps #52

Open gnprice opened 1 year ago

gnprice commented 1 year ago

This is the feature where from some other app on the device, when you say to "share" something, you get a system-provided bit of UI that lets you choose from various apps you can share the thing to. We should make Zulip one of the options there. (In the RN app, we've done this for Android but not iOS: https://github.com/zulip/zulip-mobile/issues/3277)

From some surveying of the options (below), it looks like the way to do this will be to use Flutter's generic infrastructure for talking to platform APIs, rather than try to use an existing plugin for it.

In doing so, we might find there’s a reason this can’t be done real cleanly as a plugin. Or maybe we’ll make a better plugin.

Starting points for taking this on:

Subtasks:

Survey of existing packages for sharing to a Flutter app (These are from notes I took 2023-02-01.) There don't appear to be any existing packages for this problem that are real popular or well maintained. - The most popular is `[receive_sharing_intent](https://pub.dev/packages/receive_sharing_intent)`. From the issue tracker, it seems not actively maintained. - There’s `[receive_multi_sharing_intent](https://pub.dev/packages/receive_multi_sharing_intent)` which is a fork of that one, unmaintained. - There’s `[share_handler](https://pub.dev/packages/share_handler)` which is maintained. - Another observation on all of the above: they call for quite a bit of changes to the project’s own files to fully wire them in. - Newer and Android-only: `[receive_intent](https://pub.dev/packages/receive_intent)`.
Detective-Khalifah commented 7 months ago

Hi, I would like to work on the Android version of this. I am still looking into the packages aforementioned, and a few others. The Flutter way seems straightforward, but relies most on Native Android.

Detective-Khalifah commented 7 months ago

https://github.com/fluttercommunity/plus_plugins/tree/main/packages/android_intent_plus https://pub.dev/packages/android_intent_plus Android-only; repo actively maintained; for sending intents (not receiving)

https://github.com/aboutshout/share_handler/tree/main/share_handler https://pub.dev/packages/share_handler Android, iOS; relatively new; based on https://github.com/KasemJaffer/receive_sharing_intent

https://github.com/fluttercommunity/plus_plugins/tree/main/packages/share_plus/share_plus https://pub.dev/packages/share_plus Android, iOS, Linux, MacOS, Web, Windows; for sending intents (not receiving)

https://github.com/bhagat-techind/flutter_sharing_intent https://pub.dev/packages/flutter_sharing_intent Android, iOS; seems to be based on receive_sharing_intent; looks new, and doesn't support Sharing Text Files (.txt)

https://github.com/daadu/receive_intent https://pub.dev/packages/receive_intent Android; barebones -- developer implementing the package has to specify and handle data being received; does not seem to work with images (https://github.com/daadu/receive_intent/issues/18); not production ready?

https://fluttergems.dev/packages/receive_multi_sharing_intent/ https://pub.dev/packages/receive_multi_sharing_intent Android-only, listed as supporting iOS; can't find actual repo, only forked repo linked

Detective-Khalifah commented 7 months ago

share_handler seems to be the only good package. We might have to work on the issue through native code.

gnprice commented 7 months ago

Thanks for the updated survey. I added more detail in a chat thread.

Let's try using package:receive_intent — I think that's the one option out of these that looks promising.

In particular: