由于某些原因,initialize方法不起作用
constructor(
public navCtrl: NavController,
public platform: Platform,
private toastCtrl: ToastController
) {
platform.ready().then(
() => {
let initializeResult: object;
let params: object = {
"request": true,
"statusReceiver": false,
"restoreKey": "bluetoothleplugin"
}
console.log('Im ready3x');
cordova.plugins.bluetoothle.initialize(initializeResult, params).then(
(success) =>{
this.toastInitialize('Im ready3x');
},
(error) =>{
this.toastInitialize('Not ready3x');
}
);
//this.toastInitialize('Im ready3x');
let enableSuccess: object;
let enableError: object;
cordova.plugins.bluetoothle.enable(enableSuccess, enableError);
this.toastInitialize('enabled');
}
);
}
可能出了什么问题?该应用程序启动,但没有看到吐司。在以前可以使用插件(离子型本机ble)扫描的真实设备上进行了测试