Skip to content

Commit 00182eb

Browse files
authored
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
1 parent 63649d8 commit 00182eb

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"tauri": patch:bug
3+
---
4+
5+
Fix `requestPermissions` not resolving on Android.

crates/tauri/mobile/android/src/main/java/app/tauri/plugin/PluginHandle.kt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,13 @@ class PluginHandle(private val manager: PluginManager, val name: String, val ins
143143
val command = method.getAnnotation(Command::class.java) ?: continue
144144
val methodMeta = CommandData(method, command)
145145
commands[method.name] = methodMeta
146-
} else if (method.isAnnotationPresent(ActivityCallback::class.java)) {
146+
}
147+
148+
if (method.isAnnotationPresent(ActivityCallback::class.java)) {
147149
startActivityCallbackMethods[method.name] = method
148-
} else if (method.isAnnotationPresent(PermissionCallback::class.java)) {
150+
}
151+
152+
if (method.isAnnotationPresent(PermissionCallback::class.java)) {
149153
permissionCallbackMethods[method.name] = method
150154
}
151155
}

0 commit comments

Comments
 (0)