应该与这个问题类似,本质原因应该是不够精准 https://developers.weixin.qq.com/community/develop/doc/0004a840c94aa06081b867ca851c00 getLocation接口本身定位是快速拿到位置,因此在安卓机上会表现出定位不准的情况 针对这个情况,小程序侧支持:1.持续定位接口,越来越准; 2.getLocation提供精确定位的参数 留意官网文档更新。
【获取定位】加速度慢时经纬度长时间不变希望实现绘制行进路线功能,绘制路线在企业微信端,通过小程序传送定位数据,两秒获取一次,测试几次后发现,如果行进途中速度比较慢,比如行走,定位数据长时间不会变化,甚至坐公交,坐标变化也很慢,公交开出几百米,坐标才变化一次,导致绘制的路线有些奇怪。 开车测试后,发现车速快时路线很精准。 请问是什么原因导致的呢?
2019-07-23getLocation接口本身定位是快速拿到位置,因此在安卓机上会表现出定位不准的情况 针对这个情况,小程序侧支持:1.持续定位接口,越来越准; 2.getLocation提供精确定位的参数 留意官网文档更新。
wx.getLocation 安卓定位精度低 IOS正常安卓手下定位精度一直很低,测试过多部手机,精度基本在30左右,而且经常不更新,手机内置的导航软件很正常。 在IOS下精度一直在10米以内。社区里已经多名开发者提出此问题,请官方抽出时间跟进一下。 https://developers.weixin.qq.com/community/develop/doc/000e06585741307c608850a8a5b800?highLine=%25E5%25AE%2589%25E5%258D%2593%2520wx.getLocation%2520%25E7%25B2%25BE%25E5%25BA%25A6 var _this = this; //设置计时器,不停获取位置信息以测速 gps: setInterval(function () { wx.getLocation({ type: 'wgs84', success(res) { if (res.speed == -1) { _this.setData({ accuracy: res.accuracy, speed: 0 }) } else { _this.setData({ accuracy: res.accuracy, speed: res.speed * 3.6 }) } }, }) }, 1000) //1秒刷新一次
2019-07-2310009表示手机不支持低功耗蓝牙 你可能要检查: 硬件设备是否支持ble; 2.大多数手机都是支持低功耗的,不支持可能是太老了,这种手机官方暂时也不支持的。 ps:理论上该手机是支持传统蓝牙接口的,但小程序这边正规划支持这个特性
安卓机连接便携式蓝牙打印机提示10009错误你好,我用安卓机连接搜索到的便携式打印机,显示蓝牙版本低于4.3的10009错误,这个有什么好的解决方案吗?
2019-07-23报错信息是系统定位无权限,不是小程序无权限哈,应该是检查下是否微信有定位权限。 新版本已修复,添加了申请定位授权的交互.
wx.getLocation()接口部分手机请求失败,前提是所有位置权限都打开情- 当前 Bug 的表现(可附上截图) Honor 10 Lite手机在所有位置权限都打开的情况下(微信可以分享位置信息;小程序位置权限也打开状态下),请求wx.getLocation()接口进入fail函数,无论怎么请求都是fail函数;日志已经上传,微信号:ldy18332090837;上传时间:2019-7-1 11:59 [图片] [图片] [图片] [图片] - 预期表现 - 复现路径 - 提供一个最简复现 Demo
2019-07-23与机型强相关么?
关闭蓝牙开关没有走回调- 当前 Bug 的表现(可附上截图) HUAWEI_Nexus 6P连接设备后,关闭蓝牙开关,没有走onBluetoothAdapterStateChange回调,也没有走 onBLEConnectionStateChange回调,重新打开蓝牙开关,连接之前设备时提示errCode:-1,errMsg:already connected,若连接另外一台设备,可成功。 。 日志已上传:手机型号: HUAWEI-NEXUS 6P 微信号:xinyu139399 时间:2019.07.4 14:13
2019-07-23看上去是少了一段Manufacture data是么? android和ios都有问题?
安卓蓝牙扫描广播包不全安卓手机扫描的广播包和原生扫描的广播包不一致,为是什么呢? [图片]
2019-07-16看日志没有看出啥... 提供下微信,给个测试包加些日志看看?thx
getBLEDeviceServices "errCode":10004- 当前 Bug 的表现(可附上截图) 小米9 真机调试蓝牙 总出现10004 code ,不知道原因,偶尔不会出现 14:16:40.702 index.js:40 openBluetoothAdapter success {errMsg: "openBluetoothAdapter:ok"} 14:16:40.913 index.js:75 startBluetoothDevicesDiscovery success {errCode: 0, errMsg: "startBluetoothDevicesDiscovery:ok", isDiscovering: true} 14:16:43.572 index.js:115 createBLEConnection success {"errCode":0,"errMsg":"createBLEConnection:ok"} 14:16:44.005 index.js:152 getBLEDeviceServices 34:03:DE:58:7C:3D fail {"errCode":10004,"errMsg":"getBLEDeviceServices:fail:no service"} - 预期表现 - 复现路径 - 提供一个最简复现 Demo 官方蓝牙demo修改的 openBluetoothAdapter() { wx.openBluetoothAdapter({ success: (res) => { console.log('openBluetoothAdapter success', res) this.startBluetoothDevicesDiscovery() }, fail: (res) => { if (res.errCode === 10001) { wx.onBluetoothAdapterStateChange(function (res) { console.log('onBluetoothAdapterStateChange', res) if (res.available) { this.startBluetoothDevicesDiscovery() } }) } } }) }, getBluetoothAdapterState() { wx.getBluetoothAdapterState({ success: (res) => { console.log('getBluetoothAdapterState', res) if (res.discovering) { this.onBluetoothDeviceFound() } else if (res.available) { this.startBluetoothDevicesDiscovery() } } }) }, startBluetoothDevicesDiscovery() { if (this._discoveryStarted) { return } this._discoveryStarted = true wx.startBluetoothDevicesDiscovery({ allowDuplicatesKey: true, success: (res) => { console.log('startBluetoothDevicesDiscovery success', res) this.onBluetoothDeviceFound() }, }) }, stopBluetoothDevicesDiscovery() { wx.stopBluetoothDevicesDiscovery() }, onBluetoothDeviceFound() { wx.onBluetoothDeviceFound((res) => { res.devices.forEach(device => { if (!device.name && !device.localName) { return } const foundDevices = this.data.devices const idx = inArray(foundDevices, 'deviceId', device.deviceId) const data = {} if (idx === -1) { data[`devices[${foundDevices.length}]`] = device } else { data[`devices[${idx}]`] = device } this.setData(data) }) }) }, onBLEConnectionStateChange(){ wx.onBLEConnectionStateChange(function (res) { // 该方法回调中可以用于处理连接意外断开等异常情况 console.log(`device ${res.deviceId} state has changed, connected: ${res.connected}`) }) }, createBLEConnection(e) { var that = this const ds = e.currentTarget.dataset const deviceId = ds.deviceId const name = ds.name wx.createBLEConnection({ deviceId, success: (res) => { console.log('createBLEConnection success', JSON.stringify(res)) this.setData({ connected: true, name, deviceId, }) //this.getBLEDeviceServices(deviceId) setTimeout(function () { that.getBLEDeviceServices(deviceId) }, 300) setInterval(function () { that.onBLEConnectionStateChange()},5000) } }) this.stopBluetoothDevicesDiscovery() }, closeBLEConnection() { wx.closeBLEConnection({ deviceId: this.data.deviceId }) this.setData({ connected: false, chs: [], canWrite: false, }) }, getBLEDeviceServices(deviceId) { var that =this wx.getBLEDeviceServices({ deviceId, success: (res) => { console.log('getBLEDeviceServices ' + deviceId+ ' success', JSON.stringify(res)) for (let i = 0; i < res.services.length; i++) { if (res.services[i].isPrimary && res.services[i].uuid.indexOf("0000FFF0") != -1) { this.getBLEDeviceCharacteristics(deviceId, res.services[i].uuid) } } }, fail:(res)=>{ console.log('getBLEDeviceServices ' + deviceId + ' fail', JSON.stringify(res)) //setTimeout(function () { that.getBLEDeviceServices(deviceId)} , 3000 ) } }) }, getBLEDeviceCharacteristics(deviceId, serviceId) { wx.getBLEDeviceCharacteristics({ deviceId, serviceId, success: (res) => { console.log('getBLEDeviceCharacteristics2 success', JSON.stringify(res)) //console.log('getBLEDeviceCharacteristics1 success', res.characteristics) for (let i = 0; i < res.characteristics.length; i++) { let item = res.characteristics[i] if (item.properties.read) { wx.readBLECharacteristicValue({ deviceId, serviceId, characteristicId: item.uuid, }) } if (item.properties.write && item.uuid.indexOf("0000FFF2") != -1) { this.setData({ canWrite: true, ble_status:1, }) this._deviceId = deviceId this._serviceId = serviceId this._characteristicId = item.uuid this.writeBLECharacteristicValue() } if (item.properties.notify || item.properties.indicate) { wx.notifyBLECharacteristicValueChange({ deviceId, serviceId, characteristicId: item.uuid, state: true, }) } } }, fail(res) { console.error('getBLEDeviceCharacteristics', res) } }) // 操作之前先监听,保证第一时间获取数据 wx.onBLECharacteristicValueChange((characteristic) => { const idx = inArray(this.data.chs, 'uuid', characteristic.characteristicId) const data = {} if (idx === -1) { data[`chs[${this.data.chs.length}]`] = { uuid: characteristic.characteristicId, value: ab2hex(characteristic.value) } } else { data[`chs[${idx}]`] = { uuid: characteristic.characteristicId, value: ab2hex(characteristic.value) } } // data[`chs[${this.data.chs.length}]`] = { // uuid: characteristic.characteristicId, // value: ab2hex(characteristic.value) // } this.setData(data) }) }, writeBLECharacteristicValue() { // 向蓝牙设备发送一个0x00的16进制数据 console.log('开始写入数据') let buffer = new ArrayBuffer(20) let dataView = new DataView(buffer) // dataView.setUint8(0, Math.random() * 255 | 0) for (let i = 0; i < 20; i++) { dataView[i] = i } wx.writeBLECharacteristicValue({ deviceId: this._deviceId, serviceId: this._serviceId, characteristicId: this._characteristicId, value: buffer, success: (res) => { console.log('writeBLECharacteristicValue success', JSON.stringify(res)) this.writeBLECharacteristicValue() }, fail: (res) => { console.log('writeBLECharacteristicValue fail', JSON.stringify(res)) //writeBLECharacteristicValue() } }) }, closeBluetoothAdapter() { wx.closeBluetoothAdapter() this._discoveryStarted = false this.setData({ ble_status: 0, }) },
2019-07-16感谢反馈,我们会在接下来的版本支持 getLocation接口高精度定位的能力; 持续定位的接口(精度会随着定位时间,越来越高。 留意官网更新。
wx.getLocation 安卓定位精度低 IOS正常 有在解决吗安卓手下定位精度一直很低,测试过多部手机,精度基本在30左右,而且经常不更新,手机内置的导航软件很正常。 在IOS下精度一直在10米以内。社区里已经多名开发者提出此问题,请官方抽出时间跟进一下。 https://developers.weixin.qq.com/community/develop/doc/000e06585741307c608850a8a5b800?highLine=%25E5%25AE%2589%25E5%258D%2593%2520wx.getLocation%2520%25E7%25B2%25BE%25E5%25BA%25A6 var _this = this; //设置计时器,不停获取位置信息以测速 gps: setInterval(function () { wx.getLocation({ type: 'wgs84', success(res) { if (res.speed == -1) { _this.setData({ accuracy: res.accuracy, speed: 0 }) } else { _this.setData({ accuracy: res.accuracy, speed: res.speed * 3.6 }) } }, }) }, 1000) //1秒刷新一次
2019-07-08这个错误码表示当前手机连不上网的意思,官网文档应该能找到。 在路由器侧看看有没有请求过来?有的话为啥请求不通?
微信连WiFi,部分安卓机一直出现 31305101苹果机和小米手机都没有问题,只有两个华为手机,一直出现 31305101的问题,证书也是正式签发的证书,不知道为什么有的安卓机,一直出现这种情况,有人遇到过吗?说说解决思路,谢谢! 官方的人,在吗?你们能不能看看啊,兼容性怎么这么差啊!!!!!! [图片]
2019-07-08查了下,该接口调用的系统接口,返回不正确,应该是系统的bug。 ContextCompat.checkSelfPermission(context, otherPermisson) ps: https://github.com/yanzhenjie/AndPermission/issues/31 查了下,参考这个,我们看看能不能cover住一部分case,但其他还有问题的只能推动厂商解决了,目前看是没救的。
小程序中获取系统信息在部分机型上不正确https://developers.weixin.qq.com/miniprogram/dev/api/base/system/system-info/wx.getSystemInfo.html#%E5%8F%82%E6%95%B0 需要描述:我们希望获取用户是否打开了微信的位置权限,所以使用了 wx.getSystemInfo(Object object)接口的locationAuthorized参数。获取的结果在iPhone,华为,三星等机型上是准确的,打开该开关之后也能够及时获取到。 但是经过测试,该参数在小米5,小米6,小米Note以及Vivo的部分机型上不准确。如果一开始获得的参数值是true或false,那么不管用户是否开启该权限,之后获取的值都是不变的。即使是重启小程序或者重启手机,也无法在这些机型上获取正确的值。 希望小程序能够早日解决该问题。
2019-07-05