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

social_share のカバー
パッケージ詳細v2.3.1

social_share

特定の有名なアプリに直接共有するために必要な、さまざまな共有オプション。

AndroidiOS
30日間ダウンロード
1810
いいね数
409
Pub ポイント
140

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

flutter pub add social_share

パッケージ概要

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

social_share パッケージは、Android および iOS の人気のあるソーシャルメディアアプリにコンテンツを直接共有するためのシンプルで効率的な方法を提供します。WhatsApp、Facebook、Instagram、Twitter など、さまざまなプラットフォームに迅速にコンテンツを投稿できる広範な共有オプションをサポートしています。ネイティブなインテント統合により、デバイス間でスムーズな共有体験を実現します。軽量で実装が簡単なため、複雑な設定なしに堅牢な共有機能が必要なアプリに最適です。

用途

  • ソーシャルメディアへのリンク共有
  • WhatsApp を通じたメッセージの送信
  • Instagramにコンテンツを投稿する
  • Facebookとの統合
  • 迅速なユーザー主導の共有を有効にする
  • クロスプラットフォーム共有のサポート

主な機能

  • 複数のソーシャルプラットフォームをサポートしています
  • ネイティブな意図ベースの共有
  • シンプルなAPI統合
  • クロスプラットフォーム互換性(AndroidおよびiOS)
  • 軽量で高速
  • 簡単な設定

適している対象

  • ソーシャル共有が必要なモバイルアプリ
  • 広範なユーザー参加をターゲットとするアプリ
  • 迅速な共有実装を求める開発者
  • プラットフォーム固有の共有を必要とするプロジェクト
  • ユーザー生成コンテンツ共有を備えたアプリ
  • ソーシャルまたはコミュニティ主導のアプリケーション

注意事項

  • Androidで適切なアプリ権限が必要です
  • 特定のプラットフォームでは、追加のセットアップが必要になる場合があります
  • サポートされているソーシャルアプリに限定
  • 外部アプリの利用可能性に依存します
  • カスタム共有先には適していません
  • プラットフォーム固有の動作は異なる場合があります

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。

social_share

Wide variety of sharing options you'll need to share directly to certain popular apps or just share with default native share.

Introduction

Works on both platforms Android and iOS

It provides you with most of the popular sharing options With this plugin you can share on instagram stories and facebook stories and also copy to clipboard

Usage

Android Configuration
Paste the following attribute in the manifest tag in the android/app/src/main/AndroidManifest.xml:
 		`xmlns:tools="http://schemas.android.com/tools"`
For example:
        <manifest xmlns:android="http://schemas.android.com/apk/res/android"
                xmlns:tools="http://schemas.android.com/tools"
                package="your package...">
Add this piece of code in the manifest/application in the android/app/src/main/AndroidManifest.xml:
 		<provider
            android:name="androidx.core.content.FileProvider"
            android:authorities="${applicationId}.com.shekarmudaliyar.social_share"
            android:exported="false"
            android:grantUriPermissions="true"
            tools:replace="android:authorities">
            <meta-data
                android:name="android.support.FILE_PROVIDER_PATHS"
                android:resource="@xml/filepaths" />
        </provider>
Create a xml file named filepaths.xml in the app/src/main/res/xml folder and paste this code in the file :
<?xml version="1.0" encoding="utf-8"?>
<paths xmlns:android="http://schemas.android.com/apk/res/android">
    <cache-path name="image" path="/"/>
</paths>
iOS Configuration
Add this to your Info.plist to use share on instagram and facebook story
<key>LSApplicationQueriesSchemes</key>
	<array>
	<string>instagram-stories</string>
	<string>facebook-stories</string>
	<string>facebook</string>
	<string>instagram</string>
	<string>twitter</string>
	<string>whatsapp</string>
    <string>tg</string>
	</array>
Add this if you are using share on facebook. For this you have to create an app on https://developers.facebook.com/ and get the App ID
<key>FacebookAppID</key>
<string>xxxxxxxxxxxxxxx</string>
shareInstagramStory
SocialShare.shareInstagramStory(imageFile.path, "#ffffff",
                              "#000000", "https://deep-link-url");
shareInstagramStorywithBackground
 SocialShare.shareInstagramStorywithBackground(image.path, "https://deep-link-url",
                              backgroundImagePath: backgroundimage.path);
shareFacebookStory

For iOS

SocialShare.shareFacebookStory(image.path,"#ffffff","#000000",
                              "https://deep-link-url","facebook-app-id");

For Android appID is mandatory if using shareFacebookStory or else it wont work

SocialShare.shareFacebookStory(image.path,"#ffffff","#000000",
                              "https://deep-link-url","facebook-app-id",
							  appId: "xxxxxxxxxxxxx");
copyToClipboard
SocialShare.copyToClipboard("This is Social Share plugin");
shareTwitter
//without hashtags
SocialShare.shareTwitter("This is Social Share plugin");

//with hashtags
SocialShare.shareTwitter(
                              "This is Social Share twitter example",
                              hashtags: ["hello", "world", "foo", "bar"]);

//with hashtags and link
SocialShare.shareTwitter(
                              "This is Social Share twitter example",
                              hashtags: ["hello", "world", "foo", "bar"],url:"https://your-url-here/");
shareSms
//without url link in message
SocialShare.shareSms("This is Social Share Sms example");

//with url link in message
SocialShare.shareSms("This is Social Share Sms example",url: "https://your-url-here/");
shareWhatsapp
SocialShare.shareWhatsapp("Hello World");
shareTelegram
SocialShare.shareTelegram("Hello World");
shareOptions

This will open the default native share options

//without an image
SocialShare.shareOptions("Hello world");

//with an image
SocialShare.shareOptions("Hello world",imagePath: image.path);
checkInstalledAppsForShare
SocialShare.checkInstalledAppsForShare();

Here's few demo!

Story share on Instagram

insta story share demo

Story share on Facebook

fb story share demo

Copy to Clipboard

copy demo

Known issues

On Android 6, Share to Instagram Stories may not open Instagram app or load the specified image.

Buy me a :coffee: !!

((More coffee == more code) == faster updates)

Donate

カテゴリー

依存関係

依存関係一覧 1 件

ソースリポジトリ

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

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