How can I share an image and text from a (Flutter) app directly to another app?

300 Views Asked by At

We are working on a page in our app where users can share content to social medias like LinkedIn, Facebook and Instagram. We are currently looking into how we can make this experience as seamless as possible.

One solution is that the user, inside our app, selects the app that they want to share to. We would then like to open that app directly so that the user can finish their post. Is there a way to do this consistently across various apps, and on both iOS and Android? I know that Android has Intents, that might work. Is there anything similar on iOS?

Another option is to use the server-to-server API:s, but that might be a bit over complicated.

The third option is to use the native share sheets of both platforms, using the share_plus Flutter package. If we do that, how much control do we have over what is shown? Can we limit what apps and options are shown?

Are there any recommendations (from either Google, Apple or any of the apps we are targeting) about which approach to use? Will the first of my three options even work?

2

There are 2 best solutions below

0
Canilho On

to be honest, this is a feature I haven't explored too much.

I think one of the packages that you might be looking for is this: appinio_social_share, others could have similar features.

On the server side, depending on what is your intent, you might need to create an internal reference for the content. If you notice Twitter posts, Facebook, YouTube Instagram, etc, they all have a unique reference for everything that the user publishes, and that URL is what identifies the item. If you need that reference for your app, you must create an identifier system for your app's shared content.

0
MohitJadav On

As I understand you want to show only apps like WhatsApp, Facebook, and Instagram while sharing the images from your application to the author on choose app intent like this. enter image description here

if you can create a custom layout then it will working same as you want. First, check for installed apps that you want then add that particular app in your bottom sheet.