feat: android version correctly working alongside iOS version
This commit is contained in:
8
frontend/src-tauri/capabilities/android.toml
Normal file
8
frontend/src-tauri/capabilities/android.toml
Normal file
@@ -0,0 +1,8 @@
|
||||
identifier = "android"
|
||||
description = "Capabilities for Android platforms"
|
||||
windows = ["main"]
|
||||
platforms = ["android"]
|
||||
|
||||
permissions = [
|
||||
"sharetarget:default"
|
||||
]
|
||||
@@ -8,7 +8,6 @@ permissions = [
|
||||
"fs:default",
|
||||
"http:default",
|
||||
"os:default",
|
||||
"sharetarget:default",
|
||||
{ identifier = "http:default", allow = [
|
||||
{ url = "https://haystack.johncosta.tech" },
|
||||
{ url = "http://localhost:3040" },
|
||||
|
||||
@@ -49,21 +49,33 @@ pub fn desktop() {
|
||||
}
|
||||
|
||||
#[cfg_attr(mobile, tauri::mobile_entry_point)]
|
||||
#[cfg(any(target_os = "ios", target_os = "android"))]
|
||||
pub fn android() {
|
||||
let common_builder = tauri::Builder::default()
|
||||
#[cfg(target_os = "ios")]
|
||||
pub fn mobile() {
|
||||
tauri::Builder::default()
|
||||
.plugin(tauri_plugin_os::init())
|
||||
.plugin(tauri_plugin_fs::init())
|
||||
.plugin(tauri_plugin_store::Builder::new().build())
|
||||
.plugin(tauri_plugin_http::init())
|
||||
.plugin(tauri_plugin_sharetarget::init());
|
||||
|
||||
#[cfg(any(target_os = "ios"))]
|
||||
common_builder.plugin(tauri_plugin_ios_shared_token::init());
|
||||
|
||||
common_builder
|
||||
.plugin(tauri_plugin_ios_shared_token::init())
|
||||
.setup(|app| {
|
||||
setup_window(app)?;
|
||||
|
||||
Ok(())
|
||||
})
|
||||
.run(tauri::generate_context!())
|
||||
.expect("error while running ios tauri application");
|
||||
}
|
||||
|
||||
#[cfg_attr(mobile, tauri::mobile_entry_point)]
|
||||
#[cfg(target_os = "android")]
|
||||
pub fn mobile() {
|
||||
tauri::Builder::default()
|
||||
.plugin(tauri_plugin_os::init())
|
||||
.plugin(tauri_plugin_fs::init())
|
||||
.plugin(tauri_plugin_store::Builder::new().build())
|
||||
.plugin(tauri_plugin_http::init())
|
||||
.plugin(tauri_plugin_sharetarget::init())
|
||||
.setup(|app| {
|
||||
log::info!("running things!");
|
||||
setup_window(app)?;
|
||||
|
||||
Ok(())
|
||||
|
||||
@@ -6,5 +6,5 @@ fn main() {
|
||||
haystack_lib::desktop();
|
||||
|
||||
#[cfg(any(target_os = "ios", target_os = "android"))]
|
||||
haystack_lib::android();
|
||||
haystack_lib::mobile();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user