पैकेज, रिपॉज़िटरी और ऐप श्रेणियाँ खोजें

पैकेज विवरणv2.1.4

flutter_social_share_plugin

सोशल मीडिया पर सामग्री साझा करने के लिए फ्लटर प्लगइन। आप इसका उपयोग फेसबुक, व्हाट्सएप, ट्विटर, एसएमएस, मेल और सिस्टम शेयर यूआई में साझा करने के लिए कर सकते हैं। URL और टेक्स्ट का समर्थन करता है।

AndroidiOS
30-दिन डाउनलोड
967
लाइक
16
Pub अंक
140

पैकेज इंस्टॉल करें

flutter pub add flutter_social_share_plugin

पैकेज अवलोकन

सार्वजनिक जानकारी से बना चयन मार्गदर्शन। केवल संदर्भ हेतु।

एक फ्लटर प्लगइन जो टेक्स्ट और URL को Facebook, WhatsApp, Twitter, SMS, ईमेल और सिस्टम शेयर UI जैसे सोशल मीडिया प्लेटफॉर्म पर आसानी से साझा करने की अनुमति देता है। एंड्रॉइड और आईओएस के लिए डिज़ाइन किया गया है, इसमें नेटिव शेयरिंग फीचर्स के साथ एकीकरण को सरल बनाया गया है। प्लगइन प्लेटफॉर्म के बीच एक स्थिर इंटरफेस प्रदान करता है, जिससे डेवलपर्स को न्यूनतम कोड के साथ शेयरिंग कार्यक्षमता को लागू करने में मदद मिलती है। लोकप्रिय चैनलों के माध्यम से त्वरित सामग्री वितरण की आवश्यकता वाले ऐप्स के लिए आदर्श है।

उपयोग

  • लेखों से लिंक साझा करना
  • सोशल मीडिया पर सामग्री को बढ़ावा देना
  • WhatsApp के माध्यम से संदेश भेजना
  • उपयोगकर्ताओं को ईमेल सामग्री भेजना
  • प्रणाली साझा डायलॉग का उपयोग करना

मुख्य विशेषताएँ

  • कई प्लेटफॉर्म का समर्थन करता है
  • पाठ और URL साझा करें
  • मूल शेयरिंग के साथ एकीकृत होता है
  • साझा करने के लिए सरल API
  • प्लेटफॉर्म के अनुकूलता

इनके लिए उपयुक्त

  • सामग्री ऐप्स
  • समाचार पढ़ने वाले
  • ई-कॉमर्स ऐप्स
  • सोशल मीडिया टूल्स
  • उपयोगकर्ता भागीदारी सुविधाएं

विचार योग्य बातें

  • प्लेटफॉर्म-विशिष्ट सेटअप की आवश्यकता होती है
  • शेयर डायलॉग के सीमित कस्टमाइजेशन
  • लक्ष्य प्लेटफॉर्म के लिए ऐप स्थापना पर निर्भर करता है
  • छवि साझाकरण के लिए समर्थन नहीं
  • कुछ उपकरणों पर उपयोगकर्ता की अनुमति की आवश्यकता हो सकती है

मूल README

संबंधित सोर्स रिपॉज़िटरी के मूल README का स्नैपशॉट। नवीनतम सामग्री के लिए रिपॉज़िटरी देखें।

flutter_social_share_plugin

pub package style: lint

Flutter Plugin for sharing contents to social media.

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

support:

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

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_social_share_plugin as a dependency in your pubspec.yaml file.

Please check the latest version before installation.

dependencies:
  flutter:
    sdk: flutter
  # add flutter_social_share_plugin
  flutter_social_share_plugin: ^2.1.3

Setup

Android
Setup Whatsapp

Make sure you add whatsapp in AndroidManifest.xml.

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
...
    <queries>
        <package android:name="com.whatsapp" />
    </queries>
...
</manifest>
Setup SMS

Make sure you add SMS in AndroidManifest.xml.

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
...
    <uses-permission android:name="android.permission.SEND_SMS" />
...
</manifest>
Setup Instagram

Make sure you add SMS in AndroidManifest.xml.

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
...
    <application>
...
   <provider
            android:name="androidx.core.content.FileProvider"
            android:authorities="${applicationId}.provider"
            android:exported="false"
            android:grantUriPermissions="true">
            <meta-data
                android:name="android.support.FILE_PROVIDER_PATHS"
                android:resource="@xml/file_paths" />
        </provider>
...
    </application>
...
</manifest>
IOS
setup facebook

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

<key>LSApplicationQueriesSchemes</key>
	<array>
		<string>fbauth2</string>
		<string>fb</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.

<key>LSApplicationQueriesSchemes</key>
        <array>
            <string>whatsapp</string>
        </array>
Setup Twiter
<key>LSApplicationQueriesSchemes</key>
        <array>
            <string>twitter</string>
        </array>
Setup SMS
<key>LSApplicationQueriesSchemes</key>
        <array>
            <string>sms</string>
        </array>

Usage

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

Methods

facebook
shareToFacebook({String msg, String imagePath})
Instagram
shareToInstagram({String filePath})
twitter
shareToTwitter({String msg, String url})
whatsapp
shareToWhatsApp({String msg,String imagePath})
shareToWhatsApp4Biz({String msg,String imagePath}) (only android)
telegram
shareToTelegram({String msg})
Sms
shareToSms({String msg})
mail
shareToMail({required String mailBody,String mailSubject,List mailRecipients})
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
String mailBody Text mail Body
String mailSubject Text Mail subject
List mailRecipients List of string for mail recipients

Example

   Container(
          width: double.infinity,
          child: Column(
            children: <Widget>[
              const SizedBox(height: 30),
              ElevatedButton(onPressed: pickImage, child: Text('Pick Image')),
              ElevatedButton(onPressed: pickVideo, child: Text('Pick Video')),
              ElevatedButton(
                  onPressed: () => onButtonTap(Share.twitter),
                  child: const Text('share to twitter')),
              ElevatedButton(
                onPressed: () => onButtonTap(Share.whatsapp),
                child: const Text('share to WhatsApp'),
              ),
              ElevatedButton(
                onPressed: () => onButtonTap(Share.whatsapp_business),
                child: const Text('share to WhatsApp Business'),
              ),
              ElevatedButton(
                onPressed: () => onButtonTap(Share.facebook),
                child: const Text('share to  FaceBook'),
              ),
              ElevatedButton(
                onPressed: () => onButtonTap(Share.share_instagram),
                child: const Text('share to Instagram'),
              ),
              ElevatedButton(
                onPressed: () => onButtonTap(Share.share_telegram),
                child: const Text('share to Telegram'),
              ),
              ElevatedButton(
                onPressed: () => onButtonTap(Share.share_system),
                child: const Text('share to System'),
              ),
              ElevatedButton(
                onPressed: () => onButtonTap(Share.share_sms),
                child: const Text('share to sms'),
              ),
              ElevatedButton(
                onPressed: () => onButtonTap(Share.share_mail),
                child: const Text('share to mail'),
              ),
            ],
          ),
        ),

Contributor

Checkout the full example here

श्रेणियाँ

सोर्स रिपॉज़िटरी

इस पैकेज का उपयोग करने वाले प्रोजेक्ट

अभी कोई डेटा उपलब्ध नहीं है।