fix(core): requestPermissions not resolving on Android (#10988)

the checkPermissions command is also a PermissionCallback, and the annotation check is incorrectly ignoring that fact, so the requestPermissions is never resolved for the geolocation plugin
This commit is contained in:
Lucas Fernandes Nogueira 2024-09-13 09:08:31 -03:00 committed by GitHub
parent 63649d82d2
commit 00182ebf89
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 11 additions and 2 deletions

View File

@ -0,0 +1,5 @@
---
"tauri": patch:bug
---
Fix `requestPermissions` not resolving on Android.

View File

@ -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
}
}