mirror of
https://github.com/tauri-apps/tauri.git
synced 2026-04-01 10:01:07 +02:00
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>
This commit is contained in:
committed by
GitHub
parent
21c2488d2e
commit
fb6bf31425
6
.changes/update-android-plugin-template.md
Normal file
6
.changes/update-android-plugin-template.md
Normal file
@@ -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.
|
||||
@@ -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 }});
|
||||
|
||||
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user