tauri-plugin-live-activity 0.10.2 → 0.11.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 +1 -1
- package/README.md +4 -3
- package/dist-js/index.d.ts +8 -1
- package/dist-js/index.js +9 -0
- package/dist-js/types.d.ts +31 -0
- package/package.json +1 -1
package/README.ko.md
CHANGED
|
@@ -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 방식 그대로 쓰는 알림: 구간이 있는 진행 막대, 지표, 칩 텍스트)를 넣을 수
|
package/README.md
CHANGED
|
@@ -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
|
|
@@ -277,8 +278,8 @@ at most 1 MiB and 1224 × 480 pixels. [More](https://github.com/1eedaegon/tauri-
|
|
|
277
278
|
configuration sets `"receipts": "redacted"`.
|
|
278
279
|
- A button's tap waits for the Rust `on_action` handlers, at most 4 seconds; JavaScript listeners are not awaited.
|
|
279
280
|
- Pushes are iOS only. Android shows an ongoing notification, promoted to a Live Update where the system allows it.
|
|
280
|
-
- Android
|
|
281
|
-
|
|
281
|
+
- From Android 15 a timer whose clock is more than 14 days old is refused with `INVALID_INPUT`: Android would show
|
|
282
|
+
nothing of such a notification and tell the app nothing.
|
|
282
283
|
- Keep the npm package and the crate on the same minor version.
|
|
283
284
|
|
|
284
285
|
## 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';
|
|
@@ -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.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",
|