Skip to content

Commit

Permalink
Merge pull request #753 from jcconneqtech/master
Browse files Browse the repository at this point in the history
Fix advertise permissions for android 12
  • Loading branch information
randdusing authored Apr 7, 2023
2 parents b4e35d5 + 1c1d5ad commit 169be8c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
<uses-permission android:name="android.permission.BLUETOOTH_SCAN"/>
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT"/>
<uses-permission android:name="android.permission.BLUETOOTH_ADVERTISE"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
</config-file>
Expand Down
4 changes: 2 additions & 2 deletions src/android/BluetoothLePlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -976,8 +976,8 @@ public void requestPermissionBtConnectAction(CallbackContext callbackContext) {
public void hasPermissionBtAdvertiseAction(CallbackContext callbackContext) {
JSONObject returnObj = new JSONObject();

addProperty(returnObj, "hasPermission", cordova.hasPermission(Manifest.permission.BLUETOOTH_ADVERTISE));

addProperty(returnObj, "hasPermission", Build.VERSION.SDK_INT < Build.VERSION_CODES.S || cordova.hasPermission(Manifest.permission.BLUETOOTH_ADVERTISE));
callbackContext.success(returnObj);
}

Expand Down

0 comments on commit 169be8c

Please sign in to comment.