don / ionic-ble-examples

Ionic Framework Bluetooth Low Energy Examples
102 stars 70 forks source link

Ionic 3 Native BLE doesn't return anything #6

Closed ZehCoque closed 6 years ago

ZehCoque commented 6 years ago

Hello,

I tried to use your examples but the BLE functions don't return nothing, not even errors. I am using an Android 7.0 device to test. I didn't forget to turn on location on the device.

This code:

let result = this.ble.enable(); console.log(result)

Returns this:

t = {__zone_symbol__state: null, __zone_symbol__value: Array(0)}; __zone_symbol__state: null; __zone_symbol__value: []; __proto__: Object

I have tested my BLE module using Evothings in the same device and it worked very well. You can find my main project here and the specific codes related to BLE can be found here. As you can see it is exactly like your example.

I don't know what I am doing wrong and I have tried a lot of things. Thank you for your attention.

ZehCoque commented 6 years ago

I found the solution. The BLE doesnt seem to work if you are testing your app in the debug version. You must release your app, like this, and then the BLE starts working. Thank you for the examples, don.

don commented 6 years ago

@ZehCoque glad you got it working. Thanks for the update.