diff --git a/.changes/fix-request-permissions.md b/.changes/fix-request-permissions.md new file mode 100644 index 000000000000..b00774f379f3 --- /dev/null +++ b/.changes/fix-request-permissions.md @@ -0,0 +1,5 @@ +--- +"tauri": patch:bug +--- + +Fix `requestPermissions` not resolving on Android. diff --git a/crates/tauri/mobile/android/src/main/java/app/tauri/plugin/PluginHandle.kt b/crates/tauri/mobile/android/src/main/java/app/tauri/plugin/PluginHandle.kt index 5e10f17bd653..ff946bbc75cf 100644 --- a/crates/tauri/mobile/android/src/main/java/app/tauri/plugin/PluginHandle.kt +++ b/crates/tauri/mobile/android/src/main/java/app/tauri/plugin/PluginHandle.kt @@ -143,9 +143,13 @@ class PluginHandle(private val manager: PluginManager, val name: String, val ins val command = method.getAnnotation(Command::class.java) ?: continue val methodMeta = CommandData(method, command) commands[method.name] = methodMeta - } else if (method.isAnnotationPresent(ActivityCallback::class.java)) { + } + + if (method.isAnnotationPresent(ActivityCallback::class.java)) { startActivityCallbackMethods[method.name] = method - } else if (method.isAnnotationPresent(PermissionCallback::class.java)) { + } + + if (method.isAnnotationPresent(PermissionCallback::class.java)) { permissionCallbackMethods[method.name] = method } }