Giter Site home page Giter Site logo

mohammadrijwan / custom_social_share Goto Github PK

View Code? Open in Web Editor NEW

This project forked from keval-devani/custom_social_share

0.0 0.0 0.0 82 KB

Flutter Plugin for sharing contents to particular social media app or all.

License: MIT License

Ruby 8.11% Objective-C 2.67% Kotlin 19.70% Dart 46.91% Swift 22.61%

custom_social_share's Introduction

custom_social_share

Flutter plugin for sharing text content to most popular social media apps.

You can use it to copy to clipboard, share with WhatsApp, Facebook, Messenger, Instagram, Reddit, Skype, Snapchat, Telegram, Twitter and other social media apps and also with System Share UI.

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

Please use the latest version of package

dependencies:
  ...
  
  custom_social_share: ^latest_version

Setup

Android

There is nothing to set up in android.

iOS

Make sure you add below value in url scheme in your plist file

<key>LSApplicationQueriesSchemes</key>
<array>
    <string>fb</string>
    <string>fb-messenger</string>
    <string>instagram</string>
    <string>line</string>
    <string>linkedin</string>
    <string>reddit</string>
    <string>skype</string>
    <string>slack</string>
    <string>snapchat</string>
    <string>tg</string>
    <string>twitter</string>
    <string>viber</string>
    <string>wechat</string>
    <string>whatsapp</string>
</array>

If you are planning use only WhatsApp, then only add whatsapp url scheme and same for other apps also.

<key>LSApplicationQueriesSchemes</key>
<array>
    <string>whatsapp</string>
</array>

Usage

Add the following imports to your Dart code:

import 'package:custom_social_share/custom_social_share.dart';

Methods

Copy to clipboard

CustomSocialShare().copy("Hii from new plugin https://www.google.com with link");

Open system share UI

CustomSocialShare().toAll("Hii from new plugin https://www.google.com with link");

Get installed social apps for share

var List<ShareWith> = await CustomSocialShare().getInstalledAppsForShare();

To social apps

// to sms
CustomSocialShare().to(ShareWith.sms, "Hii from new plugin https://www.google.com with link");

// to email
CustomSocialShare().to(ShareWith.email, "Hii from new plugin https://www.google.com with link");

// to WhatsApp
CustomSocialShare().to(ShareWith.whatsapp, "Hii from new plugin https://www.google.com with link");

To custom app (Android Only)

// to custom app package
CustomSocialShare().customApp('com.google.android.apps.dynamite', "Hii from new plugin https://www.google.com with link");

These methods will return true if they successfully open to the corresponding app otherwise false.

custom_social_share's People

Contributors

keval-devani avatar mohammadrijwan avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.