-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Getting "Attempt to invoke virtual method 'boolean android.bluetooth.BluetoothGattServer.addService(android.bluetooth.BluetoothGattService)' on a null object reference" on Android #9
Comments
Hi Sir huserincadan. I too am trying to use cordova-plugin-ble-peripheral and was not able to create it on ionic. It would be of great help if you hit me up if you are able to create and start advertising :) |
Also, for some reason, the |
Hi laaaaanceeee, let blePeripheral = (window).blePeripheral; I could not try onBluetoothStateChange because I could not start advertising. Actullay, using mobile phone as ble peripheral is very important part of my project. I'll control my web app (nodejs) by mobile app. I hope Don will help ! |
For the meantime, you can use this : ) Happy coding! |
Hi guys, I am a newbie in Ionic, and I try to get working a BLE peripheral in Ionic 3. For some reason the cordova bluetoothle plugin returns as not found when I try to build, although it appears as installed correctly when I try to reinstall it. Nevertheless somehow I got the @ionic-native/bluetooth-le to build the code. I followed the steps of initialise, initializePeripheral, addService, startAdvertising and they return like everything as expected (ending up with AdvertisingStarted), but for some reason the device doesn't appear when I scan from another smartphone. Also I could not figure out how to assign the callback function which is called when the device gets connected to, or receives something from the other side / the client. I would highly appreciate if you could point me to an example code which implements the peripheral functionality in Ionic 3, as I have been struggling already a couple of days on this issue.. Thank you, |
same problem. Finally I found out that the phone hardware does not support the peripheral mode. |
Hi,
I'm trying the sample code and
blePeripheral.startAdvertising(SERVICE_UUID, 'UART')
line gives error on Android. On iOS everything is working without any error.
I've installed "Adafruit Bluefruit LE Connect" app. When I tap Peripheral Mode getting "Error starting advertising" error.
I've tried on both a tablet and a Samsung mobile phone and got same result.
Can you help me about the point I am missing?
Thanks,
The text was updated successfully, but these errors were encountered: