Skip to content

Commit 05dad08

Browse files
authored
feat: initial work for iOS plugins (#6205)
1 parent f379e2f commit 05dad08

File tree

51 files changed

+1072
-69
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+1072
-69
lines changed

.changes/android-apis-runtime.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"tauri-runtime": minor
3+
"tauri-runtime-wry": minor
4+
---
5+
6+
Add `find_class`, `run_on_android_context` on `RuntimeHandle`.

.changes/cli-mobile-plugin.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"cli.rs": minor
3+
"cli.js": minor
4+
---
5+
6+
Add commands to add native Android and iOS functionality to plugins.

.changes/invoke-return-bool.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
"tauri-macros": major
3+
"tauri-codegen": major
4+
"tauri": major
5+
---
6+
7+
Return `bool` in the invoke handler.

.changes/mobile-plugins.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"tauri": minor
3+
---
4+
5+
Run Android and iOS native plugins on the invoke handler if a Rust plugin command is not found.

.changes/plugin-init-fns.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"tauri": minor
3+
---
4+
5+
Added `initialize_android_plugin` and `initialize_ios_plugin` APIs on `AppHandle`.

.changes/tauri-build-mobile.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"tauri-build": minor
3+
---
4+
5+
Add `mobile::PluginBuilder` for running build tasks related to Tauri plugins.

.changes/with-webview.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
"tauri": minor
3+
"tauri-runtime": minor
4+
"tauri-runtime-wry": minor
5+
---
6+
7+
Implemented `with_webview` on Android and iOS.

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,3 +87,7 @@ test_video.mp4
8787
# old cli directories
8888
/tooling/cli.js
8989
/tooling/cli.rs
90+
91+
# Swift
92+
Package.resolved
93+
.build

Package.swift

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// swift-tools-version:5.7
2+
// The swift-tools-version declares the minimum version of Swift required to build this package.
3+
4+
import PackageDescription
5+
6+
let package = Package(
7+
name: "TauriWorkspace",
8+
products: [
9+
.library(name: "Tauri", targets: ["Tauri"]),
10+
],
11+
dependencies: [
12+
.package(url: "https://github.com/Brendonovich/swift-rs", revision: "eb6de914ad57501da5019154d476d45660559999"),
13+
],
14+
targets: [
15+
.target(
16+
name: "Tauri",
17+
dependencies: [
18+
.product(name: "SwiftRs", package: "swift-rs"),
19+
],
20+
path: "core/tauri/ios/Sources/Tauri"
21+
),
22+
.testTarget(
23+
name: "TauriTests",
24+
dependencies: ["Tauri"],
25+
path: "core/tauri/ios/Tests/TauriTests"
26+
),
27+
]
28+
)

core/tauri-build/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ heck = "0.4"
2727
json-patch = "0.2"
2828
walkdir = "2"
2929

30+
[target."cfg(target_os = \"macos\")".dependencies]
31+
swift-rs = { git = "https://github.com/Brendonovich/swift-rs", rev = "eb6de914ad57501da5019154d476d45660559999", features = ["build"] }
32+
3033
[target."cfg(windows)".dependencies]
3134
winres = "0.1"
3235
semver = "1"

0 commit comments

Comments
 (0)