Skip to content

Commit fb6bf31

Browse files
rdlabolucasfernog
andauthored
fix(plugin): fix android_package_id to follow cli (#10763)
* fix(plugin): fix android_package_id to follow cli * Update tooling/cli/templates/plugin/src/mobile.rs * add change file --------- Co-authored-by: Lucas Fernandes Nogueira <lucas@tauri.app>
1 parent 21c2488 commit fb6bf31

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'tauri-cli': 'patch:changes'
3+
'@tauri-apps/cli': 'patch:changes'
4+
---
5+
6+
Update plugin template Android code to match documentation on Android package ID usage.

tooling/cli/templates/plugin/src/mobile.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ use tauri::{
99

1010
use crate::models::*;
1111

12-
#[cfg(target_os = "android")]
13-
const PLUGIN_IDENTIFIER: &str = "{{ android_package_id }}";
14-
1512
#[cfg(target_os = "ios")]
1613
tauri::ios_plugin_binding!(init_plugin_{{ plugin_name_snake_case }});
1714

@@ -21,7 +18,7 @@ pub fn init<R: Runtime, C: DeserializeOwned>(
2118
api: PluginApi<R, C>,
2219
) -> crate::Result<{{ plugin_name_pascal_case }}<R>> {
2320
#[cfg(target_os = "android")]
24-
let handle = api.register_android_plugin(PLUGIN_IDENTIFIER, "ExamplePlugin")?;
21+
let handle = api.register_android_plugin("{{ android_package_id }}", "ExamplePlugin")?;
2522
#[cfg(target_os = "ios")]
2623
let handle = api.register_ios_plugin(init_plugin_{{ plugin_name_snake_case }})?;
2724
Ok({{ plugin_name_pascal_case }}(handle))

0 commit comments

Comments
 (0)