Skip to content

Commit

Permalink
fix(plugin): fix android_package_id to follow cli (#10763)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
rdlabo and lucasfernog authored Aug 26, 2024
1 parent 21c2488 commit fb6bf31
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
6 changes: 6 additions & 0 deletions .changes/update-android-plugin-template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'tauri-cli': 'patch:changes'
'@tauri-apps/cli': 'patch:changes'
---

Update plugin template Android code to match documentation on Android package ID usage.
5 changes: 1 addition & 4 deletions tooling/cli/templates/plugin/src/mobile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ use tauri::{

use crate::models::*;

#[cfg(target_os = "android")]
const PLUGIN_IDENTIFIER: &str = "{{ android_package_id }}";

#[cfg(target_os = "ios")]
tauri::ios_plugin_binding!(init_plugin_{{ plugin_name_snake_case }});

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

0 comments on commit fb6bf31

Please sign in to comment.