Skip to content

Conversation

@lucasfernog
Copy link
Member

Leverages scenes on iOS and Activity embedding on Android.

All window APIs are now exposed on mobile too. Some of them are still ignored though (like setting a title).

iOS

  • Added RunEvent::SceneRequested (on iPad the user can request a new window to be open - e.g. by long pressing the app icon and selecting "New window")

Android

  • Added builder methods to determine the activity to be created. System determines what to do with the activity (new stack, next to another one.. based on the embedding rules)

needs tauri-apps/tao#1154 and tauri-apps/wry#1633

@lucasfernog lucasfernog requested a review from a team as a code owner November 17, 2025 11:50
@github-project-automation github-project-automation bot moved this to 📬Proposal in Roadmap Nov 17, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Nov 17, 2025

Package Changes Through 00dcedc

There are 6 changes which include tauri-macos-sign with patch, tauri with minor, tauri-runtime-wry with minor, tauri-runtime with minor, tauri-utils with minor, tauri-bundler with patch

Planned Package Versions

The following package releases are the planned based on the context of changes in this pull request.

package current next
tauri-utils 2.8.1 2.9.0
tauri-macos-sign 2.3.1 2.3.2
tauri-bundler 2.7.4 2.7.5
tauri-runtime 2.9.2 2.10.0
tauri-runtime-wry 2.9.2 2.10.0
tauri-codegen 2.5.2 2.5.3
tauri-macros 2.5.2 2.5.3
tauri-plugin 2.5.2 2.5.3
tauri-build 2.5.3 2.5.4
tauri 2.9.4 2.10.0
@tauri-apps/cli 2.9.5 2.9.6
tauri-cli 2.9.5 2.9.6

Add another change file through the GitHub UI by following this link.


Read about change files or the docs at github.com/jbolda/covector

@lucasfernog
Copy link
Member Author

Copy link
Contributor

@velocitysystems velocitysystems left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're very excited about this feature @lucasfernog. I've left comments on #1154 and #1633. Here are some additional general questions:

Platforms & Compatibility

  • How will this affect Tauri's minimum supported versions?(i.e. Requires iOS 13+ and Android 12L)
  • What is the fallback behavior for unsupported platforms?
  • Which features of the Window API are available vs not available on mobile?

Performance & Resource Management

  • How do we intend to handle app lifecycle events? e.g. sleep/resume
  • How can we optimize multi-window support so as not to affect battery life?


#[cfg(feature = "unstable")]
#[command(root = "crate")]
pub async fn create_webview<R: Runtime>(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While we may not wish to enforce this (since it is device-specific) there is a theoretical limit to the number of web-views which can be created based on the available memory.

If the app begins to use too much memory the OS may mark it for termination particularly if it doesn't respond to memory warnings and attempt to free memory.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

right, that's not something we're worried - otherwise we would need to implement such check for all platforms


#[cfg(feature = "unstable")]
#[command(root = "crate")]
pub async fn create_webview<R: Runtime>(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WebViews are full browser engines that continue consuming significant CPU, GPU, and battery resources (15-25% per hour) even when the app is backgrounded, unless explicitly paused through lifecycle event handlers (onPause/onResume on Android or scene lifecycle hooks on iOS).

This can reduce background drain to 1-3% per hour—a critical requirement for app store approval and acceptable user experience.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for Android the system pauses the activity automatically when it moves to the background.. I would expect iOS to do the same

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lucasfernog Unlike iOS I don't believe Android automatically pauses the WebView's internal threads or JS timers when the Activity's onPause(..) is called. The Android WebView has explicit methods onPause(..) and pauseTimer(..).

See this SO discussion for further discussion.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've implemented that but it didn't help much tauri-apps/wry@0904dc9 (#1633)
i think pauseTimer is something that each user should decide if they want to call or not - they can do so in their TauriActivity subclass.

}

#[cfg(desktop)]
mod desktop_commands {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apps can't currently detect if multi-window is available. Should we add an API like this? e.g.

Typescript

if (await app.supportsMultiWindow()) {
    // Create new window
} else {
    // Ignore
}

Rust

pub fn supports_multi_window() -> bool {
    #[cfg(target_os = "iOS")]
    {
        ios_version() >= 13.0
    }
    #[cfg(target_os = "android")]
    {
        android_api_level() >= 32 // Android 12L
    }
    #[cfg(desktop)]
    {
        true
    }
}

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good idea 7f02cf5

@lucasfernog
Copy link
Member Author

We're very excited about this feature @lucasfernog. I've left comments on #1154 and #1633. Here are some additional general questions:

Platforms & Compatibility

  • How will this affect Tauri's minimum supported versions?(i.e. Requires iOS 13+ and Android 12L)

The default minimum version for iOS is already 14+ but min Android is 7, but both are configurable. The supports_multiple_windows will be helpful for this.

  • What is the fallback behavior for unsupported platforms?

The activity gets replaced on Android (new activity in the stack).
The webview gets replaced on iOS.

  • Which features of the Window API are available vs not available on mobile?

That's something I wanted to do a second pass in the future, most of the APIs can be supported.

Performance & Resource Management

  • How do we intend to handle app lifecycle events? e.g. sleep/resume

That's something the system handles. We can add sleep/resume events per window in the future.

  • How can we optimize multi-window support so as not to affect battery life?

As far as I know there's nothing special we can/need to do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 📬Proposal

Development

Successfully merging this pull request may close these issues.

3 participants