Bluetooth serial Signature error

Hi,

I’m working with the Bluetooth serial plugin, and I can’t use any functions, with the success and error callback function …
Each time I have the same error: Supplied parameters do not match with any signature of call target.

Even when I just try to use the documentation example:

bluetoothSerial.isConnected(
    function() {
        console.log("Bluetooth is connected");
    },
    function() {
        console.log("Bluetooth is *not* connected");
    }
);

Do you have any ideas about this problem ?

Thank you.

If you’re using ionic-native, that is the incorrect way to use the module.

Try this.

import { Platform } from 'ionic-angular';
import { BluetoothSerial } from 'ionic-native';


export class MyClass {
   constructor(platform: Platform) {
    platform.ready().then(() => {
      BluetoothSerial.isConnected()
        .then(() => {
          console.log('is connected');
        }, (err) => {
          console.log(' not connected')
        })
    });
  }
}