패키지, 저장소 및 앱 카테고리 검색

패키지 상세v1.2.3

social_sharing_plus

Facebook, Twitter, LinkedIn, WhatsApp, Reddit, Telegram 등의 소셜 미디어 플랫폼에 콘텐츠, 이미지 및 비디오를 공유하기 위한 Flutter 플러그인입니다.

AndroidiOS
30일 다운로드
9.3천
좋아요
59
Pub 점수
150

패키지 설치

flutter pub add social_sharing_plus

패키지 개요

공개 정보를 바탕으로 생성한 선택 가이드입니다.

텍스트, 이미지, 비디오를 페이스북, 트위터, 링크드인, 왓츠앱, 레딧, 텔레그램 등 주요 소셜 미디어 플랫폼으로 원활하게 공유할 수 있는 플러터 플러그인입니다. 안드로이드 및 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)! 📸🎥

Table of contents

Setup

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:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.myapp">

    <queries>
        <!-- Query for Facebook -->
        <package android:name="com.facebook.katana" />
        <!-- Query for Twitter -->
        <package android:name="com.twitter.android" />
        <!-- Query for LinkedIn -->
        <package android:name="com.linkedin.android" />
        <!-- Query for Reddit -->
        <package android:name="com.reddit.frontpage" />
        <!-- Query for WhatsApp -->
        <package android:name="com.whatsapp" />
        <!-- Query for Telegram -->
        <package android: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:

<?xml version="1.0" encoding="utf-8"?>
<paths xmlns:android="http://schemas.android.com/apk/res/android">
    <cache-path name="cache" path="." />
    <external-path name="external" path="." />
</paths>

This XML file specifies what types of files your file provider can provide. Then add a <provider> tag in your AndroidManifest.xml file like this:

<provider
    android:name="androidx.core.content.FileProvider"
    android:authorities="${applicationId}.fileprovider"
    android:exported="false"
    android:grantUriPermissions="true">
    <meta-data
        android:name="android.support.FILE_PROVIDER_PATHS"
        android:resource="@xml/filepaths" />
</provider>

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';

static const SocialPlatform platform = SocialPlatform.facebook;
String? _mediaPath; // add image or video path
List<String> _mediaPaths = []; // add image or video paths
bool isMultipleShare = true;

isMultipleShare
    ? await SocialSharingPlus.shareToSocialMediaWithMultipleMedia(
        platform,
        media: _mediaPaths,
        content: content,
        isOpenBrowser: false,
        onAppNotInstalled: () {
          ScaffoldMessenger.of(context)
            ..hideCurrentSnackBar()
            ..showSnackBar(SnackBar(
              content: Text('${platform.name.capitalize} is not installed.'),
            ));
        },
      )
    : await SocialSharingPlus.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>

License

MIT

카테고리

의존성

의존성 목록 1 개

  • plugin_platform_interface^2.0.2

소스 저장소

이 패키지를 사용하는 프로젝트

아직 데이터가 없습니다.