Ionic_native_ble


#1

I can’t understand why this code doesn’t execute
this.ble.startScan([]).subscribe(devices => {
if (JSON.stringify(devices.name) == ‘my_ble’)
console.log(‘device id:’+ JSON.stringify(devices.id));
can s/o help me please?


#2

Which code exactly? From what I see it could either not fire the subscribe or not find a device called my_ble.


#3

the if block doesn’t work ,when i execute it without "if (JSON.stringify(devices.name) == ‘my_ble’) " it runs also i tried with .filter() but the same issue.


#4

Add a console.log(devices.name, devices) before the if to see what is actually in there.