更新记录
1.0.0(2022-05-13)
无
平台兼容性
Android | Android CPU类型 | iOS |
---|---|---|
适用版本区间:4.4 - 11.0 | armeabi-v7a:未测试,arm64-v8a:未测试,x86:未测试 | 适用版本区间:9 - 15 |
原生插件通用使用流程:
- 购买插件,选择该插件绑定的项目。
- 在HBuilderX里找到项目,在manifest的app原生插件配置中勾选模块,如需要填写参数则参考插件作者的文档添加。
- 根据插件作者的提供的文档开发代码,在代码中引用插件,调用插件功能。
- 打包自定义基座,选择插件,得到自定义基座,然后运行时选择自定义基座,进行log输出测试。
- 开发完毕后正式云打包
付费原生插件目前不支持离线打包。
Android 离线打包原生插件另见文档 https://nativesupport.dcloud.net.cn/NativePlugin/offline_package/android
iOS 离线打包原生插件另见文档 https://nativesupport.dcloud.net.cn/NativePlugin/offline_package/ios
注意事项:使用HBuilderX2.7.14以下版本,如果同一插件且同一appid下购买并绑定了多个包名,提交云打包界面提示包名绑定不一致时,需要在HBuilderX项目中manifest.json->“App原生插件配置”->”云端插件“列表中删除该插件重新选择
文件预览插件
特点:能打开图片,视频,文档,文本等格式的文件;<!--文档后面有具体的介绍-->
Example
let openFileSdk=uni.requireNativePlugin("CL-OpenFile")
//只支持本地文件,路径为绝对路径;
uni.downloadFile({
url:"https://img.zcool.cn/community/0108a559d9ec1ca80121ae0c09046d.JPG@1280w_1l_2o_100sh.jpg",
success:(res) => {
if (res.statusCode === 200) {
let path=res["tempFilePath"];
console.log(res);
let locationPath=plus.io.convertLocalFileSystemURL(path);
console.log(locationPath);
openFileSdk.openFile(locationPath,result=>{
const{code,msg}=result;
//code==0 ,打开成功,其余为失败
uni.showModal({
content:JSON.stringify(result)
})
})
}
},
complete: (e) => {
uni.hideLoading();
}
})
Support
android
{
{".3gp", "video/3gpp"},
{".torrent","application/x-bittorrent"},
{".kml", "application/vnd.google-earth.kml+xml"},
{".gpx", "application/gpx+xml"},
{".csv", "application/vnd.ms-excel"},
{".apk", "application/vnd.android.package-archive"},
{".asf", "video/x-ms-asf"},
{".avi", "video/x-msvideo"},
{".bin", "application/octet-stream"},
{".bmp", "image/bmp"},
{".c", "text/plain"},
{".class", "application/octet-stream"},
{".conf", "text/plain"},
{".cpp", "text/plain"},
{".doc", "application/msword"},
{".docx", "application/vnd.openxmlformats-officedocument.wordprocessingml.document"},
{".xls", "application/vnd.ms-excel"},
{".xlsx", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"},
{".exe", "application/octet-stream"},
{".gif", "image/gif"},
{".gtar", "application/x-gtar"},
{".gz", "application/x-gzip"},
{".h", "text/plain"},
{".htm", "text/html"},
{".html", "text/html"},
{".jar", "application/java-archive"},
{".java", "text/plain"},
{".jpeg", "image/jpeg"},
{".jpg", "image/jpeg"},
{".js", "application/x-javascript"},
{".log", "text/plain"},
{".m3u", "audio/x-mpegurl"},
{".m4a", "audio/mp4a-latm"},
{".m4b", "audio/mp4a-latm"},
{".m4p", "audio/mp4a-latm"},
{".m4u", "video/vnd.mpegurl"},
{".m4v", "video/x-m4v"},
{".mov", "video/quicktime"},
{".mp2", "audio/x-mpeg"},
{".mp3", "audio/x-mpeg"},
{".mp4", "video/mp4"},
{".mpc", "application/vnd.mpohun.certificate"},
{".mpe", "video/mpeg"},
{".mpeg", "video/mpeg"},
{".mpg", "video/mpeg"},
{".mpg4", "video/mp4"},
{".mpga", "audio/mpeg"},
{".msg", "application/vnd.ms-outlook"},
{".ogg", "audio/ogg"},
{".pdf", "application/pdf"},
{".png", "image/png"},
{".pps", "application/vnd.ms-powerpoint"},
{".ppt", "application/vnd.ms-powerpoint"},
{".pptx", "application/vnd.openxmlformats-officedocument.presentationml.presentation"},
{".prop", "text/plain"},
{".rc", "text/plain"},
{".rmvb", "audio/x-pn-realaudio"},
{".rtf", "application/rtf"},
{".sh", "text/plain"},
{".tar", "application/x-tar"},
{".tgz", "application/x-compressed"},
{".txt", "text/plain"},
{".wav", "audio/x-wav"},
{".wma", "audio/x-ms-wma"},
{".wmv", "audio/x-ms-wmv"},
{".wps", "application/vnd.ms-works"},
{".xml", "text/plain"},
{".z", "application/x-compress"},
{".zip", "application/x-zip-compressed"},
{"", "*/*"}
}
IOS with UTI (DocumentInteraction Auto)
{ {".rtf", "public.rtf"}, {".txt", "public.plain-text"}, {".html", "public.html"}, {".htm", "public.html"}, {".xml", "public.xml"}, {".tar", "public.tar-archive"}, {".gz", "org.gnu.gnu-zip-archive"}, {".gzip", "org.gnu.gnu-zip-archive"}, {".tgz", "org.gnu.gnu-zip-tar-archive"}, {".jpg", "public.jpeg"}, {".jpeg", "public.jpeg"}, {".png", "public.png"}, {".avi", "public.avi"}, {".mpg", "public.mpeg"}, {".mpeg", "public.mpeg"}, {".mp4", "public.mpeg-4"}, {".3gpp", "public.3gpp"}, {".3gp", "public.3gpp"}, {".mp3", "public.mp3"}, {".zip", "com.pkware.zip-archive"}, {".gif", "com.compuserve.gif"}, {".bmp", "com.microsoft.bmp"}, {".ico", "com.microsoft.ico"}, {".doc", "com.microsoft.word.doc"}, {".xls", "com.microsoft.excel.xls"}, {".ppt", "com.microsoft.powerpoint. ppt"}, {".wav", "com.microsoft.waveform- audio"}, {".wm", "com.microsoft.windows- media-wm"}, {".wmv", "com.microsoft.windows- media-wmv"}, {".pdf", "com.adobe.pdf"} }