パッケージ、リポジトリ、アプリカテゴリを検索

パッケージ詳細v1.2.3

social_sharing_plus

Facebook、Twitter、LinkedIn、WhatsApp、Reddit、Telegram などのソーシャルメディアプラットフォームにコンテンツ、画像、動画を共有するためのFlutterプラグイン。

AndroidiOS
30日間ダウンロード
9300
いいね数
59
Pub ポイント
150

パッケージをインストール

flutter pub add social_sharing_plus

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

テキスト、画像、動画をFacebook、Twitter、LinkedIn、WhatsApp、Reddit、Telegramなどの人気のあるソーシャルメディアプラットフォームにスムーズに共有できるFlutterプラグインです。AndroidおよびiOS用に設計されており、一貫したAPIでクロスプラットフォームのソーシャル統合を簡素化します。プラグインはプラットフォーム固有の共有インテントを処理し、ネイティブの共有ダイアログへの信頼性の高いアクセスを提供します。カスタムメッセージやディープリンクなど、シンプルな共有から高度な設定まで対応しています。

用途

  • アプリのコンテンツをソーシャルネットワークに共有する
  • ユーザー生成コンテンツにソーシャル共有を埋め込む
  • コミュニティまたはフィードバック機能との統合
  • アプリ内での迅速なコンテンツ配信を有効にする
  • マルチプラットフォームのソーシャル拡散をサポート

主な機能

  • Android および iOS 用のクロスプラットフォーム対応
  • ターゲットプラットフォーム上のネイティブ共有ダイアログ
  • テキスト、画像、動画のサポート
  • 最小限のセットアップで簡単に統合
  • プラットフォーム固有の共有動作を処理する
  • 将来のソーシャルメディア追加に対応可能

適している対象

  • ソーシャル共有機能を必要とするアプリ
  • コンテンツ駆動型アプリケーション
  • ユーザー参加ツール
  • グローバルなユーザーをターゲットにしたモバイルアプリ
  • 軽量な共有ソリューションを探している開発者

注意事項

  • プラットフォーム固有の構成が必要です(たとえば、Androidマニフェストエントリ)
  • サポートされているプラットフォームおよびアプリに限定
  • 一部のデバイスではユーザーの許可が必要になる場合があります
  • 外部アプリがインストールされていることを前提としています
  • 共有イベント用の組み込み分析なし

元の 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

ソースリポジトリ

このパッケージを使用しているプロジェクト

データはまだありません。