`window.add_child(webview_builder)` support for mobile
Describe the bug
By viewing the source code, I'm found add_child only supports desktop, can it be compatible with mobile target?
If wry is used, multiple webviews can be implemented like the following:
#[cfg(any(target_os = "ios", target_os = "android"))]
let mut builder = wry::WebViewBuilder::new().with_url(curl);
if !proxy.is_empty() {
let parts: Vec<&str> = proxy.split(':').collect();
// Access the parts safely
let proxy_host = parts.get(0).unwrap_or(&"");
let proxy_port = parts.get(1).unwrap_or(&"");
let proxy_config = wry::ProxyConfig::Socks5(wry::ProxyEndpoint {
host: proxy_host.to_string(),
port: proxy_port.to_string()
});
builder = builder.with_proxy_config(proxy_config);
}
let webview = builder.build_as_child(&main_window).unwrap();
But I think has some fatal issues, like not being able to access the window__ TAURI__
And I don't know how to make them public through Wry ("withGlobalTauri"= true not effective)
Multiple webviews on mobile target are a common requirement.
Reproduction
No response
Expected behavior
- tauri window.add_child api compatible with mobile
- wry creator can access window__ TAURI__
- have a other rust sample for mobile create
multiple webviews1 ~ 3 Just satisfy any point ,the issue will be solved
Full tauri info output
[✔] Environment
- OS: Mac OS 14.5.0 arm64 (X64)
✔ Xcode Command Line Tools: installed
✔ rustc: 1.81.0 (eeb90cda1 2024-09-04)
✔ cargo: 1.81.0 (2dbb1af80 2024-08-20)
✔ rustup: 1.27.1 (54dd3d00f 2024-04-24)
✔ Rust toolchain: stable-aarch64-apple-darwin (default)
- node: 20.18.0
- pnpm: 8.10.5
- yarn: 1.22.17
- npm: 8.19.4
[-] Packages
- tauri 🦀: 2.0.6
- tauri-build 🦀: 2.0.2
- wry 🦀: 0.46.3
- tao 🦀: 0.30.5
- @tauri-apps/api : 2.0.3
- @tauri-apps/cli : 2.0.5
Stack trace
No response
Additional context
No response
When will it be supported, or is it already in the process of follow-up?
No ETA at all. As far as i know, nobody started to work on it yet (and for sure nobody is (still) actively working on it right now). The team is busy outside of tauri and the time they can spent on tauri is better invested elsewhere.
If you want this to be implemented any time soon you'll have to do it yourself (or find someone capable who can do it)
Hi team, has there been any movement on this? Displaying webpages independently inside of a mobile app is a pretty common use case and an iframe is currently the only solution at present on mobile, which is not appropriate.
no, my last comment is still accurate 3 months later and will probably be accurate for the rest of the year as well (like i said, unless someone wants to contribute. unlikely since this is probably quite complicated).
I need this feature too. If nobody's working on it right now, I'll try to come up with something by myself since it's a must-have feature for my app. I can't guarantee that I'll end up with a solution that could be merged though (I actually need it for a dioxus app). Or that I'll even come up with a solution at all (I'm not qualified for the task, I'm just a random dude a little too stubborn)
Hope someone is good at both Android and tauri, this feature is really fascinating!
currently wry expects the Android webview to be a singleton, so this requires a bit of work (though I think the actual layout would be a problem, since AFAIK it is a static thing on mobile).