Hi everyone, I’m having an issue when I try to connect in a Bluetooth device using Android Phone. I’ve tested an app from Google Play and it works, but when I call connect method from BluetoothSerial native library it doesn’t works. Could anyone help me please?
import { Component } from '@angular/core';
import { NavController } from 'ionic-angular';
import { BluetoothSerial } from 'ionic-native';
@Component({
selector: 'page-home',
templateUrl: 'home.html'
})
export class HomePage {
constructor(public navCtrl: NavController) {
}
connect() {
BluetoothSerial.isEnabled().then(res => {
BluetoothSerial.connect('20:14:02:18:17:84');
BluetoothSerial.isConnected().then(res => {
console.log(res);
}).catch(res => {
console.log('Fail2!');
console.log(res);
});
}).catch(res => {
console.log('Fail!');
});
}
}
Problem Solved: I need to list the devices before I connect