share_social_media_plugin 1.2.0

Flutter Android iOS

Share social media plugin, share Line, Twitter, FB, Instagram and more!, I try develop step for step. Any suggestion please contact me.

N|Social media

Share social media plugin

Getting Started #

This project is a starting point for a Flutter plug-in package, a specialized package that includes platform-specific implementation code for Android and/or iOS.

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

Share text in your social media.

  • Line (Android / iOS) πŸ‘
  • Twitter (Android / iOS) πŸ‘
  • Instagram (Android /iOS) πŸ‘

Example #

Share in Line.

 await ShareSocialMediaPlugin.shareLine("My share text");

Share in Twitter

//Set keys
final twitterLogin = new ShareSocialMediaPlugin(
      consumerKey: "consumerKey",
      consumerSecret: 'consumerSecret');

       RaisedButton(
                    child: Text('Share in Twitter', style: TextStyle(fontSize: 20)),
                    onPressed: () async {
                        var response = await twitterLogin.shareTweet("Some message");
                        if (response['text'] != null) {
                          //Success
                          print(response);
                        } else {
                          //Fail
                          print(response);
                        }
                    },
                  ),

**Note For iOS Twitter In plist add:

	<key>CFBundleURLTypes</key>
	<array>
		<dict>
			<key>CFBundleURLSchemes</key>
			<array>
				<string>TwitterLoginSampleOAuth</string>
			</array>
		</dict>
	</array>

Add in your Delegate

ios/Runner/AppDelegate.swift

 import OAuthSwift

 @UIApplicationMain
 @objc class AppDelegate: FlutterAppDelegate {
   override func application(
     _ application: UIApplication,
     didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
   ) -> Bool {
     GeneratedPluginRegistrant.register(with: self)
     return super.application(application, didFinishLaunchingWithOptions: launchOptions)
   }
     //Add this
     override func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool {
        if (url.host == "oauth-callback") {
           OAuthSwift.handle(url: url)
         }else{
           OAuthSwift.handle(url: url)
         }
         return true
     }
 }

!IMPORTANT

In your developer.twitter.com app , you need add the next callback

-TwitterLoginSampleOAuth://

-twittersdk://

Instagram- Share stories (ios /android) #

##Android Read some image from flutter assets

 RaisedButton(
              onPressed: () async {
                  await ShareSocialMediaPlugin.shareInstagram("hello","assets/nofumar.jpg");
              },
              child: Text('Share in Instagram', style: TextStyle(fontSize: 20)),
            )

Public image from album phone

 RaisedButton(
              onPressed: () async {
                 await ShareSocialMediaPlugin.shareInstagramAlbum();
              },
              child: Text('Share in Instagram from album', style: TextStyle(fontSize: 20)),
            )

(For any case add this code in your AndroidManifest.xml)

android/app/src/main/AndroidManifest.xml

   <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>

iOS #

πŸ”₯

 RaisedButton(
              onPressed: () async {
              //shareInstagram("message","image","background");
                  await ShareSocialMediaPlugin.shareInstagram("hello","assets/my_image.jpg","assets/background");
              },
              child: Text('Share in Instagram', style: TextStyle(fontSize: 20)),
            )

In your plist add

 <key>LSApplicationQueriesSchemes</key>
        <array>
            <string>instagram-stories</string>
        </array>

**The user needs to have instagram installed

Thank you!! 🍺🍺🍺🍺🍺🍺

πŸ’– γ‚γ‚ŠγŒγ¨γ†γ”γ–γ„γΎγ™

γŠγ‘γ•γ‚“

γΎγ‚Šγ‚‚γ•γ‚“

まさきさん

をキコさん

γ‚γ‚ŠγŒγ¨γ† Driglo ✨

Thank you for your repo https://github.com/bodnarrr/flutter_twitter_login/blob/master/android/src/main/java/com/bodnarrr/fluttertwitterlogin/fluttertwitterlogin/TwitterLoginPlugin.java

9
likes
80
pub points
62%
popularity

Share social media plugin, share Line, Twitter, FB, Instagram and more!, I try develop step for step. Any suggestion please contact me.

Repository (GitHub)
View/report issues

Documentation

API reference

Uploader

victormanuelfrancodev@gmail.com

License

BSD (LICENSE)

Dependencies

crypto, flutter, http, intl, random_string

More

Packages that depend on share_social_media_plugin