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

パッケージ詳細v1.4.0

flutter_share_me

ソーシャルメディアへのコンテンツ共有用のFlutterプラグインです。Facebook、WhatsApp、Twitter、システム共有UIに共有できます。URLとテキストの両方をサポートしています。

AndroidiOS
30日間ダウンロード
702
いいね数
187
Pub ポイント
120

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

flutter pub add flutter_share_me

パッケージ概要

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

Flutter Share Me は、Facebook、WhatsApp、Twitter などのソーシャルメディアプラットフォームおよびシステムのネイティブ共有インターフェースにテキストやURLを共有できるFlutterプラグインです。最小限の設定でクロスプラットフォーム共有を簡素化し、AndroidとiOSの両方をサポートしています。開発者がプラットフォーム固有のコードを管理せずにアプリに共有機能を統合できる一貫したAPIを提供します。すばやくコンテンツを共有したいアプリに最適です。

用途

  • アプリ内からリンクを共有する
  • ソーシャルネットワークにテキストの更新を投稿する
  • システム共有ダイアログの統合
  • ユーザー生成コンテンツの共有を有効にする
  • ソーシャル共有ボタンの追加
  • メッセージアプリを通じたコンテンツのプロモーション

主な機能

  • Facebook、WhatsApp、Twitter、システム共有をサポートしています
  • URLとプレーンテキストを共有
  • クロスプラットフォーム互換性(AndroidおよびiOS)
  • シンプルなAPI統合
  • プラットフォーム固有のコードは不要です
  • システム共有UIへの組み込みフォールバック

適している対象

  • ソーシャルメディアアプリ
  • コンテンツ配信アプリ
  • ニュースまたはブログアプリ
  • 製品共有機能付きのECアプリ
  • 簡単なユーザー共有を必要とするアプリ

注意事項

  • Android で適切な権限が必要です
  • 一部のプラットフォームでは、追加の構成が必要になる場合があります
  • 事前に定義された共有ターゲットに制限される
  • 外部アプリの利用可能性に依存する
  • 複雑な共有ワークフローには適していません
  • ユーザーは対象アプリをインストールしている必要があります

元の README

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

flutter_share_me

pub package style: lint

Flutter Plugin for sharing contents to social media.

You can use it share to Facebook , Instagram , WhatsApp(WhatsAppBusiness) , Twitter, telegram And System Share UI. Support Url and Text.

support:

  • Android & iOS : Facebook,WhatsApp(WhatsAppBusiness),Twitter,Instagram,System Share

Note: This plugin is still under development, and some APIs might not be available yet.
Feedback and Pull Requests are most welcome!

Getting Started

add flutter_share_me as a dependency in your pubspec.yaml file.

Please check the latest version before installation.

dependencies:
  flutter:
    sdk: flutter
  # add flutter_share_me
  flutter_share_me: ^0.11.0

Setup

Android

Add "facebook app id" to the application tag of AndroidManifest.xml

    <application>
       ...
       //add this 
        <meta-data
            android:name="com.facebook.sdk.ApplicationId"
            android:value="@string/facebook_app_id" />
            
        <provider
            android:name="com.facebook.FacebookContentProvider"
            android:authorities="com.facebook.app.FacebookContentProvider[facebook_app_id]"
            android:exported="false" />
    </application>

string.xml:

<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Replace "343254889799245" with your Facebook App ID here. -->
    <string name="facebook_app_id">343254889799245</string>
</resources>
IOS
setup facebook

make sure you add below deatils in your plist file.

<key>FacebookAppID</key>
<string>fbid</string>
<key>CFBundleURLTypes</key>
	<array>
		<dict>
			<key>CFBundleURLSchemes</key>
			<array>
				<string>fb-your-fb-id</string>
			</array>
		</dict>
	</array>

Note-: Make sure you add fb in at start of your fb Id in CFBundleURLSchemes.

Add below value in url scheme(Refer to example).

	<array>
		<string>fbauth2</string>
		<string>fbapi</string>
		<string>fbapi20130214</string>
		<string>fbapi20130410</string>
		<string>fbapi20130702</string>
		<string>fbapi20131010</string>
		<string>fbapi20131219</string>
		<string>fbapi20140410</string>
		<string>fbapi20140116</string>
		<string>fbapi20150313</string>
		<string>fbapi20150629</string>
		<string>fbapi20160328</string>
		<string>fbauth</string>
		<string>fb-messenger-share-api</string>
		<string>fbauth2</string>
		<string>fbshareextension</string>
		<string>tg</string>
	</array>
Setup Whatsapp

Make sure you add whatsapp in plist.

        <array>
            <string>whatsapp</string>
        </array>
Setup Twiter
        <array>
            <string>twitter</string>
        </array>

Usage

Add the following imports to your Dart code:
import 'package:flutter_share_me/flutter_share_me.dart';

Methods

facebook
shareToFacebook({String msg, String url})
twitter
shareToTwitter({String msg, String url})
whatsapp
shareToWhatsApp({String msg,String imagePath})
shareToWhatsApp4Biz({String msg,String imagePath}) (only android)
shareWhatsAppPersonalMessage(String message ,String phoneNumber)
instagram
shareToInstagram({String filePath, FileType fileType})
telegram
shareToTelegram({String msg})
system
shareToSystem({String msg}) use system share ui

These methods will return "success" if they successfully jump to the corresponding app.

Parameter Description
String msg Text message
String url Url url
String imagePath The local path of the image

Example

 Container(
          width: double.infinity,
          child: Column(
            crossAxisAlignment: CrossAxisAlignment.center,
            children: <Widget>[
              SizedBox(height: 30),
              ElevatedButton(
                  onPressed: () => onButtonTap(Share.twitter),
                  child: Text('share to twitter')),
              ElevatedButton(
                onPressed: () => onButtonTap(Share.whatsapp),
                child: Text('share to WhatsApp'),
              ),
              ElevatedButton(
                onPressed: () => onButtonTap(Share.whatsapp_business),
                child: Text('share to WhatsApp  Business'),
              ),
              ElevatedButton(
                onPressed: () => onButtonTap(Share.facebook),
                child: Text('share to  FaceBook'),
              ),
              ElevatedButton(
                onPressed: () => onButtonTap(Share.share_system),
                child: Text('share to System'),
              ),
            ],
          ),
        )
Checkout the full example here

カテゴリー

依存関係

依存関係一覧 1 件

ソースリポジトリ

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