Skip to content

Commit

Permalink
fix(core): requestPermissions not resolving on Android (#10988)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
lucasfernog authored Sep 13, 2024
1 parent 63649d8 commit 00182eb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changes/fix-request-permissions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"tauri": patch:bug
---

Fix `requestPermissions` not resolving on Android.
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand Down

0 comments on commit 00182eb

Please sign in to comment.