当我在Andriod设备上运行应用程序后为BLE扫描创建一些代码后,在ionic项目中添加了BLE插件时,它给了我vendor.js的“未捕获的TypeError:Object(...)不是函数”
import { BLE } from '@ionic-native/ble';
ionViewDidEnter() {
console.log('ionViewDidEnter');
this.scan();
}
scan()
{
this.setStatus('Scanning for Bluetooth LE Devices');
this.devices = []; // clear list
this.ble.scan([], 5).subscribe(
device => this.onDeviceDiscovered(device),
error => this.scanError(error)
);
setTimeout(this.setStatus.bind(this), 5000, 'Scan complete');
}