更新记录

1.0.0(2020-06-10) 下载此版本

发布


平台兼容性

Android Android CPU类型 iOS
armeabi-v7a:未测试,arm64-v8a:未测试,x86:未测试 ×

原生插件通用使用流程:

  1. 购买插件,选择该插件绑定的项目。
  2. 在HBuilderX里找到项目,在manifest的app原生插件配置中勾选模块,如需要填写参数则参考插件作者的文档添加。
  3. 根据插件作者的提供的文档开发代码,在代码中引用插件,调用插件功能。
  4. 打包自定义基座,选择插件,得到自定义基座,然后运行时选择自定义基座,进行log输出测试。
  5. 开发完毕后正式云打包

付费原生插件目前不支持离线打包。
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原生插件配置”->”云端插件“列表中删除该插件重新选择


//当第三方程序选中文件采用第三方打开后 在index的 onshow方法检测

//获取文件的平台路径 var arg = plus.runtime.arguments; if (arg.startsWith("{")) {//如果是JSON对象,用于以文件形式分享的情况,如:wps if (arg.indexOf("android.intent.extra.STREAM")>0) { var jsonObj=JSON.parse(arg); content = jsonObj['android.intent.extra.STREAM']; } else { //请使用文件或附件方式分享。 return; } }

if (content.startsWith("file://")) { //直接的文件路径,常见QQ中 plus.nativeUI.confirm("是否上传本文件打印", function(e) { if(e.index == 1) { return } else { uploadFile(content); }; }); } else if (content.startsWith("content://com.tencent.mm.external.fileprovider/external/")) { //微信 var filepath = filePath = "file:///storage/emulated/0/" + content.substr(56); plus.nativeUI.confirm("是否上传本文件打印", function(e) { if(e.index == 1) { return } else { uploadFile(filePath); }; }); } else if (content.startsWith("content://com.android.fileexplorer.myprovider/external_files/")) { //小米文件管理器 var filepath = filePath = "file:///storage/emulated/0/" + content.substr(61); plus.nativeUI.confirm("是否上传本文件打印", function(e) { if(e.index == 1) { return } else { uploadFile(filePath); }; }); } else if (content.startsWith("content://com.estrongs.files/")) { //ES文件管理器 var filepath = filePath = "file:///" + content.substr(29); plus.nativeUI.confirm("是否上传本文件打印", function(e) { if(e.index == 1) { return } else { uploadFile(filePath); }; }); } else if (content.startsWith("content://cn.wps.moffice_eng.fileprovider/external/")) { //WPS以文件形式分享 var filepath = filePath = "file:///storage/emulated/0/" + content.substr(51); plus.nativeUI.confirm("是否上传本文件打印", function(e) { if(e.index == 1) { return } else { uploadFile(filePath); }; }); } else if (content.indexOf("external_files/")) { var filepath = filePath = "file:///storage/emulated/0/" + content.substr(content.indexOf("external_files/")+15); plus.nativeUI.confirm("是否上传本文件打印", function(e) { if(e.index == 1) { return } else { uploadFile(filePath); }; }); }else if (content.indexOf("external/")) { var filepath = filePath = "file:///storage/emulated/0/" + content.substr(content.indexOf("external/")+9); plus.nativeUI.confirm("是否上传本文件打印", function(e) { if(e.index == 1) { return } else { uploadFile(filePath); }; }); } else { plus.OpenFile.OpenFileFunction(arg, "0", "0", "0", function(res) { plus.nativeUI.confirm("是否上传本文件打印?", function(e) { if(e.index == 1) { return } else { uploadFile(res); }; }); }, function(res) { mui.alert(res); }); }

隐私、权限声明

1. 本插件需要申请的系统权限列表:

2. 本插件采集的数据、发送的服务器地址、以及数据用途说明:

3. 本插件是否包含广告,如包含需详细说明广告表达方式、展示频率:

许可协议

作者未提供license.md
595***@qq.com

2024-08-22

有没有人说一下咋用呢,我下载好插件云打包 运行 也选择了调试基座,onshow也加了代码,Error in onShow hook: "ReferenceError: content is not defined" 报错

595***@qq.com 2024-08-22

"TypeError: Cannot read property 'startsWith' of undefined"

317***@qq.com

2024-07-09

打开xml文件时,其他应用里找不到应用,pdf,word类的文件可以找到

141***@qq.com

2023-04-24

在qq,微信等里面选择其他应用打开不行吗?

dengkunyao

2022-10-28

大佬能不能提供下更加完整的使用文档?有点云里雾里的...

fwd***@163.com

2022-07-13

index的方在哪里,检测放在什么地方?

胖虎777

2022-04-18

请问安卓要怎么配置啊?我只想json txt pdf文件可以用我的读取。其他的过滤

270***@qq.com

2022-03-03

iOS这边要如何得到文件路径呢? plus.runtime.arguments获取到参数都为0;Android正常

513***@qq.com

2021-05-22

能给demo吗?不知道怎么调用使用

ssd***@163.com

2020-09-16

var Cursor = plus.android.importClass("android.database.Cursor"); var Uri = plus.android.importClass("android.net.Uri") var context = plus.android.runtimeMainActivity(); const path = new Uri.parse(arg) // const scheme = path.getScheme() var cursor = this.ip(context.getContentResolver()).query(path, ['_data'], null, null, null) this.ip(cursor).moveToFirst() var picturePath = '' if (cursor) { var columnIndex = cursor.getColumnIndex('_data') picturePath = 'file://' + cursor.getString(columnIndex) } else { picturePath = '' } console.log(picturePath )

这样可以得到相对路径

496***@qq.com

2020-07-15

支持ios吗?

332***@qq.com 2020-10-30

ios 只需要 manifest.json->app-plus->distribute->ios节点下添加 "capabilities" : { "plists" : { // 合并到工程Info.plist文件的数据(json格式) "CFBundleDocumentTypes" : [ { "CFBundleTypeName" : "com.myapp.common-data", "LSItemContentTypes" : [ "com.microsoft.powerpoint.ppt", "public.item", "com.microsoft.word.doc", "com.adobe.pdf", "com.microsoft.excel.xls", "public.image", "public.content", "public.composite-content", "public.text", "public.data" ] } ] } }, 即可,云打包后生效

2024-07-09

用夜神模拟器可以找到,但真机操作找不到,需要怎么操作啊