Coder Social home page Coder Social logo

Comments (5)

sdetweil avatar sdetweil commented on August 30, 2024

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.

matijse avatar matijse commented on August 30, 2024

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.

sdetweil avatar sdetweil commented on August 30, 2024

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.

sdetweil avatar sdetweil commented on August 30, 2024

@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.

sdetweil avatar sdetweil commented on August 30, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.