tauri-plugin-live-activity 0.14.0 → 0.15.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 CHANGED
@@ -52,9 +52,10 @@ TypeScript 또는 Rust로 적고, 그리는 일은 플러그인이 [liveactivity
52
52
  | --- | --- | --- |
53
53
  | iPhone | iOS 16.1 | 잠금 화면의 Live Activity, Dynamic Island가 있는 iPhone에서는 Dynamic Island에도. 오래된 표시(stale)와 relevance는 iOS 16.2부터, 버튼·토글·push-to-start는 iOS 17.2부터 |
54
54
  | iPad | iPadOS 17 | 잠금 화면의 같은 Live Activity |
55
+ | StandBy | iOS 17 | 옆으로 눕혀 충전하는 iPhone에서 크게 보이는 잠금 화면 카드, `ifFullscreen` 노드가 여기에만 보임 |
55
56
  | Apple Watch | iOS 18과 watchOS 11 | 레이아웃의 `small` 영역이 워치의 Smart Stack에 |
56
57
  | Android | Android 8.0 (API 26) | 진행률 막대나 타이머, 동작 최대 세 개가 있는 진행 중 알림. 알림 권한은 Android 13 (API 33)부터 묻습니다 |
57
- | Android Live Updates | Android 16 (API 36) | 시스템과 사용자 설정이 허락하면 승격된 Live Update, 아니면 진행 중 알림 |
58
+ | Android Live Updates | Android 16 (API 36) | 시스템과 사용자 설정이 허락하면 승격된 Live Update, 아니면 진행 중 알림; `openPromotionSettings()`가 그 설정을 엶 |
58
59
  | Samsung Now Bar | Android 17 (API 37), One UI 9 | One UI의 Now Bar가 보여 주는 제목과 본문. Samsung의 허용 목록에 있는 앱만 |
59
60
  | macOS, Windows, Linux | 지원 안 함 | 활동이 없고, 활동 명령은 `UNSUPPORTED_PLATFORM`을 돌려줍니다 |
60
61
 
@@ -263,13 +264,14 @@ await onAction(({ actionId, tap }) => {
263
264
  iOS에서는 `getCapabilities().ios`가 아이폰이 실행하는 기능(`pushToStart`, `pushChannels`, `transient`,
264
265
  `scheduledStart`, `smallFamily`)을 알려 주므로 요청을 시도해 보지 않아도 됩니다.
265
266
 
266
- Android에서는 시작에 `android: { visibility, publicVersion, placement, wearOngoingActivity, targets }`를 줍니다:
267
+ Android에서는 시작에 `android: { visibility, publicVersion, placement, wearOngoingActivity, localOnly, targets }`를 줍니다:
267
268
 
268
269
  ```ts
269
270
  android: {
270
271
  visibility: 'public', // 잠긴 기기에 보이는 정도: 'public', 'private', 'secret'
271
272
  placement: 'foreground', // 앱의 포그라운드 서비스가 쥐는 알림(`foregroundPlacement`)
272
273
  wearOngoingActivity: false, // 워치 화면에서 뺌(Wear OS 3~6, Tauri 앱은 워치에서 돌지 않음)
274
+ localOnly: true, // 페어링된 워치로 넘기지 말라고 Android에 요청(`localOnly`)
273
275
  // 버튼 `record`의 탭이 화면 없이 앱의 서비스를 바로 실행(`actionTargets`).
274
276
  targets: { record: { kind: 'foregroundService', component: 'com.example.RecorderService', action: 'com.example.RECORD' } },
275
277
  }
@@ -322,8 +324,8 @@ keyline: '#A3D9C2', // 아일랜드 테두리 색
322
324
  iOS에서는 페어링된 Apple Watch(iOS 18)와 CarPlay(iOS 26)가 아일랜드의 compact 부분을 보여 줍니다. 위젯
323
325
  익스텐션이 그 패밀리를 그리도록 해 두면(`setup --small-family`) `small`이 거기에 자기 트리를 줍니다. 노드는
324
326
  12개까지이고 버튼·링크·토글은 넣을 수 없습니다: `small: hstack([symbol('pawprint.fill'), bound('eta')])`.
325
- Android에서는 폰의 ongoing 알림이 페어링된 워치로 전달되지 않고 Live Update만 일부 워치에 전달되며, Android
326
- Auto에는 이를 보여 줄 자리가 없습니다. Android는 `small`을 `degradedFeatures`에 적습니다. [더 보기](https://github.com/1eedaegon/tauri-plugin-live-activity/blob/main/docs/usage.md#a-watch-and-a-car)
327
+ Android에서는 폰의 ongoing 알림이 페어링된 워치로 전달되지 않고 Live Update만 일부 워치에 전달됩니다.
328
+ `android: { localOnly: true }`는 그것도 하지 말라고 Android에 요청합니다. Android Auto에는 이를 보여 줄 자리가 없습니다. Android는 `small`을 `degradedFeatures`에 적습니다. [더 보기](https://github.com/1eedaegon/tauri-plugin-live-activity/blob/main/docs/usage.md#a-watch-and-a-car)
327
329
 
328
330
  잠금 화면의 카드에는 여백이 없고, 더 좁은 레이아웃은 가운데에 놓입니다. 루트에 padding을 주고, 가장자리에 붙일
329
331
  노드에는 `frame: { maxWidth: 'infinity', alignment: 'leading' }`인 스타일을 줍니다.
package/README.md CHANGED
@@ -52,9 +52,10 @@ In short: iOS 16.1+ and Android 8+, and no activities on desktop.
52
52
  | --- | --- | --- |
53
53
  | iPhone | iOS 16.1 | Live Activities on the Lock Screen and, on iPhones that have one, in the Dynamic Island. Stale dates and relevance from iOS 16.2; buttons, toggles and push-to-start from iOS 17.2 |
54
54
  | iPad | iPadOS 17 | The same Live Activities on the Lock Screen |
55
+ | StandBy | iOS 17 | The Lock Screen card scaled up on an iPhone that charges on its side, where nodes with `ifFullscreen` show |
55
56
  | Apple Watch | iOS 18 with watchOS 11 | A layout's `small` region in the watch's Smart Stack |
56
57
  | Android | Android 8.0 (API 26) | An ongoing notification with a progress bar or a timer and up to three actions; the notification permission is asked from Android 13 (API 33) |
57
- | Android Live Updates | Android 16 (API 36) | A promoted Live Update where the system and the person's settings allow one, the ongoing notification otherwise |
58
+ | Android Live Updates | Android 16 (API 36) | A promoted Live Update where the system and the person's settings allow one, the ongoing notification otherwise; `openPromotionSettings()` opens that setting |
58
59
  | Samsung Now Bar | Android 17 (API 37), One UI 9 | The title and body that One UI's Now Bar shows, for apps on Samsung's allow list |
59
60
  | macOS, Windows, Linux | not supported | No activities: the activity commands answer `UNSUPPORTED_PLATFORM` |
60
61
 
@@ -270,13 +271,14 @@ await onAction(({ actionId, tap }) => {
270
271
  On iOS `getCapabilities().ios` says what the iPhone runs (`pushToStart`, `pushChannels`, `transient`,
271
272
  `scheduledStart`, `smallFamily`), so a request need not be tried to learn it.
272
273
 
273
- On Android a start takes `android: { visibility, publicVersion, placement, wearOngoingActivity, targets }`:
274
+ On Android a start takes `android: { visibility, publicVersion, placement, wearOngoingActivity, localOnly, targets }`:
274
275
 
275
276
  ```ts
276
277
  android: {
277
278
  visibility: 'public', // what a locked device shows: 'public', 'private' or 'secret'
278
279
  placement: 'foreground', // the notification that the app's foreground service holds (`foregroundPlacement`)
279
280
  wearOngoingActivity: false, // off the face of a watch (Wear OS 3 to 6; a Tauri app does not run there)
281
+ localOnly: true, // ask Android not to bridge it to a paired watch (`localOnly`)
280
282
  // The button `record` runs the app's own service at once, with no screen (`actionTargets`).
281
283
  targets: { record: { kind: 'foregroundService', component: 'com.example.RecorderService', action: 'com.example.RECORD' } },
282
284
  }
@@ -331,8 +333,8 @@ keyline: '#A3D9C2', // the island's edge color
331
333
  On iOS a paired Apple Watch (iOS 18) and CarPlay (iOS 26) show the island's compact parts. `small` gives them a
332
334
  tree of their own, at most 12 nodes without buttons, links or toggles, once the widget extension draws that family
333
335
  (`setup --small-family`): `small: hstack([symbol('pawprint.fill'), bound('eta')])`. On Android a phone's ongoing
334
- notification is not bridged to a paired watch, and a Live Update only to some; Android Auto has no place for one.
335
- Android names `small` in `degradedFeatures`. [More](https://github.com/1eedaegon/tauri-plugin-live-activity/blob/main/docs/usage.md#a-watch-and-a-car)
336
+ notification is not bridged to a paired watch, and a Live Update only to some, which `android: { localOnly: true }`
337
+ asks Android not to do; Android Auto has no place for one. Android names `small` in `degradedFeatures`. [More](https://github.com/1eedaegon/tauri-plugin-live-activity/blob/main/docs/usage.md#a-watch-and-a-car)
336
338
 
337
339
  On the Lock Screen the card has no margin and shows a narrower layout in its middle: give the root a padding, and a
338
340
  node that should reach an edge a style with `frame: { maxWidth: 'infinity', alignment: 'leading' }`.
package/cli/setup.mjs CHANGED
@@ -11,13 +11,13 @@ export const CRATE = 'tauri-plugin-live-activity';
11
11
  /** The crate whose Swift package the widget extension and the app target link. */
12
12
  export const ACTIVITYKIT = 'activitykit';
13
13
  /**
14
- * `default` reads; the others allow the commands that change activities, and the two that ask the person: with
15
- * Android's dialog, and in its setting for exact alarms.
14
+ * `default` reads; the others allow the commands that change activities, and the three that ask the person: with
15
+ * Android's dialog, in its setting for exact alarms, and in its screen of Live Updates.
16
16
  */
17
17
  export const PERMISSIONS = [
18
18
  'live-activity:default',
19
- ...['request-permissions', 'open-exact-alarm-settings', 'start', 'update', 'end', 'start-layout', 'update-layout', 'end-layout',
20
- 'write-image']
19
+ ...['request-permissions', 'open-exact-alarm-settings', 'open-promotion-settings', 'start', 'update', 'end', 'start-layout',
20
+ 'update-layout', 'end-layout', 'write-image']
21
21
  .map(command => `live-activity:allow-${command}`),
22
22
  ];
23
23
  // The plugin's Android library needs API 26: Tauri's Jackson runtime fails below it.
@@ -27,6 +27,19 @@ export declare function requestPermissions(kind: PermissionKind): Promise<Permis
27
27
  * promise alone. The command needs its own grant, `live-activity:allow-open-exact-alarm-settings`.
28
28
  */
29
29
  export declare function openExactAlarmSettings(): Promise<Capabilities>;
30
+ /**
31
+ * Ask Android for the screen where the person allows or stops the app's Live Updates (Android 16 and later), or for
32
+ * the app's notification settings before that: for an app whose `checkPermissions()` reads
33
+ * `promotion: 'settingsRequired'`, Android having no dialog for them. That state is also a channel that the person
34
+ * set to Minimized, which is changed in the app's notification settings.
35
+ * Android starts it only while the app is in the foreground and drops it otherwise without a word, so call it from
36
+ * a person's tap. It resolves once Android was asked, not when the screen shows, and does not wait for the person:
37
+ * read `checkPermissions()` again when the page is back in view.
38
+ *
39
+ * It rejects with `UNSUPPORTED_FEATURE` on iOS and on a device without such a screen, and with
40
+ * `UNSUPPORTED_PLATFORM` on desktop. The command needs its own grant, `live-activity:allow-open-promotion-settings`.
41
+ */
42
+ export declare function openPromotionSettings(): Promise<void>;
30
43
  /** Start an activity; repeated identical starts for an active key are idempotent. */
31
44
  export declare function start(input: StartInput): Promise<ActivityRecord>;
32
45
  /** Replace the entire snapshot with a newer revision. */
@@ -76,8 +89,8 @@ export declare function pushTokens(): Promise<PushTokens>;
76
89
  */
77
90
  export declare function onPushToken(handler: (event: PushTokenEvent) => void): Promise<UnlistenFn>;
78
91
  /**
79
- * Receive the app's push-to-start token, with `pushToStart: true` in the plugin configuration (iOS 17.2), when the
80
- * system gives it and each time it changes, and first the one the plugin already holds, each token once. The server
92
+ * Receive the app's push-to-start token, with `pushToStart: true` in the plugin configuration (iOS 17.2): the token the
93
+ * app has at each launch and each new one, and first the one the plugin already holds, each token once. The server
81
94
  * starts activities with it. Rejects, subscribed to nothing, when the plugin cannot be asked for the token it holds.
82
95
  */
83
96
  export declare function onPushToStartToken(handler: (event: PushToStartTokenEvent) => void): Promise<UnlistenFn>;
package/dist-js/index.js CHANGED
@@ -34,6 +34,21 @@ export function requestPermissions(kind) {
34
34
  export function openExactAlarmSettings() {
35
35
  return invoke('plugin:live-activity|open_exact_alarm_settings', {});
36
36
  }
37
+ /**
38
+ * Ask Android for the screen where the person allows or stops the app's Live Updates (Android 16 and later), or for
39
+ * the app's notification settings before that: for an app whose `checkPermissions()` reads
40
+ * `promotion: 'settingsRequired'`, Android having no dialog for them. That state is also a channel that the person
41
+ * set to Minimized, which is changed in the app's notification settings.
42
+ * Android starts it only while the app is in the foreground and drops it otherwise without a word, so call it from
43
+ * a person's tap. It resolves once Android was asked, not when the screen shows, and does not wait for the person:
44
+ * read `checkPermissions()` again when the page is back in view.
45
+ *
46
+ * It rejects with `UNSUPPORTED_FEATURE` on iOS and on a device without such a screen, and with
47
+ * `UNSUPPORTED_PLATFORM` on desktop. The command needs its own grant, `live-activity:allow-open-promotion-settings`.
48
+ */
49
+ export function openPromotionSettings() {
50
+ return invoke('plugin:live-activity|open_promotion_settings', {});
51
+ }
37
52
  /** Start an activity; repeated identical starts for an active key are idempotent. */
38
53
  export function start(input) {
39
54
  return invoke('plugin:live-activity|start', { input });
@@ -121,8 +136,8 @@ export async function onPushToken(handler) {
121
136
  return unlisten;
122
137
  }
123
138
  /**
124
- * Receive the app's push-to-start token, with `pushToStart: true` in the plugin configuration (iOS 17.2), when the
125
- * system gives it and each time it changes, and first the one the plugin already holds, each token once. The server
139
+ * Receive the app's push-to-start token, with `pushToStart: true` in the plugin configuration (iOS 17.2): the token the
140
+ * app has at each launch and each new one, and first the one the plugin already holds, each token once. The server
126
141
  * starts activities with it. Rejects, subscribed to nothing, when the plugin cannot be asked for the token it holds.
127
142
  */
128
143
  export async function onPushToStartToken(handler) {
@@ -1,6 +1,7 @@
1
1
  // Layout components for TSX. Each returns the plain node object of its `layout` builder; nothing here
2
2
  // imports Tauri or React, so a server can build the same layout. Every component takes the members any node
3
- // may carry as props: `style`, `if` or `unless`, `ifStale`, `accessibility`, `transition` and `privacy`.
3
+ // may carry as props: `style`, `if` or `unless`, `ifStale`, `ifFullscreen`, `accessibility`, `transition` and
4
+ // `privacy`.
4
5
  import { bound, button, custom, divider, gauge, hstack, image, link, path, progress, spacer, symbol, text, timerText, toggle, vstack, zstack, } from '../layout.js';
5
6
  export { bind } from '../layout.js';
6
7
  /** Children from top to bottom. */
package/dist-js/layout.js CHANGED
@@ -3,8 +3,8 @@ function given(options) {
3
3
  return Object.fromEntries(Object.entries(options ?? {}).filter(([, value]) => value !== undefined));
4
4
  }
5
5
  // The builders return plain node objects. They do not validate: the plugin checks the whole request. The options
6
- // of every builder take the members any node may carry: `style`, `if` or `unless`, `ifStale`, `accessibility`,
7
- // `transition` and `privacy`.
6
+ // of every builder take the members any node may carry: `style`, `if` or `unless`, `ifStale`, `ifFullscreen`,
7
+ // `accessibility`, `transition` and `privacy`.
8
8
  /** Children from top to bottom. */
9
9
  export function vstack(children, options) {
10
10
  return { type: 'vstack', children, ...given(options) };
@@ -85,6 +85,12 @@ export interface AndroidPresentationSupport {
85
85
  * `UNSUPPORTED_FEATURE` and posts nothing.
86
86
  */
87
87
  readonly actionTargets: boolean;
88
+ /**
89
+ * Whether an activity can ask to stay off a paired watch (a start's `android.localOnly`, an Android content's
90
+ * `presentation.localOnly`). Where it is false such a start or update answers `UNSUPPORTED_FEATURE` and posts
91
+ * nothing.
92
+ */
93
+ readonly localOnly: boolean;
88
94
  }
89
95
  /** What an iPhone runs of the features after the first Live Activities. */
90
96
  export interface IosSupport {
@@ -294,6 +300,13 @@ export interface AndroidPresentation {
294
300
  * A phone carries none, whatever this says.
295
301
  */
296
302
  readonly wearOngoingActivity?: boolean;
303
+ /**
304
+ * `true`: this snapshot's notification asks Android not to bridge it to a paired watch (`setLocalOnly`). A copy
305
+ * that a watch got of an earlier snapshot stays there, so set it from the start (`android.localOnly`). Absent,
306
+ * it may be sent to the watch unless the start keeps the activity off it. A device that does not offer it
307
+ * (`localOnly` in the capabilities) answers `UNSUPPORTED_FEATURE` and posts nothing.
308
+ */
309
+ readonly localOnly?: boolean;
297
310
  }
298
311
  export type AndroidStyle = {
299
312
  readonly kind: 'standard';
@@ -568,6 +581,15 @@ type NodeFields = {
568
581
  * Android draws the layout as it is while fresh and names `layout.ifStale` in `degradedFeatures`.
569
582
  */
570
583
  readonly ifStale?: boolean;
584
+ /**
585
+ * `true`: the node and its subtree are drawn only while the Lock Screen presentation fills the screen, in StandBy
586
+ * on an iPhone that charges on its side (iOS 17); `false`: only while it does not. Beside the other conditions the
587
+ * node is drawn while all hold. The island's parts and the small family are never full screen, and neither is an
588
+ * Android notification: Android leaves out a node of `true` and draws one of `false`, and names nothing. The widget
589
+ * extension needs activitykit 0.9.0, which `setup` points it at: one built with an earlier activitykit draws such a
590
+ * node always.
591
+ */
592
+ readonly ifFullscreen?: boolean;
571
593
  /** What assistive technologies read of the node. */
572
594
  readonly accessibility?: LayoutAccessibility;
573
595
  /** How the node comes and goes when its `if` or `unless` shows or hides it. Without it the system chooses. */
@@ -833,6 +855,12 @@ export interface LayoutAndroidOptions {
833
855
  * platform.
834
856
  */
835
857
  readonly wearOngoingActivity?: boolean;
858
+ /**
859
+ * `true`: every snapshot of the activity asks Android not to bridge it to a paired watch (`setLocalOnly`),
860
+ * whatever an Android content says. Absent, it may be sent to the watch. A device that does not offer it (`localOnly` in the
861
+ * capabilities) answers `UNSUPPORTED_FEATURE` and posts nothing; iOS ignores it.
862
+ */
863
+ readonly localOnly?: boolean;
836
864
  /**
837
865
  * What runs the tap of a button or a toggle of the lock screen tree, by its `actionId`: a service or a receiver
838
866
  * of the app (`actionTargets`). Each key names a control of the tree, else `INVALID_INPUT` on every platform. iOS
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tauri-plugin-live-activity",
3
- "version": "0.14.0",
3
+ "version": "0.15.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",