텍스트, 이미지, 비디오를 페이스북, 트위터, 링크드인, 왓츠앱, 레딧, 텔레그램 등 주요 소셜 미디어 플랫폼으로 원활하게 공유할 수 있는 플러터 플러그인입니다. 안드로이드 및 iOS용으로 설계되었으며, 일관된 API를 통해 크로스플랫폼 소셜 통합을 간소화합니다. 플러그인은 플랫폼별 공유 인텐트를 처리하고 네이티브 공유 대화 상자에 신뢰할 수 있는 접근을 제공합니다. 간단한 공유부터 사용자 정의 메시지와 딥링크 같은 고급 설정까지 지원합니다.
사용 사례
앱 콘텐츠를 소셜 네트워크에 공유하기
사용자 생성 콘텐츠에 소셜 공유 통합
커뮤니티 또는 피드백 기능과의 통합
앱 내에서 빠른 콘텐츠 배포 가능하게 하기
다중 플랫폼 소셜 확산 지원
주요 기능
Android 및 iOS용 크로스 플랫폼 지원
대상 플랫폼의 네이티브 공유 대화 상자
텍스트, 이미지 및 비디오 지원
최소 설정으로 간편한 통합
플랫폼별 공유 동작 처리
미래의 소셜 미디어 추가를 위한 확장 가능
적합한 대상
소셜 공유 기능이 필요한 앱
콘텐츠 기반 애플리케이션
사용자 참여 도구
글로벌 대상 사용자를 위한 모바일 앱
경량 공유 솔루션을 찾는 개발자
고려 사항
플랫폼별 구성이 필요합니다 (예: 안드로이드 매니페스트 항목)
지원되는 플랫폼 및 앱에 제한됨
일부 기기에서는 사용자 권한이 필요할 수 있습니다
외부 앱이 설치되어 있어야 함
공유 이벤트용 내장 분석 없음
원본 README
연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.
social_sharing_plus is a Flutter plugin that allows you to share content, images and videos to various social media platforms like Facebook, Twitter, LinkedIn, WhatsApp, Reddit, and Telegram. This package provides a simple and unified interface for sharing across different apps, handling the nuances and differences of each platform.
🚀 Exciting News! You can now share multiple images and videos with text(optional)! 📸🎥
social_sharing_plus is supported on Android and iOS platforms. On the Android side, queries are made with the package names of the respective apps. This requires the addition of some Android-specific code.
Android (click to expand)
Add queries for app packages
You need to add the following queries to your app's AndroidManifest.xml file to ensure proper redirection to the respective social media apps:
<manifestxmlns:android="http://schemas.android.com/apk/res/android"package="com.example.myapp"><queries><!-- Query for Facebook --><packageandroid:name="com.facebook.katana" /><!-- Query for Twitter --><packageandroid:name="com.twitter.android" /><!-- Query for LinkedIn --><packageandroid:name="com.linkedin.android" /><!-- Query for Reddit --><packageandroid:name="com.reddit.frontpage" /><!-- Query for WhatsApp --><packageandroid:name="com.whatsapp" /><!-- Query for Telegram --><packageandroid:name="org.telegram.messenger" /></queries><application><!-- ... --></application></manifest>
Media Sharing and Media Provider
This provides a specific file provider so that it can share files with other applications. To provide this functionality, you need to create an XML folder under the android>app>src>main>res folder and name it filepaths.xml. Then add the following code to the filepaths.xml file:
This <provider> tag specifies the authorization of your file provider and what file paths it provides. The android:authorities attribute specifies the identity of your file provider, and the ${applicationId}.fileprovider value uses your application's credentials. This ensures the security of your application while allowing other applications to access files.
iOS (click to expand)
No special configuration is needed for iOS.
dependencies:social_sharing_plus:^1.2.3
Usage
import'package:social_sharing_plus/social_sharing_plus.dart';
staticconstSocialPlatform platform = SocialPlatform.facebook;
String? _mediaPath; // add image or video pathList<String> _mediaPaths = []; // add image or video pathsbool isMultipleShare = true;
isMultipleShare
? awaitSocialSharingPlus.shareToSocialMediaWithMultipleMedia(
platform,
media: _mediaPaths,
content: content,
isOpenBrowser: false,
onAppNotInstalled: () {
ScaffoldMessenger.of(context)
..hideCurrentSnackBar()
..showSnackBar(SnackBar(
content: Text('${platform.name.capitalize} is not installed.'),
));
},
)
: awaitSocialSharingPlus.shareToSocialMedia(
platform,
content,
media: _mediaPath,
isOpenBrowser: true,
);
Properties
shareToSocialMedia:
Properties
Required
Default
Description
socialPlatform
true
Platform you want to share on
content
true
Any text you want to share
media
false
The image or video you want to share
isOpenBrowser
false
true
If the relevant application is not installed, it redirects to the link (browser) of the relevant application.
onAppNotInstalled
false
This method works if the application is not installed and the isOpenBrowser value is set to false. (For example: Showing a Snackbar like "The application is not installed on your device."...)
shareToSocialMediaWithMultipleMedia:
Properties
Required
Default
Description
socialPlatform
true
Platform you want to share on
content
false
Any text you want to share
media
true
The image or video you want to share
isOpenBrowser
false
true
If the relevant application is not installed, it redirects to the link (browser) of the relevant application.
onAppNotInstalled
false
This method works if the application is not installed and the isOpenBrowser value is set to false. (For example: Showing a Snackbar like "The application is not installed on your device."...)
Screenshots
Dart Version
sdk:'>=2.17.0 <4.0.0'
Issues
Please file any issues, bugs, or feature requests as an issue on our GitHub page.
Contribute
If you would like to contribute to the plugin (e.g. by improving the documentation, solving a bug, or adding a cool new feature), please carefully review our contribution guide and send us your pull request.
Author
This social_sharing_plus plugin for Flutter is developed by Bedirhan Sağlam. You can contact me at <bedirhansaglam270@gmail.com>