Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feat] iOS Widget support #9766

Open
Tehnix opened this issue May 13, 2024 · 0 comments
Open

[feat] iOS Widget support #9766

Tehnix opened this issue May 13, 2024 · 0 comments

Comments

@Tehnix
Copy link

Tehnix commented May 13, 2024

Describe the problem

With Tauri 2.0 hitting beta and bringing Mobile support, one key part of the Mobile (and Desktop) ecosystem is still missing: Widgets.

Right now I'm unaware of any way to write Widgets in Tauri, or even combine an Tauri-based App with e.g. a Swift-based Widget.

E.g. something like this:

GLdyllaW0AA7gpC

Describe the solution you'd like

I would love to see way for Tauri to support Widgets on Mobile and Desktop. My primary focus is personally on iOS and macOS Widgets, but Android Widgets should also be considered, although I would think these are different enough that it might make sense to treat them as completely separate.

While we cannot use Webviews in Widgets, I could imagine a way similar to https://scriptable.app where Tauri exposes an API and a Widget runtime.

  • The Widget API: Configuration of Layout for the View and data loading that should get run in getSnapshot/getTimeline of the Widget (iOS and macOS is the same)
  • The Widget Runtime: Native Swift/Kotlin code that sets up the plumbing and executes what the user has set up in getSnapshot/getTimeline and the view etc

I'm not entirely sure how Scriptable does it, but it seems to expose a minimal set of the Widget API via JavaScript, which lets you do most things. It hasn't been updated to support interactivity yet though (arrived in iOS 17).

Alternatives considered

A different approach one could imagine would be a way to link your Widget code from an existing Xcode project together with the Tauri generated Xcode project.

Additional context

No response

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

No branches or pull requests

2 participants