tauri-plugin-live-activity 0.10.3 → 0.11.1
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 +10 -9
- package/README.md +13 -11
- package/dist-js/index.d.ts +8 -1
- package/dist-js/index.js +9 -0
- package/dist-js/types.d.ts +32 -1
- package/package.json +1 -1
package/README.ko.md
CHANGED
|
@@ -72,7 +72,7 @@ JSX이므로 레이아웃은 별도 파일에 둡니다.
|
|
|
72
72
|
import { Button, HStack, Progress, SFSymbol, Text, VStack } from 'tauri-plugin-live-activity/jsx';
|
|
73
73
|
|
|
74
74
|
// iOS: 잠금 화면이 이 트리를 그대로 그리고, 펼친 Dynamic Island에도 같은 트리가 보입니다
|
|
75
|
-
// (iOS 16.2 이상, Button은 iOS 17 이상).
|
|
75
|
+
// (iOS 16.2 이상, Button은 iOS 17.2 이상).
|
|
76
76
|
// Android: 알림이 처음 두 Text를 제목과 본문으로, 첫 Progress를 진행률 막대로, Button을 최대 세 개까지
|
|
77
77
|
// 동작으로 가져가고, 심볼과 스타일은 그리지 않습니다.
|
|
78
78
|
export const lockScreen = (
|
|
@@ -200,7 +200,7 @@ await endLayout({ id: snack.id, policy: { kind: 'immediate' } });
|
|
|
200
200
|
|
|
201
201
|
시작 요청에 `scheduled: { at, alert }`를 주면 나중에 시작하고(iOS 26과 Android. Android에서는 사용자가 정확한 알람을 허용해야 제시간에 시작하며, `openExactAlarmSettings()`가 그 설정 화면을 엽니다), `ios: { transient: true }`이면 일시적 액티비티가 됩니다(iOS 18). 레이아웃은 시작한 모습 그대로이고, 갱신마다 모든 값을 더 높은 revision으로 다시 보냅니다. 탭은
|
|
202
202
|
`onAction`으로, 푸시 토큰과 푸시된 내용은 `onPushToken`, `onPushToStartToken`, `onUpdated`로, 앱이 호출하지 않은
|
|
203
|
-
액티비티의 변화는 `onState`, `onStarted`, `onOpened`(Android: 액티비티의 알림으로 앱을 연 일. 앱을 실행시킨 열림도 페이지가 구독할 때까지 보관됩니다), `onPermissions
|
|
203
|
+
액티비티의 변화는 `onState`, `onStarted`, `onOpened`(Android: 액티비티의 알림으로 앱을 연 일. 앱을 실행시킨 열림도 페이지가 구독할 때까지 보관됩니다), `onPermissions`, `onUnknown`(Android: 액티비티에 대해 저장되어 있지만 이 버전이 이름을 모르는 이벤트)으로 옵니다.
|
|
204
204
|
|
|
205
205
|
스냅샷에는 `relevance`(앱의 여러 액티비티 중 Dynamic Island가 무엇을 보일지 정하는 점수)와 `android`
|
|
206
206
|
콘텐츠(레이아웃 투영 대신 Android 방식 그대로 쓰는 알림: 구간이 있는 진행 막대, 지표, 칩 텍스트)를 넣을 수
|
|
@@ -217,9 +217,9 @@ await endLayout({ id: snack.id, policy: { kind: 'immediate' } });
|
|
|
217
217
|
| `gauge` | `min`과 `max` 사이의 숫자를 고리나 막대로 | 예 | 아니오 |
|
|
218
218
|
| `progress` | 0~1의 숫자를 고리나 막대로 | 예 | 첫 번째가 알림의 진행률 막대 |
|
|
219
219
|
| `timerText` | `end`까지 내려가거나 `start`부터 올라가는 시간. 시스템이 셈 | 예 | 크로노미터 |
|
|
220
|
-
| `button` | `onAction` / `on_action`으로 오는 탭 | iOS 17 이상 | 최대 세 개의 동작 |
|
|
220
|
+
| `button` | `onAction` / `on_action`으로 오는 탭 | iOS 17.2 이상 | 최대 세 개의 동작 |
|
|
221
221
|
| `link` | 탭하면 그 URL을 앱에서 여는 노드 | 예 | URL을 여는 동작(기기가 `links`를 제공할 때) |
|
|
222
|
-
| `toggle` | 불리언 값을 보여 주는 스위치, 탭은 `on`으로 옴 | iOS 17 이상 | 레이블을 제목으로 한 동작, 켜진 동안 체크 표시 |
|
|
222
|
+
| `toggle` | 불리언 값을 보여 주는 스위치, 탭은 `on`으로 옴 | iOS 17.2 이상 | 레이블을 제목으로 한 동작, 켜진 동안 체크 표시 |
|
|
223
223
|
| `vstack`, `hstack`, `zstack`, `spacer`, `divider` | 배치 | 예 | 평평하게 |
|
|
224
224
|
| `custom` | 이름으로 고른 자체 SwiftUI 뷰 | 예 | 아니오 |
|
|
225
225
|
|
|
@@ -242,10 +242,11 @@ island: {
|
|
|
242
242
|
keyline: '#A3D9C2', // 아일랜드 테두리 색
|
|
243
243
|
```
|
|
244
244
|
|
|
245
|
-
페어링된 Apple Watch(iOS 18)와 CarPlay(iOS 26)
|
|
246
|
-
패밀리를 그리도록 해 두면(`setup --small-family`) `small`이 거기에 자기 트리를 줍니다. 노드는
|
|
247
|
-
버튼·링크·토글은 넣을 수 없습니다: `small: hstack([symbol('pawprint.fill'), bound('eta')])`.
|
|
248
|
-
|
|
245
|
+
iOS에서는 페어링된 Apple Watch(iOS 18)와 CarPlay(iOS 26)가 아일랜드의 compact 부분을 보여 줍니다. 위젯
|
|
246
|
+
익스텐션이 그 패밀리를 그리도록 해 두면(`setup --small-family`) `small`이 거기에 자기 트리를 줍니다. 노드는
|
|
247
|
+
12개까지이고 버튼·링크·토글은 넣을 수 없습니다: `small: hstack([symbol('pawprint.fill'), bound('eta')])`.
|
|
248
|
+
Android에서는 폰의 ongoing 알림이 페어링된 워치로 전달되지 않고 Live Update만 일부 워치에 전달되며, Android
|
|
249
|
+
Auto에는 이를 보여 줄 자리가 없습니다. Android는 `small`을 `degradedFeatures`에 적습니다. [더 보기](https://github.com/1eedaegon/tauri-plugin-live-activity/blob/main/docs/usage.md#a-watch-and-a-car)
|
|
249
250
|
|
|
250
251
|
## 푸시 (iOS)
|
|
251
252
|
|
|
@@ -266,7 +267,7 @@ keyline: '#A3D9C2', // 아일랜드 테두리 색
|
|
|
266
267
|
|
|
267
268
|
## 제약
|
|
268
269
|
|
|
269
|
-
- iOS: iOS 16.2의 iPhone 또는 iPadOS 17의 iPad, 버튼은 iOS 17부터. 액티비티는 앱이 전면일 때만 시작되고
|
|
270
|
+
- iOS: iOS 16.2의 iPhone 또는 iPadOS 17의 iPad, 버튼은 iOS 17.2부터. 액티비티는 앱이 전면일 때만 시작되고
|
|
270
271
|
(아니면 `NOT_FOREGROUND`), 시스템이 8시간 뒤 끝냅니다.
|
|
271
272
|
- iOS는 각 액티비티의 마지막 값을 앱의 Application Support에 평문으로 둡니다. 플러그인 설정에
|
|
272
273
|
`"receipts": "redacted"`를 주면 가립니다.
|
package/README.md
CHANGED
|
@@ -72,7 +72,7 @@ since this JSX has no HTML elements.
|
|
|
72
72
|
import { Button, HStack, Progress, SFSymbol, Text, VStack } from 'tauri-plugin-live-activity/jsx';
|
|
73
73
|
|
|
74
74
|
// iOS: the Lock Screen draws this tree as it is, and the expanded Dynamic Island shows it too
|
|
75
|
-
// (iOS 16.2+; the Button needs iOS 17).
|
|
75
|
+
// (iOS 16.2+; the Button needs iOS 17.2).
|
|
76
76
|
// Android: the notification takes the first two Texts as title and body, the first Progress as its
|
|
77
77
|
// bar and up to three Buttons as actions; symbols and styles are left out.
|
|
78
78
|
export const lockScreen = (
|
|
@@ -204,7 +204,8 @@ person allows exact alarms, where `openExactAlarmSettings()` takes them), and `i
|
|
|
204
204
|
activity (iOS 18). The layout stays as it started; each update sends every value again, with a higher revision. Taps come to
|
|
205
205
|
`onAction`, push tokens and pushed content to `onPushToken`, `onPushToStartToken` and `onUpdated`, and what happens
|
|
206
206
|
to an activity outside the app's calls to `onState`, `onStarted`, `onOpened` (Android: the person opened the app from an
|
|
207
|
-
activity's notification; the opening that launched the app waits for the page) and `
|
|
207
|
+
activity's notification; the opening that launched the app waits for the page), `onPermissions` and `onUnknown`
|
|
208
|
+
(Android: something stored for an activity that this version has no event for).
|
|
208
209
|
|
|
209
210
|
A snapshot may also carry a `relevance`, which decides which of the app's activities the Dynamic Island shows, and
|
|
210
211
|
an `android` content, the notification in Android's own terms (a segmented progress, metrics, the chip text) in
|
|
@@ -222,9 +223,9 @@ place of the projection of the layout; `updateLayout` takes an `alert`, which li
|
|
|
222
223
|
| `gauge` | a number between `min` and `max`, as a ring or a bar | yes | no |
|
|
223
224
|
| `progress` | a number from 0 to 1, as a ring or a bar | yes | the first one is the notification's bar |
|
|
224
225
|
| `timerText` | a count down to `end` or up from `start`, kept by the system | yes | the chronometer |
|
|
225
|
-
| `button` | a tap for `onAction` / `on_action` | iOS 17+ | up to three actions |
|
|
226
|
+
| `button` | a tap for `onAction` / `on_action` | iOS 17.2+ | up to three actions |
|
|
226
227
|
| `link` | a tap that opens its URL in the app | iOS | an action that opens the URL (where the device offers `links`) |
|
|
227
|
-
| `toggle` | a switch of a boolean value; a tap comes as `on` | iOS 17+ | an action titled by its label, with a check mark while on |
|
|
228
|
+
| `toggle` | a switch of a boolean value; a tap comes as `on` | iOS 17.2+ | an action titled by its label, with a check mark while on |
|
|
228
229
|
| `vstack`, `hstack`, `zstack`, `spacer`, `divider` | arrangement | yes | flattened |
|
|
229
230
|
| `custom` | a SwiftUI view of your own, by name | yes | no |
|
|
230
231
|
|
|
@@ -247,10 +248,11 @@ island: {
|
|
|
247
248
|
keyline: '#A3D9C2', // the island's edge color
|
|
248
249
|
```
|
|
249
250
|
|
|
250
|
-
|
|
251
|
-
their own, at most 12 nodes without buttons, links or toggles, once the widget extension draws that family
|
|
252
|
-
(`setup --small-family`): `small: hstack([symbol('pawprint.fill'), bound('eta')])`. Android
|
|
253
|
-
|
|
251
|
+
On iOS a paired Apple Watch (iOS 18) and CarPlay (iOS 26) show the island's compact parts. `small` gives them a
|
|
252
|
+
tree of their own, at most 12 nodes without buttons, links or toggles, once the widget extension draws that family
|
|
253
|
+
(`setup --small-family`): `small: hstack([symbol('pawprint.fill'), bound('eta')])`. On Android a phone's ongoing
|
|
254
|
+
notification is not bridged to a paired watch, and a Live Update only to some; Android Auto has no place for one.
|
|
255
|
+
Android names `small` in `degradedFeatures`. [More](https://github.com/1eedaegon/tauri-plugin-live-activity/blob/main/docs/usage.md#a-watch-and-a-car)
|
|
254
256
|
|
|
255
257
|
## Pushes (iOS)
|
|
256
258
|
|
|
@@ -271,14 +273,14 @@ at most 1 MiB and 1224 × 480 pixels. [More](https://github.com/1eedaegon/tauri-
|
|
|
271
273
|
|
|
272
274
|
## Limits
|
|
273
275
|
|
|
274
|
-
- iOS: an iPhone with iOS 16.2 or an iPad with iPadOS 17; buttons need iOS 17. An activity starts only while the
|
|
276
|
+
- iOS: an iPhone with iOS 16.2 or an iPad with iPadOS 17; buttons need iOS 17.2. An activity starts only while the
|
|
275
277
|
app is in the foreground (`NOT_FOREGROUND` otherwise), and the system ends it after 8 hours.
|
|
276
278
|
- iOS keeps each activity's last values in plain text in the app's Application Support, unless the plugin
|
|
277
279
|
configuration sets `"receipts": "redacted"`.
|
|
278
280
|
- A button's tap waits for the Rust `on_action` handlers, at most 4 seconds; JavaScript listeners are not awaited.
|
|
279
281
|
- Pushes are iOS only. Android shows an ongoing notification, promoted to a Live Update where the system allows it.
|
|
280
|
-
- Android
|
|
281
|
-
|
|
282
|
+
- From Android 15 a timer whose clock is more than 14 days old is refused with `INVALID_INPUT`: Android would show
|
|
283
|
+
nothing of such a notification and tell the app nothing.
|
|
282
284
|
- Keep the npm package and the crate on the same minor version.
|
|
283
285
|
|
|
284
286
|
## Samsung Now Bar
|
package/dist-js/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type UnlistenFn } from '@tauri-apps/api/event';
|
|
2
|
-
import type { ActionEvent, ActivityRecord, Capabilities, EndInput, LayoutActivityRecord, LayoutEndInput, LayoutStartInput, LayoutUpdateInput, OpenedEvent, PermissionKind, Permissions, PushToStartTokenEvent, PushTokenEvent, PushTokens, StartInput, StartedEvent, StateEvent, UpdateInput, UpdatedEvent } from './types.js';
|
|
2
|
+
import type { ActionEvent, ActivityRecord, Capabilities, EndInput, LayoutActivityRecord, LayoutEndInput, LayoutStartInput, LayoutUpdateInput, OpenedEvent, PermissionKind, Permissions, PushToStartTokenEvent, PushTokenEvent, PushTokens, StartInput, StartedEvent, StateEvent, UnknownEvent, UpdateInput, UpdatedEvent } from './types.js';
|
|
3
3
|
export type * from './types.js';
|
|
4
4
|
/** Builders for the nodes of a layout tree. */
|
|
5
5
|
export * as layout from './layout.js';
|
|
@@ -119,3 +119,10 @@ export declare function onOpened(handler: (event: OpenedEvent) => void): Promise
|
|
|
119
119
|
* frequent pushes. `checkPermissions` gives them at any time.
|
|
120
120
|
*/
|
|
121
121
|
export declare function onPermissions(handler: (permissions: Permissions) => void): Promise<UnlistenFn>;
|
|
122
|
+
/**
|
|
123
|
+
* Receive what Android stored for an activity and this version has no event for (Android). It names the activity
|
|
124
|
+
* and nothing else: liveupdate, which reads Android's stored events, knows no more of it. It comes when those
|
|
125
|
+
* events are of a later version of the plugin than the one that reads them, as after the app went back to an
|
|
126
|
+
* earlier version. Earlier versions of the plugin dropped such an event.
|
|
127
|
+
*/
|
|
128
|
+
export declare function onUnknown(handler: (event: UnknownEvent) => void): Promise<UnlistenFn>;
|
package/dist-js/index.js
CHANGED
|
@@ -288,3 +288,12 @@ export async function onOpened(handler) {
|
|
|
288
288
|
export function onPermissions(handler) {
|
|
289
289
|
return listen('live-activity://permissions', event => handler(event.payload));
|
|
290
290
|
}
|
|
291
|
+
/**
|
|
292
|
+
* Receive what Android stored for an activity and this version has no event for (Android). It names the activity
|
|
293
|
+
* and nothing else: liveupdate, which reads Android's stored events, knows no more of it. It comes when those
|
|
294
|
+
* events are of a later version of the plugin than the one that reads them, as after the app went back to an
|
|
295
|
+
* earlier version. Earlier versions of the plugin dropped such an event.
|
|
296
|
+
*/
|
|
297
|
+
export function onUnknown(handler) {
|
|
298
|
+
return listen('live-activity://unknown', event => handler(event.payload));
|
|
299
|
+
}
|
package/dist-js/types.d.ts
CHANGED
|
@@ -68,6 +68,12 @@ export interface AndroidPresentationSupport {
|
|
|
68
68
|
* takes the person to the setting that allows it.
|
|
69
69
|
*/
|
|
70
70
|
readonly exactStart: boolean;
|
|
71
|
+
/**
|
|
72
|
+
* Whether a notification carries a watch's Ongoing Activity, its icon on the watch face: on a watch below Wear
|
|
73
|
+
* OS 7 whose app has `androidx.wear:wear-ongoing`. False on a phone. A Tauri app has a web view, which Wear OS
|
|
74
|
+
* does not offer, so this is false wherever the plugin runs today.
|
|
75
|
+
*/
|
|
76
|
+
readonly wearOngoingActivity: boolean;
|
|
71
77
|
}
|
|
72
78
|
export interface Permissions {
|
|
73
79
|
readonly notifications: PermissionState;
|
|
@@ -254,6 +260,13 @@ export interface AndroidPresentation {
|
|
|
254
260
|
readonly accentColor?: number;
|
|
255
261
|
/** The third text of the header, at most 64 code points (`branding`). */
|
|
256
262
|
readonly subText?: string;
|
|
263
|
+
/**
|
|
264
|
+
* `false`: this snapshot's notification carries no Ongoing Activity of a watch, the icon on the watch face of a
|
|
265
|
+
* Wear OS app that has `androidx.wear:wear-ongoing`. Absent or `true`, it carries one where the device offers it
|
|
266
|
+
* (`wearOngoingActivity` in the capabilities) and the start did not turn it off (`android.wearOngoingActivity`).
|
|
267
|
+
* A phone carries none, whatever this says.
|
|
268
|
+
*/
|
|
269
|
+
readonly wearOngoingActivity?: boolean;
|
|
257
270
|
}
|
|
258
271
|
export type AndroidStyle = {
|
|
259
272
|
readonly kind: 'standard';
|
|
@@ -654,7 +667,7 @@ export type LayoutLinkNode = NodeFields & {
|
|
|
654
667
|
readonly child: LayoutNode;
|
|
655
668
|
};
|
|
656
669
|
/**
|
|
657
|
-
* A switch beside its label (iOS 17; before, the label alone). It shows the boolean value of `bind`. A tap comes
|
|
670
|
+
* A switch beside its label (iOS 17.2; before, the label alone). It shows the boolean value of `bind`. A tap comes
|
|
658
671
|
* through `onAction` with `on`, the state the person asked for, and does not move the switch: send an update with
|
|
659
672
|
* the new value, or none to refuse the change. A toggle stands where a button may.
|
|
660
673
|
*/
|
|
@@ -770,6 +783,13 @@ export interface LayoutAndroidOptions {
|
|
|
770
783
|
* answers `UNSUPPORTED_FEATURE`.
|
|
771
784
|
*/
|
|
772
785
|
readonly placement?: 'tagged' | 'foreground';
|
|
786
|
+
/**
|
|
787
|
+
* `false`: the activity carries no Ongoing Activity of a watch, in any of its snapshots. Absent or `true`, it
|
|
788
|
+
* carries one where the device offers it (`wearOngoingActivity` in the capabilities), and a start that says
|
|
789
|
+
* `true` is the same activity as one that says nothing. Anything but a boolean is `INVALID_INPUT`, on every
|
|
790
|
+
* platform.
|
|
791
|
+
*/
|
|
792
|
+
readonly wearOngoingActivity?: boolean;
|
|
773
793
|
}
|
|
774
794
|
/**
|
|
775
795
|
* What a layout activity asks ActivityKit for on iOS: a push token of its own, which `onPushToken` reports, or a
|
|
@@ -917,6 +937,17 @@ export interface ActionEvent {
|
|
|
917
937
|
*/
|
|
918
938
|
readonly on?: boolean;
|
|
919
939
|
}
|
|
940
|
+
/**
|
|
941
|
+
* Something that Android stored for an activity and this version has no event for (Android): liveupdate read what
|
|
942
|
+
* it knows of it, which is the activity. It comes when the stored events are of a later version of the plugin than
|
|
943
|
+
* the one that reads them, as after the app went back to an earlier version.
|
|
944
|
+
*/
|
|
945
|
+
export interface UnknownEvent {
|
|
946
|
+
/** Handle of the activity. */
|
|
947
|
+
readonly activityId: string;
|
|
948
|
+
/** The key of that activity, when the plugin knows it. */
|
|
949
|
+
readonly activityKey?: string;
|
|
950
|
+
}
|
|
920
951
|
/**
|
|
921
952
|
* The person opened the app from the notification of an activity (Android): by the notification itself, or by one
|
|
922
953
|
* of its actions that opens a URL. The app receives the URL as any deep link; this says which activity it came
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tauri-plugin-live-activity",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.1",
|
|
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",
|