t***@alibabacloud.com
t***@alibabacloud.com
  • 发布:2023-01-28 20:38
  • 更新:2023-01-31 11:59
  • 阅读:518

uni.sendSocketMessage 发送buffer不生效的问题

分类:HBuilderX
this.recorderManager.onStop((res) => {  
      this.getLocalFileBuffer(res)  
        .then(buffer => {  
          // uni.sendSocketMessage 似乎无效,服务端没收到消息  
          uni.sendSocketMessage({  
            data: buffer  
          })  
        })  

    });  

getLocalFileBuffer(res) {  
    return new Promise((solve) => {  
      plus.io.resolveLocalFileSystemURL(res.tempFilePath, entry => {  
        entry.file(file => {  

          var fileReader = new plus.io.FileReader();  
          fileReader.readAsDataURL(file, 'utf-8');  
          fileReader.onloadend = function(evt) {  
            const buffer = uni.base64ToArrayBuffer(evt.target.result);  
            solve(buffer);  
          }  
        })  
      })  
    })  
  }

怀疑是类似问题 https://ask.dcloud.net.cn/question/161872

2023-01-28 20:38 负责人:无 分享
已邀请:
DCloud_UNI_WZF

DCloud_UNI_WZF

App 安卓端复现该问题,感谢反馈,已加分

liyangDXL100

liyangDXL100

解决了吗?

DCloud_Android_ST

DCloud_Android_ST

HX3.6.18+ 云打包机已更新修复该问题。请重新云打包修复该问题

要回复问题请先登录注册