Skip to content

Commit 7642508

Browse files
committed
WIP changes for android
1 parent 737870e commit 7642508

3 files changed

Lines changed: 3 additions & 4 deletions

File tree

build.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const COMMANDS: &[&str] = &[
1212

1313
fn main() {
1414
tauri_plugin::Builder::new(COMMANDS)
15-
// .global_api_script_path("./api-iife.js")
15+
.global_api_script_path("dist-js/index.iife.js")
1616
.android_path("android")
1717
.ios_path("ios")
1818
.build();

examples/plain-javascript/src/main.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
const { invoke } = window.__TAURI__.core;
21
const tauri = window.__TAURI__
32

43
let inputField;
54
let outputEl;
65

76
async function greet_rust() {
87
// Learn more about Tauri commands at https://tauri.app/develop/calling-rust/
9-
outputEl.textContent = await invoke("greet_rust", { name: inputField.value });
8+
outputEl.textContent = await tauri.invoke("greet_rust", { name: inputField.value });
109
}
1110
async function greet_python() {
1211
outputEl.textContent = await tauri.python.call.greet_python(inputField.value);

src/mobile.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ pub fn init<R: Runtime, C: DeserializeOwned>(
2424
api: PluginApi<R, C>,
2525
) -> crate::Result<Python<R>> {
2626
#[cfg(target_os = "android")]
27-
let handle = api.register_android_plugin("", "ExamplePlugin")?;
27+
let handle = api.register_android_plugin("com.plugin.python.application", "ExamplePlugin")?;
2828
#[cfg(target_os = "ios")]
2929
let handle = api.register_ios_plugin(init_plugin_python)?;
3030
py_lib::init_python()?;

0 commit comments

Comments
 (0)