KasemJaffer / receive_sharing_intent

A Flutter plugin that enables flutter apps to receive sharing photos, text and url from other apps.
Apache License 2.0
334 stars 395 forks source link

How can I share only jpg, jpeg and png images into the app? Android. #191

Open UlanNurmatov opened 3 years ago

UlanNurmatov commented 3 years ago

I want to share only jpg, jpeg and png images into the app, only on Android. What should I put in Manifest file?

GastonRafaelCaliva commented 3 months ago

To make your application appear only when sharing jpg, jpeg and png, you have to add the following in android/app/src/main/AndroidManifest.xml

<intent-filter>
    <action android:name="android.intent.action.SEND" />
    <category android:name="android.intent.category.DEFAULT" />
    <data android:mimeType="image/jpeg" />
    <data android:mimeType="image/jpg" />
    <data android:mimeType="image/png" />
</intent-filter>
<intent-filter>
    <action android:name="android.intent.action.SEND_MULTIPLE" />
    <category android:name="android.intent.category.DEFAULT" />
    <data android:mimeType="image/jpeg" />
    <data android:mimeType="image/jpg" />
    <data android:mimeType="image/png" />
</intent-filter>

If you already had something set in your intent-filter such as <data android:mimeType="*/*" />, you should remove it

I have just sent a pr to update the README.md with this new indication #317