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

New Android Bluetooth permissions preventing print and port discovery #60

Open
davidclean opened this issue Aug 21, 2023 · 6 comments
Open

Comments

@davidclean
Copy link

When trying to print to Bluetooth using Android 12 or above am receiving an error message that BLUETOOTH_CONNECT permission is required.

Running the following function will result in app crash

starprnt.portDiscovery('All', function (result) {

@davidclean davidclean changed the title New Android Bluetooth permissions New Android Bluetooth permissions preventing print and port discovery Aug 21, 2023
@davidclean
Copy link
Author

davidclean commented Aug 21, 2023

@igorsantos07
Copy link

igorsantos07 commented Oct 14, 2023

The crash is probably the same we faced at #48 and fixed at #59 - however, with a new perm request. Upgrading to Android 12 left us in a strange endless loop of search (our fork got a bit outdated, missing a new argument), and fixing that causes an instant error now.

Sadly, as you can see, this plugin is abandoned. But you're welcome to try our fork, I'm trying to solve the issue.

@igorsantos07
Copy link

igorsantos07 commented Oct 29, 2023

@davidclean were you able to get to a solution, by any chance?

Edit: turns out the USB permission issue seems to be mysteriously gone, but right now I'm unable to test bluetooth printers (got none working with me, but a colleague have and will report on this in the near future).
What I can say is: bluetooth permissions are not needed to search for printers, at least.

image

@davidclean
Copy link
Author

@igorsantos07 I haven't been able to find a solution yet unfortunately

@davidclean
Copy link
Author

@igorsantos07 workaround solution i'm trying is to use this plugin https://www.npmjs.com/package/cordova-plugin-android-permissions before attempting to print or search for printers

@igorsantos07
Copy link

While our fork solved crashes and hangs, in some scenarios permissions were not requested - or we were not able to re-request when possible. I went with a slightly different path of yours - I used https://github.com/dpa99c/cordova-diagnostic-plugin, which has some extra functionalities that could be useful, besides being more detailed on the permission status. It became quite a convoluted function to work out all the scenarios, but it worked well in the end 🤷

Thanks for the pointers!

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