-
Notifications
You must be signed in to change notification settings - Fork 669
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
Bluetooth Serial Permissions Issue on Android 12 #454
Comments
same with me.. any solution? |
No response yet |
oh my god.. i need this solution soon |
same here brother been almost a month of researching as l can only connect phone to ble devices but l want phone to phone |
Hi! We have managed to have this plugin working on Android 12, etc... The solution is yet not well tested but you might find it usefull. Remember to add these permissions on your app's AndroidManifest.xml <!--BLUETOOTH PERMISSION-->
<uses-permission android:name="android.permission.BLUETOOTH" tools:replace="android:maxSdkVersion" android:maxSdkVersion="30" />
<!-- Needed only if your app looks for Bluetooth devices. If your app doesn't use Bluetooth scan results to derive physical location information, you can strongly assert that your app doesn't derive physical location. -->
<uses-permission android:name="android.permission.BLUETOOTH_SCAN"
android:usesPermissionFlags="neverForLocation"
tools:targetApi="s" />
<!-- Needed only if your app communicates with already-paired Bluetooth devices. -->
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
<!-- Needed only if your app uses Bluetooth scan results to derive physical location. -->
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
cordova-plugin-bluetooth-serial+0.4.7.patch.zip (The patch is generated and can be applied using patch-package. |
I change the AndroidManifest.xml with this suggestions, but tags tools:replace="android:maxSdkVersion" and tools:targetApi="s", doesnt find in my project, after removing this tags my project starting in debug mode, but when you start bluetooth the error appears |
I create a fork this repo and do changes necessary for working in my project |
awesome this is working!!!.. i have searched all cordova bluetooth library and tried it..but no luck.. thank you very much @brandomcombr |
Coincidentally i was doing a very similar thing of @brandomcombr, in my fork https://github.com/giuseppelanzi/BluetoothSerial. I'm posting this message only because I added something. Hope it helps if someone is struggling for a similar reason. |
i have found new problem again.. if use device with Android 12 => working properly but if used device Android 11 getting error "error search location permission is required to discover unpaired device" I also tried https://github.com/giuseppelanzi/BluetoothSerial .. but still have same error.. problem is using Android 11, can you help me guys? |
@lapisanlangit, please try brandomcombr#1 |
yeah, this is working on my android 11. thanks |
How did you implement this on your project? I am still facing the challenge. I even replaced the package with (brandomcombr#1) still doesn't work |
I am using cordova. I just change the git url in package.json |
what package.json looks like, and how to import and use it. example code pls. |
Some one please share package.json for change project url to brandomcombr#1 so that i canuse in adroid 13 EDIT:package.json current
|
during installation use: |
Thank you very much @emilkitua .. since long time I am manually coping |
I need assistance with the Bluetooth Serial plugin, when l check for bluetooth.isEnable it returns Ok or is Disabled which is correct. If l try to use any other functions for example List or discoverUnpaired l get the error below
ERROR
"Need android.permission.BLUETOOTH_SCAN permission for AttributionSource { uid = 10467, packageName = com.fire.service.app, attributionTag = null, token = android.os.BinderProxy@a208f16, next = null }: Starting discovery."
Your assistance will be much appreciated.
Below is my environment
Ionic:
Ionic CLI : 6.20.1
Ionic Framework : @ionic/angular 6.2.2
@angular-devkit/build-angular : 13.0.4
@angular-devkit/schematics : 13.0.4
@angular/cli : 13.0.4
@ionic/angular-toolkit : 5.0.3
Cordova:
Cordova CLI : 11.0.0
Cordova Platforms : android 10.1.2
Cordova Plugins : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 5.0.0, (and 14 other plugins)
Utility:
cordova-res : 0.15.4
native-run (update available: 1.7.1) : 1.5.0
System:
NodeJS : v14.15.4 (C:\Program Files\nodejs\node.exe)
npm : 6.14.10
OS : Windows 10
The text was updated successfully, but these errors were encountered: