tauri-plugin-live-activity 0.12.0 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.ko.md +8 -9
- package/README.md +8 -9
- package/cli/xcodegen.mjs +1 -1
- package/dist-js/types.d.ts +6 -3
- package/package.json +1 -1
package/README.ko.md
CHANGED
|
@@ -39,7 +39,7 @@ Tauri 2 앱이 하고 있는 일을 iPhone 잠금 화면과 Dynamic Island에, A
|
|
|
39
39
|
<img src="https://raw.githubusercontent.com/1eedaegon/tauri-plugin-live-activity/main/docs/images/live-editing.gif" width="800" alt="왼쪽은 iPhone 17 Pro 시뮬레이터의 화면 녹화로, 데모 위로 끌어내린 잠금 화면과 Mochi의 카드입니다. 오른쪽은 저장 기록으로 그린 편집기 화면의 card.tsx입니다. 값을 저장하면 상태 문구, 남은 시간, 진행률 막대가 그 자리에서 바뀌고, 발바닥을 자전거로 바꾸거나 제목을 키워 저장하면 카드가 사라졌다가 바뀐 모습으로 다시 뜹니다.">
|
|
40
40
|
|
|
41
41
|
모두 고양이 Mochi를 따라가는 [데모 앱](https://github.com/1eedaegon/tauri-plugin-live-activity/tree/main/examples/demo)에서
|
|
42
|
-
캡처했습니다. iOS 16.
|
|
42
|
+
캡처했습니다. iOS 16.1 이상, Android 8 이상에서 동작하고, 데스크톱에서는 활동 명령이
|
|
43
43
|
`UNSUPPORTED_PLATFORM`을 돌려줍니다. 플러그인은 [liveactivity](https://github.com/1eedaegon/liveactivity-rs)
|
|
44
44
|
크레이트의 어댑터이고, 이 크레이트가 iOS는 [activitykit](https://github.com/1eedaegon/activitykit-rs), Android는
|
|
45
45
|
[liveupdate](https://github.com/1eedaegon/liveupdate-rs) 위에서 돌립니다. 그래서 플러그인 자체의 Swift 코드가 없고
|
|
@@ -77,7 +77,7 @@ JSX이므로 레이아웃은 별도 파일에 둡니다.
|
|
|
77
77
|
import { Button, HStack, Progress, SFSymbol, Text, VStack } from 'tauri-plugin-live-activity/jsx';
|
|
78
78
|
|
|
79
79
|
// iOS: 잠금 화면이 이 트리를 그대로 그리고, 펼친 Dynamic Island에도 같은 트리가 보입니다
|
|
80
|
-
// (iOS 16.
|
|
80
|
+
// (iOS 16.1 이상, Button은 iOS 17.2 이상).
|
|
81
81
|
// Android: 알림이 처음 두 Text를 제목과 본문으로, 첫 Progress를 진행률 막대로, Button을 최대 세 개까지
|
|
82
82
|
// 동작으로 가져가고, 심볼과 스타일은 그리지 않습니다.
|
|
83
83
|
export const lockScreen = (
|
|
@@ -136,8 +136,9 @@ prop입니다. [더 보기](https://github.com/1eedaegon/tauri-plugin-live-activ
|
|
|
136
136
|
```rust
|
|
137
137
|
use std::collections::BTreeMap;
|
|
138
138
|
use tauri::{AppHandle, Runtime};
|
|
139
|
+
use tauri_plugin_live_activity::activitykit::layout::text;
|
|
139
140
|
use tauri_plugin_live_activity::{
|
|
140
|
-
AndroidOptions, AndroidVisibility,
|
|
141
|
+
AndroidOptions, AndroidVisibility, Bound, Layout, LayoutEndInput, LayoutSnapshot, LayoutStartInput,
|
|
141
142
|
LayoutUpdateInput, LiveActivityExt, Result, Value,
|
|
142
143
|
};
|
|
143
144
|
|
|
@@ -147,10 +148,7 @@ fn snapshot(revision: u64, status: &str) -> LayoutSnapshot {
|
|
|
147
148
|
}
|
|
148
149
|
|
|
149
150
|
fn deliver<R: Runtime>(app: &AppHandle<R>) -> Result<()> {
|
|
150
|
-
let layout = Layout
|
|
151
|
-
lock_screen: Element::Text { value: None, bind: Some("status".into()) }.into(),
|
|
152
|
-
island: None, background: None, keyline: None, url: None, small: None,
|
|
153
|
-
};
|
|
151
|
+
let layout = Layout::new(text(Bound::key("status")));
|
|
154
152
|
// Android와, Live Activity가 없는 iOS에서는 알림으로 보입니다.
|
|
155
153
|
let mut input = LayoutStartInput::new("mochi:snack", layout, snapshot(0, "On time"));
|
|
156
154
|
// Android 전용: 잠금 화면 표시 범위, 포그라운드 배치, 워치의 Ongoing Activity.
|
|
@@ -305,8 +303,9 @@ Auto에는 이를 보여 줄 자리가 없습니다. Android는 `small`을 `degr
|
|
|
305
303
|
|
|
306
304
|
## 제약
|
|
307
305
|
|
|
308
|
-
- iOS: iOS 16.
|
|
309
|
-
(아니면 `NOT_FOREGROUND`), 시스템이
|
|
306
|
+
- iOS: iOS 16.1의 iPhone 또는 iPadOS 17의 iPad, 버튼과 토글은 iOS 17.2부터. iOS 16.1에는 stale 날짜와 relevance 점수가
|
|
307
|
+
없고, `frequentPushes`는 `denied`입니다. 액티비티는 앱이 전면일 때만 시작되고 (아니면 `NOT_FOREGROUND`), 시스템이
|
|
308
|
+
8시간 뒤 끝냅니다.
|
|
310
309
|
- iOS는 각 액티비티의 마지막 값을 앱의 Application Support에 평문으로 둡니다. 플러그인 설정에
|
|
311
310
|
`"receipts": "redacted"`를 주면 가립니다.
|
|
312
311
|
- 버튼 탭은 Rust `on_action` 핸들러를 최대 4초 기다립니다. JavaScript 리스너는 기다리지 않습니다.
|
package/README.md
CHANGED
|
@@ -39,7 +39,7 @@ start it again ([live editing](https://github.com/1eedaegon/tauri-plugin-live-ac
|
|
|
39
39
|
<img src="https://raw.githubusercontent.com/1eedaegon/tauri-plugin-live-activity/main/docs/images/live-editing.gif" width="800" alt="Left, the screen recording of the iPhone 17 Pro simulator: its Lock Screen pulled down over the demo, with Mochi's card. Right, card.tsx as an editor shows it, drawn from the log of the saves. Saves of values change the status, the time and the meter in place; a save that swaps the paw for a bicycle, and one that makes the title larger, each make the card go and come back changed.">
|
|
40
40
|
|
|
41
41
|
All of them come from the [demo app](https://github.com/1eedaegon/tauri-plugin-live-activity/tree/main/examples/demo),
|
|
42
|
-
which follows a cat named Mochi. iOS 16.
|
|
42
|
+
which follows a cat named Mochi. iOS 16.1+ and Android 8+; on desktop the activity commands answer
|
|
43
43
|
`UNSUPPORTED_PLATFORM`. The plugin is an adapter of the [liveactivity](https://github.com/1eedaegon/liveactivity-rs)
|
|
44
44
|
crate, which runs iOS on [activitykit](https://github.com/1eedaegon/activitykit-rs) and Android on
|
|
45
45
|
[liveupdate](https://github.com/1eedaegon/liveupdate-rs): the plugin has no Swift of its own, and its Kotlin answers
|
|
@@ -77,7 +77,7 @@ since this JSX has no HTML elements.
|
|
|
77
77
|
import { Button, HStack, Progress, SFSymbol, Text, VStack } from 'tauri-plugin-live-activity/jsx';
|
|
78
78
|
|
|
79
79
|
// iOS: the Lock Screen draws this tree as it is, and the expanded Dynamic Island shows it too
|
|
80
|
-
// (iOS 16.
|
|
80
|
+
// (iOS 16.1+; the Button needs iOS 17.2).
|
|
81
81
|
// Android: the notification takes the first two Texts as title and body, the first Progress as its
|
|
82
82
|
// bar and up to three Buttons as actions; symbols and styles are left out.
|
|
83
83
|
export const lockScreen = (
|
|
@@ -137,8 +137,9 @@ call them off the main thread (on iOS a call on the main thread answers `NATIVE_
|
|
|
137
137
|
```rust
|
|
138
138
|
use std::collections::BTreeMap;
|
|
139
139
|
use tauri::{AppHandle, Runtime};
|
|
140
|
+
use tauri_plugin_live_activity::activitykit::layout::text;
|
|
140
141
|
use tauri_plugin_live_activity::{
|
|
141
|
-
AndroidOptions, AndroidVisibility,
|
|
142
|
+
AndroidOptions, AndroidVisibility, Bound, Layout, LayoutEndInput, LayoutSnapshot, LayoutStartInput,
|
|
142
143
|
LayoutUpdateInput, LiveActivityExt, Result, Value,
|
|
143
144
|
};
|
|
144
145
|
|
|
@@ -148,10 +149,7 @@ fn snapshot(revision: u64, status: &str) -> LayoutSnapshot {
|
|
|
148
149
|
}
|
|
149
150
|
|
|
150
151
|
fn deliver<R: Runtime>(app: &AppHandle<R>) -> Result<()> {
|
|
151
|
-
let layout = Layout
|
|
152
|
-
lock_screen: Element::Text { value: None, bind: Some("status".into()) }.into(),
|
|
153
|
-
island: None, background: None, keyline: None, url: None, small: None,
|
|
154
|
-
};
|
|
152
|
+
let layout = Layout::new(text(Bound::key("status")));
|
|
155
153
|
// Android, and iOS without Live Activities, show it as a notification.
|
|
156
154
|
let mut input = LayoutStartInput::new("mochi:snack", layout, snapshot(0, "On time"));
|
|
157
155
|
// Android only: the lock screen, the foreground placement, a watch's Ongoing Activity.
|
|
@@ -315,8 +313,9 @@ at most 1 MiB and 1224 × 480 pixels. [More](https://github.com/1eedaegon/tauri-
|
|
|
315
313
|
|
|
316
314
|
## Limits
|
|
317
315
|
|
|
318
|
-
- iOS: an iPhone with iOS 16.
|
|
319
|
-
|
|
316
|
+
- iOS: an iPhone with iOS 16.1 or an iPad with iPadOS 17; buttons and toggles need iOS 17.2. iOS 16.1 has no stale date and no
|
|
317
|
+
relevance score, and `frequentPushes` is `denied` there. An activity starts only while the app is in the foreground
|
|
318
|
+
(`NOT_FOREGROUND` otherwise), and the system ends it after 8 hours.
|
|
320
319
|
- iOS keeps each activity's last values in plain text in the app's Application Support, unless the plugin
|
|
321
320
|
configuration sets `"receipts": "redacted"`.
|
|
322
321
|
- A button's tap waits for the Rust `on_action` handlers, at most 4 seconds; JavaScript listeners are not awaited.
|
package/cli/xcodegen.mjs
CHANGED
|
@@ -166,7 +166,7 @@ export function widgetSpec({ pluginVersion, packagePath, appTarget, bundleId, ap
|
|
|
166
166
|
` ${WIDGET}:`,
|
|
167
167
|
' type: app-extension',
|
|
168
168
|
' platform: iOS',
|
|
169
|
-
' deploymentTarget: "16.
|
|
169
|
+
' deploymentTarget: "16.1"',
|
|
170
170
|
` sources: [${WIDGET}]`,
|
|
171
171
|
' dependencies:',
|
|
172
172
|
...product('ActivityKitWidget'),
|
package/dist-js/types.d.ts
CHANGED
|
@@ -103,7 +103,10 @@ export interface Permissions {
|
|
|
103
103
|
readonly notifications: PermissionState;
|
|
104
104
|
readonly liveActivities: PermissionState;
|
|
105
105
|
readonly promotion: PermissionState;
|
|
106
|
-
/**
|
|
106
|
+
/**
|
|
107
|
+
* Frequent pushes, a switch in Settings on iOS (`granted` or `denied`); `denied` on iOS 16.1, which has no such
|
|
108
|
+
* switch; `notApplicable` where there are no pushes.
|
|
109
|
+
*/
|
|
107
110
|
readonly frequentPushes: PermissionState;
|
|
108
111
|
}
|
|
109
112
|
interface SnapshotFields {
|
|
@@ -199,7 +202,7 @@ export interface LayoutSnapshot {
|
|
|
199
202
|
readonly revision: number;
|
|
200
203
|
/** The complete map. An update keeps the keys and the value types accepted at start. */
|
|
201
204
|
readonly values: LayoutValues;
|
|
202
|
-
/** UTC Unix epoch milliseconds. */
|
|
205
|
+
/** UTC Unix epoch milliseconds. iOS 16.1 has no stale date: the record keeps it, and the content never goes stale. */
|
|
203
206
|
readonly staleAt?: number;
|
|
204
207
|
/**
|
|
205
208
|
* When the content was made, UTC Unix epoch milliseconds. ActivityKit (iOS 17.2) drops content older than what it
|
|
@@ -208,7 +211,7 @@ export interface LayoutSnapshot {
|
|
|
208
211
|
readonly timestamp?: number;
|
|
209
212
|
/**
|
|
210
213
|
* Which of the app's activities the Dynamic Island shows first: the highest score wins. Without it the activity
|
|
211
|
-
* keeps its score, 0 at first. Android
|
|
214
|
+
* keeps its score, 0 at first. Android and iOS 16.1 ignore it, and their records do not repeat it.
|
|
212
215
|
*/
|
|
213
216
|
readonly relevance?: number;
|
|
214
217
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tauri-plugin-live-activity",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.0",
|
|
4
4
|
"description": "Tauri 2 plugin for iOS Live Activities (ActivityKit and Dynamic Island) and Android Live Updates with ongoing notification fallback",
|
|
5
5
|
"author": "1eedaegon",
|
|
6
6
|
"type": "module",
|