更新记录
1.0.2(2024-05-17)
处理FileProvider,避免和其他插件冲突。
1.0.1(2024-04-30)
删除插件内部UTSiOS.getResourcePath、UTSAndroid.getResourcePath转换文件路径逻辑,需要开发者外部自行进行处理后调用。
1.0.0(2024-04-20)
初始化版本发布
查看更多平台兼容性
uni-app
Vue2 | Vue3 | Chrome | Safari | app-vue | app-nvue | Android | iOS | 鸿蒙 |
---|---|---|---|---|---|---|---|---|
√ | √ | - | - | - | - | 4.4 | 12 | - |
微信小程序 | 支付宝小程序 | 抖音小程序 | 百度小程序 | 快手小程序 | 京东小程序 | 鸿蒙元服务 | QQ小程序 | 飞书小程序 | 快应用-华为 | 快应用-联盟 |
---|---|---|---|---|---|---|---|---|---|---|
× | × | × | × | × | × | - | × | × | × | × |
uni-app x
Chrome | Safari | Android | iOS | 鸿蒙 | 微信小程序 |
---|---|---|---|---|---|
- | - | 5.0 | 12 | - | × |
概述
XF-shareUTS封装了用Android和iOS系统功能进行分享文件的功能。
插件接口
shareText
文本分享
uni-app项目中(nvue)调用示例:
复制代码import { shareText } from "@/uni_modules/XF-shareUTS"
shareText({
content: "",
complete: (res) => {
console.log(res)
}
});
uni-app x项目(uvue)中调用示例:
复制代码import { shareText } from "@/uni_modules/XF-shareUTS";
import { ShareTextOptions } from "@/uni_modules/XF-shareUTS/utssdk/interface.uts";
let options = {
content: "",
complete: (res : any) => {
console.log(res)
}
} as ShareTextOptions;
shareText(options);
可用性
iOS、Android系统
可提供的1.0.0及更高版本
shareImage
图片分享
uni-app项目中(nvue)调用示例:
复制代码import { shareImage } from "@/uni_modules/XF-shareUTS"
shareImage({
imagePath: [""],
complete: (res) => {
console.log(res)
}
});
uni-app x项目(uvue)中调用示例:
复制代码import { shareImage } from "@/uni_modules/XF-shareUTS";
import { ShareImageOptions } from "@/uni_modules/XF-shareUTS/utssdk/interface.uts";
let options = {
imagePath: [""],
complete: (res : any) => {
console.log(res)
}
} as ShareImageOptions;
shareImage(options);
可用性
iOS、Android系统
可提供的1.0.0及更高版本
shareVideo
视频分享
uni-app项目中(nvue)调用示例:
复制代码import { shareVideo } from "@/uni_modules/XF-shareUTS"
shareVideo({
videoPath: [""],
complete: (res) => {
console.log(res)
}
});
uni-app x项目(uvue)中调用示例:
复制代码import { shareVideo } from "@/uni_modules/XF-shareUTS";
import { ShareVideoOptions } from "@/uni_modules/XF-shareUTS/utssdk/interface.uts";
let options = {
videoPath: [""],
complete: (res : any) => {
console.log(res)
}
} as ShareVideoOptions;
shareVideo(options);
可用性
iOS、Android系统
可提供的1.0.0及更高版本
shareFile
文件分享
uni-app项目中(nvue)调用示例:
复制代码import { shareFile } from "@/uni_modules/XF-shareUTS"
shareFile({
filePath: "",
complete: (res) => {
console.log(res)
}
});
uni-app x项目(uvue)中调用示例:
复制代码import { shareFile } from "@/uni_modules/XF-shareUTS";
import { ShareFileOptions } from "@/uni_modules/XF-shareUTS/utssdk/interface.uts";
let options = {
filePath: "",
complete: (res : any) => {
console.log(res)
}
} as ShareFileOptions;
shareFile(options);
可用性
iOS、Android系统
可提供的1.0.0及更高版本
大佬,ios里使用plus.downloader下载的文件,如何使用该插件调起分享?现在现在下来,使用示例的方式,调不起来分享界面?