Last updated:
0 purchases
flutter social share
flutter_social_share #
Share your media on social media
Getting Started #
Android #
Add uses permission in android/src/main/AndroidManifest.xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="dev.aislandener.flutter_social_share_example">
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
...
</manifest>
copied to clipboard
Add provider in android/src/main/AndroidManifest.xml
<provider android:name="androidx.core.content.FileProvider"
android:authorities="${applicationId}.flutter.social_share"
android:exported="false"
android:grantUriPermissions="true">
<meta-data android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/file_provider_paths" />
</provider>
copied to clipboard
Create file in android/src/main/res/xml/file_provider_paths.xml and add
<paths xmlns:android="http://schemas.android.com/apk/res/android">
<external-path name="external" path="." />
<external-files-path name="external_files" path="." />
<external-cache-path name="external_cache" path="." />
<files-path name="files" path="." />
</paths>
copied to clipboard
On Android 11 or higher it is necessary to enter a queries in android/src/main/AndroidManifest.xml
For Images:
<queries>
<intent>
<action android:name='com.instagram.share.ADD_TO_STORY' />
<data android:mimeType='image/*' />
</intent>
</queries>
copied to clipboard
For Video:
<queries>
<intent>
<action android:name='com.instagram.share.ADD_TO_STORY' />
<data android:mimeType='video/*' />
</intent>
</queries>
copied to clipboard
iOS #
Add in ios\Runner\Info.plist
<key>LSApplicationQueriesSchemes</key>
<array>
<string>instagram-stories</string>
</array>
copied to clipboard
Usage #
Share to Instagram Story #
FlutterSocialShare.shareToInstagram(
backgroundAssetUri: image_or_movie,
stickerAssetUri: image,
topColor: Colors.deepPurple,
bottomColor: Colors.pinkAccent
);
copied to clipboard
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.