Nativescript + Bluetooth



Hello ,
I was thinking to develop an utility with bluetooth, where I have a use-case to
subscribe or wait till new Bluetooth connection is made and start from there … I explored
’nativescript-bluetooth’ library , but they dont have API to subscribe for notification until new bluetooth connection happens ( as far as I understood ). With ‘nativescript-bluetooth’ , we can scan and connect to a device but not wait in the background till phone connects to a device.

I feel only way is to call the native API ? Am I correct ?


Hey @sasi,

Off the top of my head I think that this is something you’re going to have to write using native code as it’s a pretty custom use case. We have some samples out there for how to write NativeScript apps that run in the background — see and — that you can probably use to help get you started.

One problem you might run into: by default iOS doesn’t allow general purpose applications to run in the background for more than about 3 minutes. You can set a flag in your Info.plist to override this though, and there are even certain modes intended for bluetooth interaction

One thing you might want to try is finding a native plugin that does what you’re looking for, and to wrap that library in a NativeScript plugin of your own:

Best of luck, and if anyone else on this forum with a bit of bluetooth experience sees this feel free to chime in :smile:



Thank you TJ :slight_smile: