加上mode:'peripheral' OK了
wx.createBLEPeripheralServer ios设备调用无反应在ios设备下,调用wx.createBLEPeripheralServer,没有任何反应,三个回调都不执行,但相同小程序android可以使用。ios设备为iphone8,代码如下 wx.openBluetoothAdapter({ success: (res) => { console.log('open adpater') wx.createBLEPeripheralServer({ success: (result) => { console.log('create success') let server = result.server let name = 'xxxxxx' server.startAdvertising({ advertiseRequest: { connected : true, deviceName : name, } }).then( (res) => { console.log('advertising',res) }, (res) => { console.warn('ad fail',res) } ) }, fail: (res) => { console.log('creat fail') }, complete: (res) => { console.log('complete') } }) }, fail: (res) => { console.log('open failed') console.warn(res) }, complete: (res) => { console.log('open complete') } })
2021-11-15