A plugin supports variety of sharing contents and sharing platforms.Maybe it is the simplest share tools.
Platforms | Content | OS |
---|---|---|
Text/Image/Music/Video/WebPage/File | Android/iOS | |
Text/Image/WebView/File | Android/iOS | |
Line | Text/Image/File | Android/iOS |
Twiter | Text/Image/File | Android/iOS |
Text/Image/File | Andorid/iOS | |
SystemShare | --- | --- |
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>
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);
- 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);
- iOS wechat image share use the SystemShare because wechat forbidden the image share for foreign company.
- You should add some scheme config for accessing outer apps. Refer to example configuration.