diff --git a/android/src/main/java/BluclasPlugin.kt b/android/src/main/java/BluclasPlugin.kt index ebb2047..f9d46d0 100644 --- a/android/src/main/java/BluclasPlugin.kt +++ b/android/src/main/java/BluclasPlugin.kt @@ -45,19 +45,12 @@ class BluclasPlugin(private val activity: Activity) : Plugin(activity) { @Command override fun checkPermissions(invoke: Invoke) { - val result = JSObject() - result.put("bluetooth", getPermissionState("bluetooth").toString()) - invoke.resolve(result) + super.checkPermissions(invoke) } @Command override fun requestPermissions(invoke: Invoke) { - requestPermissionForAlias("bluetooth", invoke, "permissionsCallback") - } - - @PermissionCallback - private fun permissionsCallback(invoke: Invoke) { - checkPermissions(invoke) + super.requestPermissions(invoke) } @Command diff --git a/build.rs b/build.rs index 52293eb..a486007 100644 --- a/build.rs +++ b/build.rs @@ -1,4 +1,9 @@ -const COMMANDS: &[&str] = &["daftar_perangkat", "kirim"]; +const COMMANDS: &[&str] = &[ + "check_permissions", + "request_permissions", + "daftar_perangkat", + "kirim", +]; fn main() { tauri_plugin::Builder::new(COMMANDS) diff --git a/package.json b/package.json index 827fbc7..3a9cc51 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@segubi/tauri-plugin-bluclas-api", - "version": "0.1.4", + "version": "0.1.5", "author": "Rizky Denianto", "description": "", "type": "module", diff --git a/permissions/autogenerated/commands/check_permissions.toml b/permissions/autogenerated/commands/check_permissions.toml new file mode 100644 index 0000000..f5af08b --- /dev/null +++ b/permissions/autogenerated/commands/check_permissions.toml @@ -0,0 +1,13 @@ +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../schemas/schema.json" + +[[permission]] +identifier = "allow-check-permissions" +description = "Enables the check_permissions command without any pre-configured scope." +commands.allow = ["check_permissions"] + +[[permission]] +identifier = "deny-check-permissions" +description = "Denies the check_permissions command without any pre-configured scope." +commands.deny = ["check_permissions"] diff --git a/permissions/autogenerated/commands/request_permissions.toml b/permissions/autogenerated/commands/request_permissions.toml new file mode 100644 index 0000000..02dcd62 --- /dev/null +++ b/permissions/autogenerated/commands/request_permissions.toml @@ -0,0 +1,13 @@ +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../schemas/schema.json" + +[[permission]] +identifier = "allow-request-permissions" +description = "Enables the request_permissions command without any pre-configured scope." +commands.allow = ["request_permissions"] + +[[permission]] +identifier = "deny-request-permissions" +description = "Denies the request_permissions command without any pre-configured scope." +commands.deny = ["request_permissions"] diff --git a/permissions/autogenerated/reference.md b/permissions/autogenerated/reference.md index e1ced02..0d7056b 100644 --- a/permissions/autogenerated/reference.md +++ b/permissions/autogenerated/reference.md @@ -4,6 +4,8 @@ Default permissions for the plugin #### This default permission set includes the following: +- `allow-check-permissions` +- `allow-request-permissions` - `allow-daftar-perangkat` - `allow-kirim` @@ -16,6 +18,32 @@ Default permissions for the plugin +