tauri-plugin-live-activity 0.2.0 → 0.3.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 CHANGED
@@ -3,21 +3,14 @@
3
3
  [![npm](https://img.shields.io/npm/v/tauri-plugin-live-activity)](https://www.npmjs.com/package/tauri-plugin-live-activity)
4
4
  [![crates.io](https://img.shields.io/crates/v/tauri-plugin-live-activity)](https://crates.io/crates/tauri-plugin-live-activity)
5
5
  [![CI](https://github.com/1eedaegon/tauri-plugin-live-activity/actions/workflows/ci.yml/badge.svg)](https://github.com/1eedaegon/tauri-plugin-live-activity/actions/workflows/ci.yml)
6
+ [![License](https://img.shields.io/badge/license-MIT%20OR%20Apache--2.0-blue)](LICENSE)
6
7
 
7
- Tauri 2에서 iOS Live Activities(ActivityKit·Dynamic Island)와 Android Live Updates를 표시하는 커뮤니티 플러그인입니다.
8
- Android에서는 지원 조건에 따라 일반 진행 알림으로 표시합니다.
9
- **1.0 이전에는 마이너 버전이 바뀔 때 API도 바뀔 수 있습니다.** [English](https://github.com/1eedaegon/tauri-plugin-live-activity/blob/main/README.md)
10
-
11
- | 플랫폼 | 표시 방식 |
12
- | --- | --- |
13
- | iOS 16.1+ / iPadOS 17+ | ActivityKit · 잠금 화면 / 지원 기기의 Dynamic Island |
14
- | Android API 26+ | 진행 알림 · API 36+에서 조건 충족 시 Live Update 승격 |
15
- | macOS / Windows / Linux | 미구현 |
16
-
17
- ## 데모
8
+ Tauri 2 앱이 하고 있는 일을 iPhone 잠금 화면과 Dynamic Island에, Android에서는 진행 중 알림으로
9
+ 보여 줍니다. 레이아웃은 TypeScript로 적고, 그리는 일은 플러그인이 맡습니다.
10
+ [English](https://github.com/1eedaegon/tauri-plugin-live-activity/blob/main/README.md)
18
11
 
19
12
  <table>
20
- <tr><th>iOS 잠금 화면</th><th>iOS Dynamic Island</th></tr>
13
+ <tr><th>iOS 잠금 화면</th><th>Dynamic Island</th></tr>
21
14
  <tr>
22
15
  <td><img src="https://raw.githubusercontent.com/1eedaegon/tauri-plugin-live-activity/main/docs/images/ios-layout-paths.png" width="400" alt="iOS 잠금 화면에 SVG 경로로 그린 Mochi 얼굴"></td>
23
16
  <td><img src="https://raw.githubusercontent.com/1eedaegon/tauri-plugin-live-activity/main/docs/images/ios-island-expanded.png" width="400" alt="펼친 Dynamic Island에 표시한 Mochi의 간식"></td>
@@ -29,552 +22,237 @@ Android에서는 지원 조건에 따라 일반 진행 알림으로 표시합니
29
22
  </tr>
30
23
  </table>
31
24
 
32
- 고양이 Mochi를 따라가는 [데모 앱](https://github.com/1eedaegon/tauri-plugin-live-activity/tree/main/examples/demo)에서
33
- 캡처했습니다. iOS는 iPhone 17 시뮬레이터(iOS 26.3), Android는 Android 16(API 36) 에뮬레이터,
34
- Now Bar는 잠긴 Galaxy S23(One UI 9, Android 17)입니다.
25
+ 네 장 모두 고양이 Mochi를 따라가는 [데모 앱](https://github.com/1eedaegon/tauri-plugin-live-activity/tree/main/examples/demo)에서
26
+ 캡처했습니다. 플러그인은 iOS 16.1 이상과 Android 8 이상에서 동작하고, 데스크톱에서는 활동 명령이
27
+ `UNSUPPORTED_PLATFORM`을 돌려줍니다. 1.0 전까지는 마이너 버전이 바뀔 때 API도 바뀔 수 있습니다.
35
28
 
36
29
  ## 설치
37
30
 
38
- Tauri 2와 Rust 1.90 이상이 필요합니다. 아래 명령은 모두 앱의 루트 폴더에서 실행합니다.
39
- npm 패키지와 crate는 같은 마이너 버전을 사용해야 합니다.
31
+ Tauri 2 앱 폴더에서 실행합니다.
40
32
 
41
33
  ```sh
42
- npm i tauri-plugin-live-activity@0.2 && cargo add tauri-plugin-live-activity@0.2 --manifest-path src-tauri/Cargo.toml
43
- for p in default allow-request-permissions allow-start allow-update allow-end allow-start-layout allow-update-layout allow-end-layout; do npx tauri permission add live-activity:$p; done
34
+ cargo add tauri-plugin-live-activity --manifest-path src-tauri/Cargo.toml
35
+ npm i tauri-plugin-live-activity
36
+ npx tauri-plugin-live-activity setup
44
37
  ```
45
38
 
46
- 그다음 `src-tauri/src/lib.rs`에서 플러그인을 등록합니다.
39
+ 그리고 `src-tauri/src/lib.rs`의 빌더에 한 줄을 더합니다.
47
40
 
48
41
  ```rust
49
- tauri::Builder::default()
50
- .plugin(tauri_plugin_live_activity::init())
51
- ```
52
-
53
- ### iOS
54
-
55
- 활동은 플러그인 템플릿으로 만든 위젯 확장이 그립니다. Mac에서 `tauri ios init`을 실행한 뒤,
56
- 같은 셸에서 아래 명령을 차례로 실행합니다. 각 줄이 하는 일은 다음과 같습니다.
57
-
58
- 1. 플러그인 폴더를 찾습니다. `jq`는 macOS 15부터 기본으로 들어 있습니다.
59
- 2. 위젯, 버튼 인텐트, 확장의 Info.plist를 복사합니다. 이 Info.plist에는 `TauriLiveActivityLayout` = 2가
60
- 들어 있습니다.
61
- 3. `src-tauri/Info.ios.plist`에 `NSSupportsLiveActivities`를 추가합니다. Tauri가 이 파일을 앱의
62
- Info.plist에 합칩니다.
63
- 4. 플러그인 Swift 패키지가 쓰는 Tauri 의존성을 준비합니다. Apple silicon Mac에서는
64
- `--target aarch64-apple-ios-sim`을 씁니다.
65
-
66
- ```sh
67
- LA=$(cargo metadata --format-version 1 --manifest-path src-tauri/Cargo.toml | jq -r '.packages[] | select(.name == "tauri-plugin-live-activity") | .manifest_path | rtrimstr("Cargo.toml")')
68
- mkdir -p src-tauri/gen/apple/LiveActivityWidget && cp "$LA"templates/ios/* src-tauri/gen/apple/LiveActivityWidget/
69
- /usr/libexec/PlistBuddy -c 'Add :NSSupportsLiveActivities bool true' src-tauri/Info.ios.plist
70
- IPHONEOS_DEPLOYMENT_TARGET=16.1 cargo check --manifest-path src-tauri/Cargo.toml --target x86_64-apple-ios
42
+ .plugin(tauri_plugin_live_activity::init())
71
43
  ```
72
44
 
73
- Tauri는 XcodeGen으로 Xcode 프로젝트를 만들고, 새 타깃은 XcodeGen YAML 블록이라 한 줄로
74
- 쓸 수 없습니다. 아래 블록을 붙여 넣고 마지막 줄을 실행합니다.
75
-
76
- ```sh
77
- cat > src-tauri/gen/apple/live-activity.yml <<EOF
78
- packages:
79
- LiveActivity: { path: "${LA}ios" }
80
- targets:
81
- $(sed -n 's/^name: //p' src-tauri/gen/apple/project.yml)_iOS:
82
- sources: [LiveActivityWidget/LiveActivityActionIntent.swift]
83
- dependencies: [{ target: LiveActivityWidget }]
84
- settings: { base: { SWIFT_VERSION: "5.0" } }
85
- LiveActivityWidget:
86
- type: app-extension
87
- platform: iOS
88
- deploymentTarget: "16.1"
89
- sources: [LiveActivityWidget]
90
- dependencies: [{ package: LiveActivity, product: LiveActivityShared }, { package: LiveActivity, product: LiveActivityUI }]
91
- info: { path: LiveActivityWidget/Info.plist, properties: { NSExtension: { NSExtensionPointIdentifier: com.apple.widgetkit-extension }, TauriLiveActivityLayout: 2 } }
92
- settings: { base: { PRODUCT_BUNDLE_IDENTIFIER: $(jq -r .identifier src-tauri/tauri.conf.json).widget, SWIFT_VERSION: "5.0" } }
93
- EOF
94
- printf '\ninclude: [live-activity.yml]\n' >> src-tauri/gen/apple/project.yml && xcodegen generate --spec src-tauri/gen/apple/project.yml
95
- ```
96
-
97
- 인텐트 파일은 두 타깃에 모두 들어갑니다. 위젯은 이 파일로 버튼을 만들고, 시스템은 인텐트를
98
- 앱에서 실행합니다. `tauri ios init`을 다시 실행하면 `project.yml`이 새로 써지므로 마지막 줄을
99
- 다시 실행합니다. 확장의 버전은 1.0 (1)이 되니, App Store에 올리기 전에 앱과 같은 버전으로 맞춥니다.
100
-
101
- ### Android
102
-
103
- 알림 권한과 리시버는 플러그인 매니페스트가 추가합니다. 빌드에는 Android SDK 37이 필요합니다.
104
- 최소 버전은 Android 8(API 26)인데, 새 Tauri 앱은 24로 시작합니다. 첫 줄은 `tauri android init`에
105
- 쓰일 값을, 둘째 줄은 이미 만든 프로젝트의 값을 바꿉니다.
106
-
107
- ```sh
108
- node -e 'f="src-tauri/tauri.conf.json";c=require("./"+f);(c.bundle.android??={}).minSdkVersion=26;require("fs").writeFileSync(f,JSON.stringify(c,null,2)+"\n")'
109
- perl -pi -e 's/minSdk = 2[0-5]$/minSdk = 26/' src-tauri/gen/android/app/build.gradle.kts
110
- ```
45
+ `setup`은 플러그인 권한을 허용하고, Android 최소 버전을 API 26으로 올리고, Mac에서는 활동을 그리는
46
+ 위젯 확장을 Xcode 프로젝트에 추가합니다. `tauri ios init` 뒤에 실행하고, 나중에 `src-tauri/gen/apple`을
47
+ 처음부터 다시 만들었다면 한 번 더 실행하세요. 무엇이 바뀔지는 `--dry-run`으로 먼저 볼 수 있습니다.
111
48
 
112
49
  ## 사용법
113
50
 
114
- 플러그인은 앱이 보낸 상태를 표시합니다. 실제 작업, 백그라운드 실행, 갱신 주기는 앱이
115
- 담당합니다. 활동이 어디에 보일지는 OS 권한, 집중 모드, 승격 규칙이 정합니다.
116
- `fallback: 'none'`은 네이티브 백엔드를 쓸 수 없을 때 시작을 거부할 뿐, Android가 알림을
117
- 승격하도록 강제하지는 못합니다.
118
-
119
- 캡처는 iPhone 17 시뮬레이터(iOS 26.3)와 Android 16 에뮬레이터에서 했습니다. 데모는 여기
120
- 코드에 Mochi의 색과 여백을 더했습니다.
121
-
122
- ### 진행률
123
-
124
51
  ```ts
125
- import { getCapabilities, requestPermissions, start, update, end } from 'tauri-plugin-live-activity';
52
+ import { getCapabilities, layout, requestPermissions, startLayout, updateLayout, endLayout } from 'tauri-plugin-live-activity';
126
53
 
54
+ const { vstack, bound, progress } = layout;
127
55
  const { platform } = await getCapabilities();
128
56
  await requestPermissions(platform === 'android' ? 'notifications' : 'liveActivities');
129
57
 
130
- const snack = await start({
58
+ const snack = await startLayout({
131
59
  activityKey: 'mochi:snack',
132
- schemaVersion: 1,
133
- template: 'progress',
60
+ schemaVersion: 2,
134
61
  fallback: 'notification',
135
- snapshot: { revision: 0, title: 'Mochi’s snack delivery', status: 'Packing a tiny treat', progress: 0.15 },
62
+ layout: { lockScreen: vstack([bound('title'), bound('status'), progress('done')]) },
63
+ snapshot: { revision: 0, values: { title: 'Mochi’s snack', status: 'Packing a tiny treat', done: 0.15 } },
136
64
  });
137
- await update({
138
- id: snack.id,
139
- snapshot: { revision: 1, title: 'Mochi’s snack delivery', status: 'On the way to Mochi', progress: 0.65 },
140
- });
141
- await end({ id: snack.id, policy: { kind: 'immediate' } });
65
+ await updateLayout({ id: snack.id, snapshot: { revision: 1, values: { title: 'Mochi’s snack', status: 'On the way', done: 0.65 } } });
66
+ await endLayout({ id: snack.id, policy: { kind: 'immediate' } });
142
67
  ```
143
68
 
144
- 갱신할 때마다 `revision`을 올리고 snapshot 전체를 보냅니다. 앱을 다시 실행한 뒤에는 `list()`로
145
- 활동을 다시 찾습니다.
146
-
147
- <table>
148
- <tr><th>iOS 26.3 시뮬레이터</th><th>Android 16 에뮬레이터</th></tr>
149
- <tr>
150
- <td><img src="https://raw.githubusercontent.com/1eedaegon/tauri-plugin-live-activity/main/docs/images/ios-v1-progress.png" width="400" alt="iOS 잠금 화면에서 65%인 Mochi의 간식 배달"></td>
151
- <td><img src="https://raw.githubusercontent.com/1eedaegon/tauri-plugin-live-activity/main/docs/images/android-v1-progress.png" width="400" alt="Android 알림 창에서 진행 막대가 있는 Mochi의 간식 배달"></td>
152
- </tr>
153
- </table>
69
+ 레이아웃은 시작할 때 모습 그대로 유지됩니다. 갱신할 때는 모든 값을 더 높은 revision과 함께 다시
70
+ 보냅니다.
154
71
 
155
- iOS의 고양이 그림은 데모 앱의 자체 위젯이 그립니다. 플러그인 템플릿은 같은 제목, 상태,
156
- 진행 막대를 표시합니다.
72
+ ## 스타일 바꾸기
157
73
 
158
- ### 타이머
74
+ 트리는 시작할 때 정해지지만, 몇몇 스타일 멤버는 값을 가리킬 수 있습니다. 그러면 갱신으로 바꿀 수 있습니다.
159
75
 
160
76
  ```ts
161
- import { start } from 'tauri-plugin-live-activity';
162
-
163
- const now = Date.now();
164
- await start({
165
- activityKey: 'mochi:nap',
166
- schemaVersion: 1,
167
- template: 'timer',
168
- fallback: 'notification',
169
- snapshot: {
170
- revision: 0, title: 'Mochi’s nap', status: 'A little snooze, a little peace',
171
- timer: { startedAt: now, endsAt: now + 5 * 60_000 },
172
- },
173
- });
77
+ const { bind } = layout;
78
+ // styles: { status: { color: bind('tone'), weight: bind('weight') } }, values: { tone: 'green', weight: 'regular', … }
79
+ await updateLayout({ id, snapshot: { revision: 2, values: { ...values, tone: 'red', weight: 'bold' } } });
174
80
  ```
175
81
 
176
- 시각은 Unix 밀리초입니다. 카운트다운은 시스템이 하므로 앱이 매초 보낼 것은 없습니다.
177
-
178
- <table>
179
- <tr><th>iOS 26.3 시뮬레이터</th><th>Android 16 에뮬레이터</th></tr>
180
- <tr>
181
- <td><img src="https://raw.githubusercontent.com/1eedaegon/tauri-plugin-live-activity/main/docs/images/ios-v1-timer.png" width="400" alt="iOS 잠금 화면에서 4:48부터 줄어드는 Mochi의 낮잠"></td>
182
- <td><img src="https://raw.githubusercontent.com/1eedaegon/tauri-plugin-live-activity/main/docs/images/android-v1-timer.png" width="400" alt="Android 알림 머리글의 카운트다운과 Mochi의 낮잠"></td>
183
- </tr>
184
- </table>
185
-
186
- ## 레이아웃
187
-
188
- 레이아웃을 쓰면 앱이 활동의 화면을 직접 구성합니다. 노드 트리, 스타일 표, 값 맵을 보내면
189
- iOS에서는 플러그인의 위젯 템플릿이 그리므로 앱에 SwiftUI 코드가 필요 없습니다. Android는
190
- 그중 일부를 알림으로 보여 줍니다. 트리는 시작할 때 고정되고, 갱신할 때는 같은 키와 타입으로
191
- 값만 보냅니다. 레이아웃·스타일·값은 ActivityKit의 4 KiB 한도를 함께 씁니다.
192
-
193
- ### 텍스트, 값, 스타일
194
-
195
- ```ts
196
- import { layout, startLayout, updateLayout, endLayout } from 'tauri-plugin-live-activity';
197
-
198
- const { vstack, bound, text } = layout;
199
-
200
- const card = await startLayout({
201
- activityKey: 'mochi:text',
202
- schemaVersion: 2,
203
- fallback: 'notification',
204
- layout: {
205
- lockScreen: vstack([
206
- bound('title', { style: 'title' }),
207
- bound('status', { style: 'status', unless: 'arrived' }),
208
- text('Snack time! Made it home', { style: 'done', if: 'arrived' }),
209
- ], { alignment: 'leading' }),
210
- },
211
- styles: {
212
- title: { font: 'headline' },
213
- status: { font: 'subheadline', color: 'secondary' },
214
- done: { font: 'subheadline', weight: 'bold', color: '#C9654D' },
215
- },
216
- snapshot: { revision: 0, values: { title: 'Mochi’s snack', status: 'Packing a tiny treat', arrived: false } },
217
- });
218
-
219
- await updateLayout({
220
- id: card.id,
221
- snapshot: { revision: 1, values: { title: 'Mochi’s snack', status: 'Packing a tiny treat', arrived: true } },
222
- });
223
-
224
- await endLayout({ id: card.id, policy: { kind: 'immediate' } });
82
+ ```rust
83
+ let status = Style { color: Some(Bound::key("tone").into()), ..Style::default() };
84
+ // 나중에: 값을 모두 다시 보내면서 색만 바꿉니다.
85
+ values.insert("tone".into(), Value::Text("red".into()));
86
+ app.live_activity().update_layout(LayoutUpdateInput { id, snapshot: LayoutSnapshot { revision: 2, values, stale_at: None } })?;
225
87
  ```
226
88
 
227
- `bound`는 값을, `text`는 고정 문자열을 표시합니다. `if`는 값이 참으로 평가될 때만, `unless`는
228
- 그렇지 않을 때만 노드를 보여 줍니다. 아래 예시는 `fallback` 다음의 멤버만 보여 주며, 빌더는 모두
229
- `layout`에 있습니다.
230
-
231
- <table>
232
- <tr><th></th><th>iOS 26.3 시뮬레이터</th><th>Android 16 에뮬레이터</th></tr>
233
- <tr>
234
- <td><code>arrived: false</code></td>
235
- <td><img src="https://raw.githubusercontent.com/1eedaegon/tauri-plugin-live-activity/main/docs/images/ios-layout-text.png" width="380" alt="iOS 잠금 화면의 제목과 상태 텍스트"></td>
236
- <td><img src="https://raw.githubusercontent.com/1eedaegon/tauri-plugin-live-activity/main/docs/images/android-layout-text.png" width="380" alt="같은 제목과 상태를 표시한 Android 알림"></td>
237
- </tr>
238
- <tr>
239
- <td><code>arrived: true</code></td>
240
- <td><img src="https://raw.githubusercontent.com/1eedaegon/tauri-plugin-live-activity/main/docs/images/ios-layout-text-arrived.png" width="380" alt="iOS에서 상태 대신 굵은 산호색 Snack time 텍스트"></td>
241
- <td><img src="https://raw.githubusercontent.com/1eedaegon/tauri-plugin-live-activity/main/docs/images/android-layout-text-arrived.png" width="380" alt="Android에서 본문이 Snack time으로 바뀐 알림"></td>
242
- </tr>
243
- </table>
244
-
245
- Android는 스타일을 버리고 첫 텍스트를 제목, 둘째 텍스트를 본문으로 씁니다.
89
+ 값을 가리킬 수 있는 것은 `color`, `background`, `tint`, `opacity`, `size`, `weight`, `cornerRadius`와
90
+ 레이아웃의 `background`, `keyline`뿐입니다. 색은 이름이나 hex 색만 되고, 라이트·다크 쌍은 쓸 수 없습니다.
91
+ 나머지는 시작한 그대로 남으니, 바꾸려면 활동을 끝내고 다시 시작하세요. 갱신마다 값을 전부 다시 보내고,
92
+ 레이아웃·스타일·값을 합친 weight는 3584를 넘을 수 없습니다. Android는 스타일을 그리지 않습니다.
93
+ 0.2.x 크레이트는 바인딩을 거부하므로 npm 패키지와 크레이트의 마이너 버전을 맞추세요.
94
+ [자세히](https://github.com/1eedaegon/tauri-plugin-live-activity/blob/main/docs/usage.md#changing-styles)
246
95
 
247
- ### SF Symbol
248
-
249
- ```ts
250
- layout: {
251
- lockScreen: hstack([
252
- symbol('cat.fill'),
253
- symbol('heart.fill', { rendering: 'multicolor' }),
254
- symbol('speaker.wave.3.fill', { variableBind: 'purr' }),
255
- bound('title'),
256
- ], { spacing: 12 }),
257
- },
258
- snapshot: { revision: 0, values: { title: 'Purr meter', purr: 0.35 } },
259
- ```
96
+ ## 레이아웃에 넣을 수 있는 것
260
97
 
261
- `variableBind`는 0과 1 사이의 숫자로 가변 심볼을 채웁니다.
98
+ 레이아웃은 `text`/`bound`, `path`(SVG path 데이터), `vstack`·`hstack`·`zstack`·`spacer`·`divider`와
99
+ 아래 여섯 가지로 만듭니다. 그림은 모두 iOS 잠금화면입니다. 예시의 빌더는 `layout`에서 꺼내 씁니다
100
+ (`const { vstack, hstack, text, bound, symbol, image, gauge, progress, timerText, button } = layout;`).
262
101
 
263
- | iOS 26.3 시뮬레이터 | Android |
264
- | --- | --- |
265
- | <img src="https://raw.githubusercontent.com/1eedaegon/tauri-plugin-live-activity/main/docs/images/ios-layout-symbols.png" width="400" alt="iOS 잠금 화면의 고양이, 다색 하트, 35% 채운 스피커 심볼"> | 표시하지 않습니다. `degradedFeatures`에 `layout.symbol`로 남깁니다. |
102
+ ### 심볼
266
103
 
267
- ### 이미지
104
+ <img src="https://raw.githubusercontent.com/1eedaegon/tauri-plugin-live-activity/main/docs/images/ios-layout-symbols.png" width="400" alt="고양이, 여러 색 하트, 35% 채운 스피커">
268
105
 
269
106
  ```ts
270
- layout: {
271
- lockScreen: hstack([image('mochi', { resizable: true, style: 'portrait' }), bound('title')], { spacing: 12 }),
272
- },
273
- styles: { portrait: { frame: { width: 56, height: 56 } } },
274
- snapshot: { revision: 0, values: { title: 'Mochi’s portrait' } },
107
+ hstack([
108
+ symbol('cat.fill'),
109
+ symbol('heart.fill', { rendering: 'multicolor' }),
110
+ symbol('speaker.wave.3.fill', { variableBind: 'purr' }), // purr: 0.35
111
+ ])
275
112
  ```
276
113
 
277
- `image`는 위젯 확장의 에셋 카탈로그에 있는 그림의 이름입니다. `src-tauri/gen/apple/LiveActivityWidget`에
278
- `Assets.xcassets` 폴더를 두고 `xcodegen generate --spec src-tauri/gen/apple/project.yml`을 실행하면
279
- 위젯 타깃에 들어갑니다. 데모의 `mochi`는 SVG 파일에서 만든 PNG입니다.
114
+ SF Symbols입니다. `variableBind`는 0~1 값으로 가변 심볼을 채웁니다. iOS 전용입니다.
280
115
 
281
- | iOS 26.3 시뮬레이터 | Android |
282
- | --- | --- |
283
- | <img src="https://raw.githubusercontent.com/1eedaegon/tauri-plugin-live-activity/main/docs/images/ios-layout-image.png" width="400" alt="iOS 잠금 화면에 위젯 에셋 카탈로그에서 가져온 Mochi 초상화"> | 표시하지 않습니다. `layout.image`로 남깁니다. |
116
+ ### 이미지
284
117
 
285
- ### 경로(SVG path 데이터)
118
+ <img src="https://raw.githubusercontent.com/1eedaegon/tauri-plugin-live-activity/main/docs/images/ios-layout-image.png" width="400" alt="위젯 에셋 카탈로그의 Mochi 사진">
286
119
 
287
120
  ```ts
288
- const head = 'M14 40C12 32 11 22 14 14Q15 11 18 13L35 27Q50 23 65 27L82 13Q85 11 86 14C89 22 88 32 86 40C93 48 94 61 87 71C79 81 66 85 50 85C34 85 21 81 13 71C6 61 7 48 14 40Z';
289
- layout: {
290
- lockScreen: zstack([
291
- path(head, [100, 90], { style: 'fur' }),
292
- path(head, [100, 90], { stroke: 1.5 }),
293
- path('M28 54Q33 58 38 54M62 54Q67 58 72 54', [100, 90], { stroke: 2 }),
294
- path('M48 64Q50 62 52 64Q50 66 48 64Z', [100, 90], { style: 'nose' }),
295
- ], { style: 'face' }),
296
- },
297
- styles: { face: { frame: { width: 60, height: 54 } }, fur: { color: '#F6E9CD' }, nose: { color: '#C9654D' } },
298
- snapshot: { revision: 0, values: {} },
121
+ hstack([image('mochi', { resizable: true, style: 'portrait' }), bound('title')])
122
+ // styles: { portrait: { frame: { width: 56, height: 56 } } }
299
123
  ```
300
124
 
301
- `path`는 SVG `<path>`의 `d`를 `[너비, 높이]` 크기의 `box` 안에 비율을 지켜 그립니다. 기본은
302
- 채우기이고, `stroke`로 선 굵기를 주면 선으로 그립니다. `d`는 `M L H V C S Q T Z` 명령을
303
- 512바이트까지 받습니다. 호(`A`)는 지원하지 않으니 먼저 곡선으로 바꿉니다.
304
-
305
- | iOS 26.3 시뮬레이터 | Android |
306
- | --- | --- |
307
- | <img src="https://raw.githubusercontent.com/1eedaegon/tauri-plugin-live-activity/main/docs/images/ios-layout-paths.png" width="400" alt="iOS 잠금 화면에 경로 네 개로 그린 Mochi 얼굴"> | 표시하지 않습니다. `layout.path`로 남깁니다. |
125
+ 위젯 확장의 에셋 카탈로그에 있는 그림입니다. iOS 전용입니다.
308
126
 
309
127
  ### 게이지
310
128
 
311
- ```ts
312
- layout: {
313
- lockScreen: hstack([gauge('bowl', { max: 100, kind: 'circular' }), gauge('bowl', { max: 100 })], { spacing: 12 }),
314
- },
315
- snapshot: { revision: 0, values: { bowl: 80 } },
316
- ```
317
-
318
- 게이지는 `min`과 `max`(생략하면 0과 1) 사이의 숫자를 원이나 막대로 보여 줍니다.
319
-
320
- | iOS 26.3 시뮬레이터 | Android |
321
- | --- | --- |
322
- | <img src="https://raw.githubusercontent.com/1eedaegon/tauri-plugin-live-activity/main/docs/images/ios-layout-gauge.png" width="400" alt="iOS 잠금 화면에서 100 중 80을 가리키는 원형·막대 게이지"> | 표시하지 않습니다. `layout.gauge`로 남깁니다. |
323
-
324
- ### 진행 표시
129
+ <img src="https://raw.githubusercontent.com/1eedaegon/tauri-plugin-live-activity/main/docs/images/ios-layout-gauge.png" width="400" alt="100 중 80을 가리키는 원형·선형 게이지">
325
130
 
326
131
  ```ts
327
- layout: {
328
- lockScreen: vstack([bound('title'), progress('done', { kind: 'circular' }), progress('done')]),
329
- },
330
- snapshot: { revision: 0, values: { title: 'Mochi’s snack delivery', done: 0.65 } },
132
+ hstack([gauge('bowl', { max: 100, kind: 'circular' }), gauge('bowl', { max: 100 })]) // bowl: 80
331
133
  ```
332
134
 
333
- 진행 표시는 0부터 1까지의 숫자를 막대나 원으로 보여 줍니다.
334
-
335
- <table>
336
- <tr><th>iOS 26.3 시뮬레이터</th><th>Android 16 에뮬레이터</th></tr>
337
- <tr>
338
- <td><img src="https://raw.githubusercontent.com/1eedaegon/tauri-plugin-live-activity/main/docs/images/ios-layout-progress.png" width="400" alt="iOS 잠금 화면에서 65%인 원과 막대"></td>
339
- <td><img src="https://raw.githubusercontent.com/1eedaegon/tauri-plugin-live-activity/main/docs/images/android-layout-progress.png" width="400" alt="Android 알림의 진행 막대가 된 첫 진행 표시"></td>
340
- </tr>
341
- </table>
135
+ `min`~`max` 사이의 숫자를 원이나 막대로 보여 줍니다. iOS 전용입니다.
342
136
 
343
- Android는 첫 진행 표시를 알림의 진행 막대로 씁니다.
137
+ ### 진행률
344
138
 
345
- ### 타이머 텍스트
139
+ <img src="https://raw.githubusercontent.com/1eedaegon/tauri-plugin-live-activity/main/docs/images/ios-layout-progress.png" width="400" alt="65%를 가리키는 원과 막대">
346
140
 
347
141
  ```ts
348
- layout: {
349
- lockScreen: vstack([bound('title'), timerText('start', 'end')]),
350
- },
351
- snapshot: { revision: 0, values: { title: 'Mochi’s nap', start: Date.now(), end: Date.now() + 5 * 60_000 } },
142
+ vstack([bound('title'), progress('done', { kind: 'circular' }), progress('done')]) // done: 0.65
352
143
  ```
353
144
 
354
- `timerText`는 `end` 값까지 거꾸로 세고, `countsDown: false`이면 `start`부터 셉니다.
355
-
356
- <table>
357
- <tr><th>iOS 26.3 시뮬레이터</th><th>Android 16 에뮬레이터</th></tr>
358
- <tr>
359
- <td><img src="https://raw.githubusercontent.com/1eedaegon/tauri-plugin-live-activity/main/docs/images/ios-layout-timer.png" width="400" alt="iOS 잠금 화면에서 4:50부터 줄어드는 Mochi의 낮잠"></td>
360
- <td><img src="https://raw.githubusercontent.com/1eedaegon/tauri-plugin-live-activity/main/docs/images/android-layout-timer.png" width="400" alt="Android 알림 머리글의 크로노미터가 된 카운트다운"></td>
361
- </tr>
362
- </table>
145
+ 0~1 사이의 숫자입니다. Android에서는 첫 번째 진행률이 알림의 막대가 됩니다.
363
146
 
364
- Android는 첫 타이머를 알림의 크로노미터로 씁니다.
147
+ ### 타이머
365
148
 
366
- ### 스택
149
+ <img src="https://raw.githubusercontent.com/1eedaegon/tauri-plugin-live-activity/main/docs/images/ios-layout-timer.png" width="400" alt="Mochi 낮잠 아래 4:50에서 줄어드는 타이머">
367
150
 
368
151
  ```ts
369
- layout: {
370
- lockScreen: vstack([
371
- hstack([zstack([symbol('circle.fill'), symbol('pawprint.fill', { style: 'mark' })]), bound('title'), spacer(), bound('eta')]),
372
- divider(),
373
- hstack([bound('from'), spacer(), bound('to')]),
374
- ], { spacing: 10 }),
375
- },
376
- styles: { mark: { size: 13, color: 'white' } },
377
- snapshot: { revision: 0, values: { title: 'Snack route', eta: '4 min', from: 'Kitchen', to: 'Mochi’s bowl' } },
152
+ vstack([bound('title'), timerText('start', 'end')]) // end: Date.now() + 5 * 60_000
378
153
  ```
379
154
 
380
- `vstack`, `hstack`, `zstack`은 노드를 세로로, 가로로, 겹쳐서 놓습니다. `spacer`는 남는 공간을
381
- 차지하고 `divider`는 구분선을 그립니다.
382
-
383
- | iOS 26.3 시뮬레이터 | Android |
384
- | --- | --- |
385
- | <img src="https://raw.githubusercontent.com/1eedaegon/tauri-plugin-live-activity/main/docs/images/ios-layout-stacks.png" width="400" alt="iOS 잠금 화면의 발바닥 배지·제목·시간 한 줄, 구분선, 아래의 From과 To"> | 첫 두 텍스트만 제목과 본문으로 표시합니다. 캡처는 없습니다. |
155
+ 시스템이 세는 타이머로, `end`까지 줄어들거나 `start`부터 늘어납니다(`countsDown: false`). Android에서는 알림의 크로노미터가 됩니다.
386
156
 
387
157
  ### 버튼
388
158
 
389
- ```ts
390
- layout: {
391
- lockScreen: vstack([
392
- bound('title'),
393
- bound('status'),
394
- hstack([button('pet', text('Pet Mochi')), button('done', text('All done'))], { spacing: 8 }),
395
- ], { alignment: 'leading' }),
396
- },
397
- snapshot: { revision: 0, values: { title: 'Mochi wants attention', status: 'No pets yet', pets: 0 } },
398
- ```
399
-
400
- 버튼을 탭하면 버튼의 액션 ID가 앱에 전달됩니다. 탭만으로는 활동이 바뀌지 않으니 핸들러에서
401
- 갱신하거나 종료합니다. 웹뷰가 실행 중이면 `onAction`이 탭을 받습니다.
159
+ <img src="https://raw.githubusercontent.com/1eedaegon/tauri-plugin-live-activity/main/docs/images/ios-layout-buttons-after.png" width="400" alt="한 번 쓰다듬은 뒤의 Pet Mochi·All done 버튼">
402
160
 
403
161
  ```ts
404
- import { endLayout, onAction } from 'tauri-plugin-live-activity';
162
+ hstack([button('pet', text('Pet Mochi')), button('done', text('All done'))])
405
163
 
406
164
  await onAction(async ({ actionId, activityId }) => {
407
165
  if (actionId === 'done') await endLayout({ id: activityId, policy: { kind: 'immediate' } });
408
166
  });
409
167
  ```
410
168
 
411
- 시스템이 탭을 처리하려고 앱을 백그라운드에서 실행하면 Tauri가 웹뷰를 만들지 않을 수 있습니다.
412
- 그때도 동작해야 하는 탭은 Rust에서 처리합니다. 빌드한 `App`에 `run` 전에 핸들러를 등록합니다.
413
-
414
- ```rust
415
- use tauri_plugin_live_activity::{EndInput, EndPolicy, LiveActivityExt};
416
-
417
- let app = tauri::Builder::default()
418
- .plugin(tauri_plugin_live_activity::init())
419
- .build(tauri::generate_context!())
420
- .expect("error while building tauri application");
421
- let handle = app.handle().clone();
422
- app.live_activity().on_action(move |event| {
423
- if event.action_id == "done" {
424
- let input = EndInput { id: event.activity_id, policy: EndPolicy::Immediate {} };
425
- let _ = handle.live_activity().end_layout(input);
426
- }
427
- });
428
- app.run(|_, _| {});
429
- ```
169
+ 탭은 `onAction`으로, 앱이 열려 있지 않을 때는 Rust의 `on_action`으로 전달됩니다. iOS 17 이상이며, Android는 최대 세 개를 알림 버튼으로 보여 줍니다.
430
170
 
431
- Rust 핸들러가 먼저 플러그인 스레드에서 실행되며, 핸들러 안에서 플러그인을 호출해도 됩니다.
432
- `onAction`에는 `core:event:default` 권한이 필요한데, 새 앱에는 이미 들어 있습니다.
171
+ ### Dynamic Island
433
172
 
434
173
  <table>
435
- <tr><th></th><th>iOS 26.3 시뮬레이터</th><th>Android 16 에뮬레이터</th></tr>
436
- <tr>
437
- <td>시작</td>
438
- <td><img src="https://raw.githubusercontent.com/1eedaegon/tauri-plugin-live-activity/main/docs/images/ios-layout-buttons-before.png" width="380" alt="iOS 잠금 화면의 Pet Mochi와 All done 버튼"></td>
439
- <td><img src="https://raw.githubusercontent.com/1eedaegon/tauri-plugin-live-activity/main/docs/images/android-layout-buttons-before.png" width="380" alt="Android 알림 액션이 된 Pet Mochi와 All done"></td>
440
- </tr>
174
+ <tr><th>컴팩트</th><th>미니멀</th><th>확장</th></tr>
441
175
  <tr>
442
- <td>Pet Mochi 탭 후</td>
443
- <td><img src="https://raw.githubusercontent.com/1eedaegon/tauri-plugin-live-activity/main/docs/images/ios-layout-buttons-after.png" width="380" alt="iOS에서 한 번 탭한 뒤 Purring. 1 pet so far로 바뀐 상태"></td>
444
- <td><img src="https://raw.githubusercontent.com/1eedaegon/tauri-plugin-live-activity/main/docs/images/android-layout-buttons-after.png" width="380" alt="Android에서 두 번 탭한 뒤 Purring. 2 pets so far로 바뀐 본문"></td>
176
+ <td><img src="https://raw.githubusercontent.com/1eedaegon/tauri-plugin-live-activity/main/docs/images/ios-island-compact.png" width="270" alt="컴팩트 Dynamic Island의 발바닥과 9 min"></td>
177
+ <td><img src="https://raw.githubusercontent.com/1eedaegon/tauri-plugin-live-activity/main/docs/images/ios-island-minimal.png" width="180" alt="미니멀 Dynamic Island의 진행률 링"></td>
178
+ <td><img src="https://raw.githubusercontent.com/1eedaegon/tauri-plugin-live-activity/main/docs/images/ios-island-expanded.png" width="265" alt="확장 Dynamic Island의 사진, 제목, 시간, 상태, 막대"></td>
445
179
  </tr>
446
180
  </table>
447
181
 
448
- 데모의 Rust 핸들러가 쓰다듬은 횟수를 세어 상태를 갱신합니다. 버튼은 iOS 17 이상에서
449
- 동작합니다(`getCapabilities()`의 `actions`). Android는 버튼을 세 개까지 알림 액션으로 보여 줍니다. Android에서 종료된 앱을
450
- 다시 띄운 탭은 메모리에서 기다리다가, Tauri 런타임이 시작되지 않으면 사라집니다.
451
-
452
- ### Dynamic Island
453
-
454
182
  ```ts
455
- layout: {
456
- lockScreen: vstack([bound('title'), bound('status'), progress('done')]),
457
- island: {
458
- expanded: {
459
- leading: image('mochi', { resizable: true, style: 'portrait' }),
460
- center: bound('title'),
461
- trailing: bound('eta'),
462
- bottom: vstack([bound('status'), progress('done')]),
463
- },
464
- compactLeading: symbol('pawprint.fill'),
465
- compactTrailing: bound('eta'),
466
- minimal: progress('done', { kind: 'circular' }),
183
+ island: {
184
+ expanded: {
185
+ leading: image('mochi', { resizable: true, style: 'portrait' }),
186
+ center: bound('title'),
187
+ trailing: bound('eta'),
188
+ bottom: vstack([bound('status'), progress('done')]),
467
189
  },
468
- keyline: '#A3D9C2',
190
+ compactLeading: symbol('pawprint.fill'),
191
+ compactTrailing: bound('eta'),
192
+ minimal: progress('done', { kind: 'circular' }),
469
193
  },
470
- styles: { portrait: { frame: { width: 44, height: 44 } } },
471
- snapshot: { revision: 0, values: { title: 'Mochi’s snack', status: 'Packing a tiny treat', done: 0.15, eta: '9 min' } },
194
+ keyline: '#A3D9C2', // 아일랜드 테두리 색
472
195
  ```
473
196
 
474
- `island`로 각 영역에 노드를 따로 줍니다. 생략한 영역은 기본값을 씁니다. 펼친 화면은 잠금 화면
475
- 트리를, compact leading과 minimal은 그 트리의 첫 심볼을 보여 줍니다. `keyline`은 아일랜드
476
- 테두리 색입니다.
477
-
478
- <table>
479
- <tr><th>Compact</th><th>Minimal</th><th>Expanded</th></tr>
480
- <tr>
481
- <td><img src="https://raw.githubusercontent.com/1eedaegon/tauri-plugin-live-activity/main/docs/images/ios-island-compact.png" width="270" alt="compact Dynamic Island 왼쪽의 발바닥과 오른쪽의 9 min"></td>
482
- <td><img src="https://raw.githubusercontent.com/1eedaegon/tauri-plugin-live-activity/main/docs/images/ios-island-minimal.png" width="180" alt="minimal Dynamic Island의 진행 원"></td>
483
- <td><img src="https://raw.githubusercontent.com/1eedaegon/tauri-plugin-live-activity/main/docs/images/ios-island-expanded.png" width="265" alt="펼친 Dynamic Island의 초상화, 제목, 시간, 상태, 진행 막대"></td>
484
- </tr>
485
- </table>
486
-
487
- iPhone 17 시뮬레이터(iOS 26.3)에서 캡처했습니다. Android에는 Dynamic Island가 없어서
488
- `layout.island`로 남깁니다.
197
+ 레이아웃에서 `lockScreen` 옆에 `island`를 둡니다. 빠진 부분은 잠금화면 트리(확장)나 그 첫 심볼(컴팩트 왼쪽, 미니멀)을 보여 줍니다.
489
198
 
490
- ### Android
199
+ Android는 레이아웃을 알림으로 보여 줍니다. 첫 두 텍스트가 제목과 본문이 되고, 첫 진행률 막대와 타이머, 버튼 최대 세 개가 들어갑니다. 빠진 것은 `degradedFeatures`에 이름이 남습니다.
491
200
 
492
- 알림은 레이아웃을 그릴 수 없습니다. Android는 현재 값으로 잠금 화면 트리를 차례로 살펴
493
- 아래 부분만 씁니다.
201
+ ## 기본 부품 너머
494
202
 
495
- | 레이아웃 | 알림 |
496
- | --- | --- |
497
- | 첫 번째 `text` | 제목 |
498
- | 두 번째 `text` | 본문 |
499
- | 첫 번째 `progress` | 진행 막대 |
500
- | 첫 번째 `timerText` | 크로노미터 |
501
- | `button` 세 개까지 | 액션. 버튼 안의 첫 텍스트가 라벨 |
502
- | `android.visibility` | 잠금 화면 공개 범위: `public`, `private`(기본), `secret` |
203
+ 대부분은 Swift 없이 바꿀 수 있습니다. 글꼴과 그림을 위젯 확장에 넣고 이름으로 부르면 됩니다.
503
204
 
504
- 나머지는 `degradedFeatures`에 남깁니다. 아래 예시라면 `layout.symbol`과 `layout.styles`입니다.
205
+ ```sh
206
+ npx tauri-plugin-live-activity setup --font fonts/Pacifico-Regular.ttf --asset art/paw@3x.png
207
+ ```
505
208
 
506
209
  ```ts
507
- layout: {
508
- lockScreen: vstack([
509
- hstack([symbol('moon.zzz.fill'), bound('title', { style: 'title' })], { spacing: 8 }),
510
- bound('status'),
511
- progress('sleep'),
512
- button('wake', text('Wake Mochi')),
513
- ], { alignment: 'leading' }),
514
- },
515
- styles: { title: { font: 'headline' } },
516
- snapshot: { revision: 0, values: { title: 'Mochi’s nap', status: 'Dozing off', sleep: 0.2 } },
517
- android: { visibility: 'public' },
210
+ styles: { title: { fontFamily: 'Pacifico-Regular', size: 22 } }, // 글꼴을 부르는 이름은 setup이 알려 줍니다
211
+ lockScreen: hstack([image('paw'), bound('title', { style: 'title' })]),
518
212
  ```
519
213
 
520
- | iOS | Android 16 에뮬레이터 |
521
- | --- | --- |
522
- | 위 예시들처럼 작성한 그대로 그립니다. | <img src="https://raw.githubusercontent.com/1eedaegon/tauri-plugin-live-activity/main/docs/images/android-layout-android.png" width="400" alt="Android 알림 창에서 60%이고 Wake Mochi 액션이 있는 Mochi의 낮잠"> |
214
+ 앱이 캔버스나 Rust로 직접 그린 그림은 App Group을 거칩니다(`setup --app-group`). PNG를 쓴 다음 시작하거나
215
+ 갱신하면 위젯이 그 그림을 그립니다.
523
216
 
524
- 캡처는 `Fast asleep`, `0.6`으로 한 번 갱신한 뒤의 화면입니다. Android 16 이상에서는 앱이 승격된
525
- 알림을 보낼 수 있을 때 플러그인이 Live Update 승격을 요청하고, 그 결과는 `promotionState`에 나옵니다.
526
-
527
- ### Samsung Now Bar
528
-
529
- One UI는 Samsung의 허용 목록에 있는 앱의 승격된 알림만 Now Bar에 보여 줍니다. 사용자가 개발자
530
- 옵션 "Live notifications for all apps"를 켜 두면 모든 앱이 대상이 됩니다. 목록에 넣을 앱은
531
- Samsung이 비공개로 정하며, 공개된 신청 경로는 찾지 못했습니다. Android 17 이상에서 제목과
532
- 본문을 Now Bar에 보이려면 플러그인의 One UI extra를 켭니다.
533
-
534
- ```sh
535
- node -e 'f="src-tauri/tauri.conf.json";c=require("./"+f);((c.plugins??={})["live-activity"]??={}).android={samsungNowBar:true};require("fs").writeFileSync(f,JSON.stringify(c,null,2)+"\n")'
217
+ ```ts
218
+ await writeImage('badge.png', png); // Rust: app.live_activity().write_image("badge.png", &png)
219
+ lockScreen: image({ file: 'badge.png' }, { resizable: true }),
536
220
  ```
537
221
 
538
- | Galaxy S23, One UI 9(Android 17), 잠금 상태 |
539
- | --- |
540
- | <img src="https://raw.githubusercontent.com/1eedaegon/tauri-plugin-live-activity/main/docs/images/samsung-now-bar.png" width="400" alt="One UI Now Bar에 표시한 Mochi’s snack delivery와 On the way to Mochi"> |
541
-
542
- 데모의 Now Bar 예시(제목, 상태, 진행 막대에 `android: { visibility: 'public' }`)를 한 번 갱신한
543
- 뒤, 개발자 옵션을 켠 상태에서 캡처했습니다. extra를 켠다고 허용 목록에 오르지는 않습니다. Samsung이 `RON` 플래그 없이 앱을
544
- 목록에 넣었다면 아래 매니페스트 항목도 필요합니다. 플러그인은 이 항목을 추가하지 않습니다.
222
+ 직접 만든 뷰가 필요하면 `gen/apple/LiveActivityWidget/LiveActivityCustomViews.swift`에 SwiftUI로 쓰고 `custom`으로
223
+ 놓습니다. 이 파일은 `setup`이 한 번 만들고 다시는 덮어쓰지 않습니다.
545
224
 
546
- ```sh
547
- f=src-tauri/gen/android/app/src/main/AndroidManifest.xml; grep -q ongoing_activity $f || perl -0pi -e 's|<application\b[^>]*>|$&\n <meta-data android:name="com.samsung.android.support.ongoing_activity" android:value="true" />|' $f
225
+ ```ts
226
+ custom('ring', { props: { level: bind('done'), width: 4 } }),
548
227
  ```
549
228
 
550
- ## 플러그인 설정
551
-
552
- `tauri.conf.json`의 `plugins.live-activity`는 생략해도 됩니다.
553
-
554
- ```json
555
- { "plugins": { "live-activity": { "receipts": "redacted", "android": { "samsungNowBar": true } } } }
229
+ ```swift
230
+ "ring": LiveActivityCustomView { props in Ring(level: props.number("level") ?? 0) },
556
231
  ```
557
232
 
558
- - `receipts`: iOS는 수락한 요청마다 기록(receipt)을 남겨, 재실행 후에도 늦게 도착한
559
- ActivityKit 조회 결과가 이전 revision을 되살리지 못하게 합니다. 기본값 `full`은 snapshot과
560
- 그 텍스트를 저장합니다. `redacted`는 snapshot의 SHA-256 digest만 저장하는데, digest는 추측할
561
- 수 없는 값만 가려 줍니다. Android는 아직 이 옵션을 무시하고 앱 전용 preferences에 기록 전체를
562
- 저장합니다.
563
- - `android.samsungNowBar`: [Samsung Now Bar](#samsung-now-bar)의 extra를 붙입니다. 생략하면 꺼져 있습니다.
233
+ 뷰가 없는 이름은 아무것도 그리지 않고 `degradedFeatures`에 `layout.custom.ring`으로 남습니다. 마지막 수단은
234
+ 복사된 `LiveActivityWidget.swift`를 직접 고치는 것입니다. 그러면 `setup`은 그 파일을 그대로 두고, 템플릿이
235
+ 바뀐 부분은 직접 합쳐야 합니다.
564
236
 
565
- ## 데모 실행
237
+ 제한: Live Activity는 네트워크를 쓸 수 없고 메모리도 적습니다. 그린 PNG는 1 MiB, 1224 × 480 픽셀까지이고,
238
+ 이는 Apple의 가장 큰 잠금화면 크기를 @3x로 잰 값입니다. 글꼴은 확장 안에 있어야 합니다. 기기에서는 App
239
+ Group을 Apple 계정에 한 번 등록해야 하는데, 자동 서명이 대신 해 줍니다. 검증기는 커스텀 뷰의 이름과 props만
240
+ 보고 뷰 자체는 보지 않습니다. Android는 이 가운데 아무것도 그리지 않고, 처음 나오는 그린 그림만 알림의 큰
241
+ 아이콘이 됩니다. 레이아웃, 스타일, 값은 여전히 3584를 나눠 씁니다.
242
+ [자세히](https://github.com/1eedaegon/tauri-plugin-live-activity/blob/main/docs/usage.md#beyond-the-built-in-parts)
566
243
 
567
- <img src="https://raw.githubusercontent.com/1eedaegon/tauri-plugin-live-activity/main/docs/images/ios-demo-picker.png" width="300" alt="예시마다 칩이 하나씩 있는 데모의 Layouts 탭">
244
+ ## Samsung Now Bar
568
245
 
569
- 데모의 Layouts 탭에서 이 문서의 레이아웃 예시를 하나씩 시작할 수 있습니다. 모바일 도구를
570
- 설정한 뒤 저장소 루트에서 실행합니다.
246
+ `tauri.conf.json`에 `"plugins": { "live-activity": { "android": { "samsungNowBar": true } } }`를 넣으면
247
+ One UI 9의 Now Bar가 보여 줄 제목과 본문을 함께 보냅니다. 다만 One UI는 Samsung 허용 목록에 있는
248
+ 앱만 Now Bar에 띄우고(개발자 옵션 "Live notifications for all apps"를 켜면 모든 앱), 플러그인이 앱을
249
+ 그 목록에 넣을 수는 없습니다.
571
250
 
572
- ```sh
573
- npm ci && npm run build:demo && cd examples/demo && npm run tauri -- ios dev
574
- ```
251
+ ## 더 알아보기
575
252
 
576
- Android는 `android dev`를 씁니다. 요청 계약, 자세한 설정, 테스트 기록은
577
- [docs](https://github.com/1eedaegon/tauri-plugin-live-activity/tree/main/docs)에 있습니다.
253
+ 나머지는 [문서](https://github.com/1eedaegon/tauri-plugin-live-activity/tree/main/docs)에 있습니다.
254
+ `setup`이 바꾸는 내용과 손으로 설정하는 방법, iOS·Android 캡처가 붙은 레이아웃 노드 전체, Rust에서
255
+ 버튼을 처리하는 방법, 진행률·타이머 템플릿, 플러그인 옵션, 테스트 기록을 영어로 정리했습니다.
578
256
 
579
257
  ## 라이선스
580
258