Skip to content

Commit

Permalink
feat(apis): 为支付宝、微信小程序增加蓝牙相关 API,fix #9016
Browse files Browse the repository at this point in the history
  • Loading branch information
Chen-jj committed Apr 3, 2021
1 parent 8c485f8 commit ba87f2d
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 4 deletions.
27 changes: 25 additions & 2 deletions packages/taro-alipay/src/apis-list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,15 @@ export const noPromiseApis = new Set([
'openVoucherList',
'setCanPullDown',
'setOptionMenu',
'showSharePanel'
'showSharePanel',
'onBLECharacteristicValueChange',
'onBLEConnectionStateChanged',
'onBluetoothDeviceFound',
'onBluetoothAdapterStateChange',
'offBLECharacteristicValueChange',
'offBLEConnectionStateChanged',
'offBluetoothDeviceFound',
'offBluetoothAdapterStateChange'
])

export const needPromiseApis = new Set([
Expand Down Expand Up @@ -54,5 +62,20 @@ export const needPromiseApis = new Set([
'showAuthGuide',
'textRiskIdentification',
'vibrate',
'watchShake'
'watchShake',
'connectBLEDevice',
'disconnectBLEDevice',
'makeBluetoothPair',
'writeBLECharacteristicValue',
'readBLECharacteristicValue',
'notifyBLECharacteristicValueChange',
'getBLEDeviceServices',
'getBLEDeviceCharacteristics',
'openBluetoothAdapter',
'closeBluetoothAdapter',
'getBluetoothAdapterState',
'startBluetoothDevicesDiscovery',
'stopBluetoothDevicesDiscovery',
'getBluetoothDevices',
'getConnectedBluetoothDevices'
])
26 changes: 24 additions & 2 deletions packages/taro-weapp/src/apis-list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,15 @@ export const noPromiseApis = new Set([
'reportPerformance',
'stopBackgroundAudio',
'stopRecord',
'stopVoice'
'stopVoice',
'onBluetoothDeviceFound',
'onBluetoothAdapterStateChange',
'offBluetoothDeviceFound',
'offBluetoothAdapterStateChange',
'onBLEConnectionStateChange',
'onBLECharacteristicValueChange',
'offBLEConnectionStateChange',
'offBLECharacteristicValueChange'
])

export const needPromiseApis = new Set([
Expand Down Expand Up @@ -124,5 +132,19 @@ export const needPromiseApis = new Set([
'updateVoIPChatMuteConfig',
'updateWeChatApp',
'sendBizRedPacket',
'getUserProfile'
'getUserProfile',
'stopBluetoothDevicesDiscovery',
'startBluetoothDevicesDiscovery',
'openBluetoothAdapter',
'getConnectedBluetoothDevices',
'getBluetoothDevices',
'getBluetoothAdapterState',
'closeBluetoothAdapter',
'writeBLECharacteristicValue',
'readBLECharacteristicValue',
'notifyBLECharacteristicValueChange',
'getBLEDeviceServices',
'getBLEDeviceCharacteristics',
'createBLEConnection',
'closeBLEConnection'
])

0 comments on commit ba87f2d

Please sign in to comment.