Social Share Kit
A Flutter plugin that's support share files to social media like Tiktok, Instagram, Facebook, WhatsApp, Telegram and more.
This plugin was heavily inspired on social_share.
Table of Contents
📱
Supported platforms
- Android 4.1+
- iOS 11+
✨
Features
- Copy to clipboard
- Native Share Options
- Facebook Share
- Story
- Post
- Instagram Share
- Story (Image / Video )
- Post
- Direct Text
- Messenger Share
- Video
- Image
- Link
- Telegram
- Image
- Video
- TikTok Share
- Green Screen
- Video
- Image
- Green Screen
- WhatsApp
- Status
- Image
- Video
🗺
Requirements
You will need an application registered with Facebook Developers. When setting up Android and iOS platforms, you will enter the Facebook AppID in some configuration files.
TikTok
You will need an application registered with TikTok Developers. When setting up Android and iOS platforms, you will enter the TikTok Client Key in some configuration files.
🤖
Android Setup
AndroidManifest.xml
.
First, you need to declare a FileProvider in To use the package's FileProvider, you will have to replace any other low priority authorities, in manifest
tag import android tools
namespace:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.example">
</manifest>
Register the package's FileProvider authority by putting the following configuration in <manifest><application>
:
<provider
android:name="androidx.core.content.FileProvider"
android:authorities="${applicationId}.dev.kaique.social_share_kit"
android:exported="false"
android:grantUriPermissions="true"
tools:replace="android:authorities">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/file_provider_paths" />
</provider>
<!-- other attributes suppressed for better readability -->
<provider
android:authorities="${applicationId}.dev.kaique.social_share_kit;${applicationId}.com.shekarmudaliyar.social_share">
</provider>
Now create a file named file_provider_paths.xml
in res/xml
, putting the following content:
<?xml version="1.0" encoding="utf-8"?>
<paths xmlns:android="http://schemas.android.com/apk/res/android">
<cache-path name="image" path="/"/>
</paths>
If you are going to share in Facebook, insert the following block of code in <manifest><application>
:
<!-- Facebook App ID -->
<meta-data android:name="com.facebook.sdk.ApplicationId"
android:value="INSERT YOUR APP ID FROM FACEBOOK DEVELOPERS"/>
If you are going to share in TikTok, insert the following block of code in <manifest><application>
:
<!-- TikTok Client key -->
<meta-data android:name="TikTokAppID"
android:value="INSERT YOUR CLIENT KEY FROM TIKTOK DEVELOPERS"/>
🍎
iOS Setup
First, you need to to register the url schemes that the application can handle
In the Info.plist
file, add the following array configuration:
<key>LSApplicationQueriesSchemes</key>
<array>
<string>tiktokopensdk</string>
<string>tiktoksharesdk</string>
<string>snssdk1180</string>
<string>snssdk1233</string>
<string>instagram</string>
<string>instagram-stories</string>
<string>fb</string>
<string>fbauth2</string>
<string>fbshareextension</string>
<string>fbapi</string>
<string>facebook-reels</string>
<string>facebook-stories</string>
<string>fb-messenger-share-api</string>
<string>fb-messenger</string>
<string>tg</string>
<string>whatsapp</string>
<string>twitter</string>
</array>
If you are going to share in Facebook, insert the following block of code in Info.plist
:
<key>FacebookAppID</key>
<string>INSERT YOUR APP ID FROM FACEBOOK DEVELOPERS</string>
If you are going to share in TikTok, insert the following block of code in Info.plist
:
<key>TikTokAppID</key>
<string>INSERT YOUR CLIENT KEY FROM TIKTOK DEVELOPERS</string>