8000 GitHub - chejdj/social_share: a social share plugin
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

chejdj/social_share

Repository files navigation

social_share

A plugin supports variety of sharing contents and sharing platforms.Maybe it is the simplest share tools.

Features

Platforms Content OS
wechat Text/Image/Music/Video/WebPage/File Android/iOS
Facebook Text/Image/WebView/File Android/iOS
Line Text/Image/File Android/iOS
Twiter Text/Image/File Android/iOS
WhatsApp Text/Image/File Andorid/iOS
SystemShare --- ---

Usage

iOS

config in Info.plist file

<array>
		<string>fb</string>
		<string>fbauth</string>
		<string>weixin</string>
		<string>weixinULAPI</string>
		<string>fbapi20150629</string>
		<string>fbapi20160328</string>
		<string>fbapi20130214</string>
		<string>fbapi</string>
		<string>fb-messenger-share-api</string>
		<string>fbauth2</string>
		<string>fbshareextension</string>
		<string>twitter</string>
		<string>whatsapp</string>
		<string>line</string>
</array>

reigster

only should config wechat platform. The appId and secretKey is from WechatOpenPlatform. Other platform no need.

 LaShareRegister register = LaShareRegister();
    register.setupWechat(appId, secretKey, universalLink); //only need wechat 
    LaSharePlugin.registerPlatforms(register);

start share

  • construct share data
LaShareParamsBean generateBean() {
        return LaShareParamsBean(
              contentType: LaShareContentTypes.webpage,
              platform: LaSharePlatforms.whatsApp,
              webUrl: webUrl,
              title: title,
              text: desc,
              imageFilePath: imgFilePath,
            );
    }
  • start share
 LaSharePlugin.share(
          generateBean(),
          notInstallCallBack,
          successCallBack,
          errorCallBack,
        );
  • check App whether install
LaSharePlugin.isClientInstalled(LaSharePlatforms.whatsApp);

Preview

all.png

Attention

  1. iOS wechat image share use the SystemShare because wechat forbidden the image share for foreign company.
  2. You should add some scheme config for accessing outer apps. Refer to example configuration.

About

a social share plugin

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  
0