Skip to content

Commit

Permalink
Fix advertise permissions for android 12
Browse files Browse the repository at this point in the history
  • Loading branch information
jcconneqtech committed Apr 5, 2023
1 parent b4e35d5 commit 1c1d5ad
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 1c1d5ad

Please sign in to comment.