Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ionic 3 =>couldn't pair with lenovo vibe k5 because of an incoorect pin or passkey. #326

Closed
AsreshSharma opened this issue Aug 9, 2017 · 1 comment

Comments

@AsreshSharma
Copy link

bellow code
selectDevice(address)
{
let alert = this.alertCtrl.create({
title: 'Connect',
message: 'Do you want to connect with?',
buttons:
[
{
text: 'Cancel',
role: 'cancel',
handler: () => {
console.log('Cancel clicked');
}
},
{
text: 'Connect',
handler: () =>
{
//this.bluetoothSerial.connectInsecure(address).subscribe(this.success, this.fail);
console.log("Connected Conn " + address);
this.bluetoothSerial.connect(address).subscribe((data:Observable) => {

                  console.log("Connect " + JSON.stringify(data));

                  this.bluetoothSerial.available().then(data =>{

                    console.log("Available " + JSON.stringify(data));

                    this.bluetoothSerial.read().then(data =>{

                      console.log("Read " + JSON.stringify(data));
                      this.navCtrl.push(WelcomePage,data);

                    });
                  });
                }, fail => {
                  console.log("Connected Error : " + JSON.stringify(fail));
                });
          }
        }
  ]
});
alert.present();

}

@don
Copy link
Owner

don commented Aug 18, 2017

When I'm using Bluetooth Classic on Android I try and pair the device with the phone before running my app.

See #114 for some code that lets you programmatically enter a PIN. I haven't merged that pull request since it uses private apis.

@don don closed this as completed Aug 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants