# 调用友盟分享
可以通过友盟分享api调用多个三方平台的分享功能。
# 参数
属性 | 类型 | 默认值 | 必填 | 说明 |
---|---|---|---|---|
umcShareType | number | 是 | 友盟自定义分享渠道 0:QQ好友 1:新浪微博 4:QQ空间 28:支付宝 32:钉钉 | |
title | string | 否 | 分享标题 | |
description | string | 否 | 分享描述 | |
webUrl | string | 否 | 分享网页地址 | |
image | string | 否 | 分享图片地址 | |
videoUrl | string | 否 | 分享视频的地址 | |
musicUrl | string | 否 | 分享音频的地址 |
# 示例代码
传入success函数可监听分享成功事件。
# 分享网页
import { umcShare } from 'flutter-app-jssdk';
umcShare({
umcShareType: 0, // 分享到QQ好友
shareType: 'news',
webUrl: 'http://www.baidu.com',
image: 'http://xxxx.png',
title: '分享标题',
description: '分享描述'
}, () => {
console.log('分享成功');
});
# 分享图片
import { umcShare } from 'flutter-app-jssdk';
umcShare({
umcShareType: 0, // 分享到QQ好友
shareType: 'image',
image: 'http://xxxx.png',
title: '分享标题',
description: '分享描述'
});
# 分享文本
import { umcShare } from 'flutter-app-jssdk';
umcShare({
umcShareType: 0, // 分享到QQ好友
shareType: 'text',
title: '分享文本',
});
# 分享视频
import { umcShare } from 'flutter-app-jssdk';
umcShare({
umcShareType: 0, // 分享到QQ好友
shareType: 'video',
videoUrl: 'http://xxxx.mp4',
title: '分享标题',
description: '分享描述'
});
# 分享音频
import { umcShare } from 'flutter-app-jssdk';
umcShare({
umcShareType: 0, // 分享到QQ好友
shareType: 'audio',
videoUrl: 'http://xxxx.mp3',
title: '分享标题',
description: '分享描述'
});