Comments (5)
looks like the api has changed, and now need to use the api documented in the linked cordova plugin in some cases.. weird..
working code from the plugin doc
https://github.com/randdusing/cordova-plugin-bluetoothle#initialize-the-bluetooth-adapter
bluetoothle.initialize(initializeResult, params);
example given
new Promise(function (resolve) {
bluetoothle.initialize(resolve, { request: true, statusReceiver: false });
}).then(initializeSuccess, handleError);
the callbacks cannot be arrow functions.. boooo...
from cordova-plugin-bluetoothle.
I replaced @ionic-native/bluetooth-le
by @awesome-cordova-plugins/bluetooth-le
(install both @awesome-cordova-plugins/core
and @awesome-cordova-plugins/bluetooth-le
)
Then you can use everything the same, except changing the import to
import { BluetoothLE } from '@awesome-cordova-plugins/bluetooth-le'
See https://github.com/danielsogl/awesome-cordova-plugins
from cordova-plugin-bluetoothle.
I did the same in the end. but. initialize, and other functions are different. most don't return promises or observables anymore.
none of the functions support arrow functions ( ()=> {}
from cordova-plugin-bluetoothle.
@ionic-native/Bluetooth_le
which wraps this plugin, has an observable for subscribe.. this lib has a function w callbacks..native subscribe returns immediately, no error if you use this libs parms...
from cordova-plugin-bluetoothle.
just read the index.ts of BT native and use those function definitions.. not the ones described here
from cordova-plugin-bluetoothle.
Related Issues (20)
- Unable to read from Device HOT 2
- Connect 2 Android devices using BluetoothLE HOT 4
- Crash of the App when StartScan() is called with BLUETOOTH_SCAN permission HOT 2
- Support `android:usesPermissionFlags="neverForLocation"`
- writeQ and read
- hasPermissionBtScanAction and hasPermissionBtConnectAction should always return true on AndroidSDK < 31 HOT 2
- Android 13 Limit max MTU to 515
- subscribe(): Descriptor not found
- respond() to a status writeRequested not work HOT 1
- Bluetooth HOT 1
- switching on Bluetooth in an iOS device using an API is not possible
- Peripheral service UUID mangled HOT 1
- access to peripheral hashvalue HOT 1
- does not implement -[peripheral:didModifyServices:] HOT 3
- porting from IOS to Android and in trouble
- Error In Setpin method is not exist On BluetoothLe
- BluetoothLE writing a service and send the data to another device
- Bluetooth LE data transmission to broadcast device In parts HOT 1
- scanResponse not available when advertising as BLE device
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cordova-plugin-bluetoothle.