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 Android pairing with Bluetooth without PIN #259

Closed
santoshshinde2012 opened this issue Aug 30, 2016 · 7 comments
Closed

Ionic Android pairing with Bluetooth without PIN #259

santoshshinde2012 opened this issue Aug 30, 2016 · 7 comments

Comments

@santoshshinde2012
Copy link

I am working with bluetooth module. I have a Ionic app that uses the Bluetooth Serial plugin and I can connect to the bluetooth module successfully, however I want to be able to remove the pop up that appears asking the user to enter the PIN to pair my Android to the Bluetooth module.

So its feasible to bluetooth pairing without appears asking the user to enter the PIN .

If yes then told me the way.

Thank you.

@don
Copy link
Owner

don commented Sep 17, 2016

You might be able to use the Android Bluetooth settings to pair the device before running the app.

If that doesn't work there's an Android API to set the PIN BluetoothDevice.setPin you might be able to modify the plugin to accept this programatically.

@don
Copy link
Owner

don commented Sep 17, 2016

It looks like there's pairing with a PIN in pull request #114

That request uses non-public APIs so I haven't merged it.

@mumairofficial
Copy link

mumairofficial commented Jan 23, 2017

@don It will be great help from you if you provide merged code #114 gist or separate branch. I am looking forward for great news from your side. I am non technical in android development.

@don
Copy link
Owner

don commented Feb 2, 2017

@mumairofficial I didn't merge that plugin because it uses reflection. Unfortunately since it's old, there are now conflicts.

If you want this functionality you can use the branch for the pull request from the authors github https://github.com/stakutis/BluetoothSerial/tree/stakutis

Backup your project
Remove the official version of the plugin

 cordova plugin rm cordova-plugin-bluetoothserial

Try the alternate version with the feature you want

 cordova plugin add https://github.com/stakutis/BluetoothSerial/tree/stakutis

@mumairofficial
Copy link

@don thank you so much. I will try and let you know asap.

@don don closed this as completed Mar 17, 2017
@hirenvolansys
Copy link

@don I want to bond and unbond BLE device. How it is possible in Ionic? I also require PIN popup while connecting, which not come when connect with BLE device.

Please help me. Thanks in advance.

@don
Copy link
Owner

don commented Mar 24, 2017

@hirenvolansys it's best to create new issues rather than comment on closed issues.

iOS should bond automatically if you try and connect to a device that requires it or read/write a characteristic with enhanced permissions.

There is an old Android pull request for that provided bind and unbind but uses reflection so it won't be merged into master. See #112 and #114

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

4 participants