cobi_flutter_share

Creator: coderz1093

Last updated:

0 purchases

cobi_flutter_share Image
cobi_flutter_share Images

Languages

Categories

Add to Cart

Description:

cobi flutter share

This plugin makes the Android the share feature available to Flutter for incoming shares.
Features #

general shares
specific share targets

Usage #
To use this plugin you need to add the following to the main activity in your manifest.xml on Android.
The activity needs:
android:exported="true"
copied to clipboard
and
<intent-filter>
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="*/*" />
</intent-filter>
copied to clipboard
To receive multiple files in one go, add the following:
<intent-filter>
<action android:name="android.intent.action.SEND_MULTPILE" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="*/*" />
</intent-filter>
copied to clipboard
You need one intent-filter filter per mimeType filter.
Share targets #
For share targets (e.g. for specific contacts) you need to create an xml file in your resource folder, e.g. like this one:
<?xml version="1.0" encoding="utf-8"?>
<shortcuts xmlns:android="http://schemas.android.com/apk/res/android">
<share-target android:targetClass="de.cobinja.example.MainActivity">
<data android:mimeType="text/plain" />
<category android:name="de.cobinja.CATEGORY_ONE" />
</share-target>
</shortcuts>
copied to clipboard
This xml file has to be referenced for the activity in your Manifest.xml:
<meta-data
android:name="android.app.shortcuts"
android:resource="@xml/shortcuts" />
copied to clipboard
For more information on how to compose these shortcut xml files please see Android's documentation
Please also see the included example.
Additional information #
This is a federated plugin, so implementations for platforms other than Android are welcome. Due to my lack of Apple hardware I cannot implement it for their products myself.

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.