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

패키지 상세v1.4.0

flutter_share_me

소셜 미디어로 콘텐츠를 공유하기 위한 플러터 플러그인입니다. 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를 제공합니다. 빠른 콘텐츠 공유 기능이 필요한 앱에 적합합니다.

사용 사례

  • 앱 내에서 링크 공유하기
  • 소셜 네트워크에 텍스트 업데이트 게시하기
  • 시스템 공유 대화 상자 통합
  • 사용자 생성 콘텐츠 공유 활성화
  • 소셜 공유 버튼 추가
  • 메시지 앱을 통한 콘텐츠 홍보

주요 기능

  • 페이스북, 워츠앱, 트위터 및 시스템 공유를 지원합니다
  • URL 및 일반 텍스트 공유
  • 크로스 플랫폼 호환성 (Android 및 iOS)
  • 간단한 API 통합
  • 플랫폼별 코드가 필요하지 않습니다
  • 시스템 공유 UI로의 내장 백업

적합한 대상

  • 소셜 미디어 앱
  • 콘텐츠 게시 앱
  • 뉴스 또는 블로그 앱
  • 제품 공유 기능이 있는 전자상거래 앱
  • 사용자 공유가 쉬운 앱

고려 사항

  • 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 개

소스 저장소

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