tauri-plugin-live-activity 0.9.0 → 0.10.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 +2 -1
- package/cli/setup.mjs +6 -2
- package/dist-js/index.d.ts +18 -0
- package/dist-js/index.js +20 -0
- package/dist-js/types.d.ts +4 -2
- package/package.json +1 -1
package/README.ko.md
CHANGED
|
@@ -198,7 +198,7 @@ await updateLayout({ id: snack.id, snapshot: { revision: 1, values: { title: 'Mo
|
|
|
198
198
|
await endLayout({ id: snack.id, policy: { kind: 'immediate' } });
|
|
199
199
|
```
|
|
200
200
|
|
|
201
|
-
시작 요청에 `scheduled: { at, alert }`를 주면 나중에 시작하고(iOS 26과 Android), `ios: { transient: true }`이면 일시적 액티비티가 됩니다(iOS 18). 레이아웃은 시작한 모습 그대로이고, 갱신마다 모든 값을 더 높은 revision으로 다시 보냅니다. 탭은
|
|
201
|
+
시작 요청에 `scheduled: { at, alert }`를 주면 나중에 시작하고(iOS 26과 Android. Android에서는 사용자가 정확한 알람을 허용해야 제시간에 시작하며, `openExactAlarmSettings()`가 그 설정 화면을 엽니다), `ios: { transient: true }`이면 일시적 액티비티가 됩니다(iOS 18). 레이아웃은 시작한 모습 그대로이고, 갱신마다 모든 값을 더 높은 revision으로 다시 보냅니다. 탭은
|
|
202
202
|
`onAction`으로, 푸시 토큰과 푸시된 내용은 `onPushToken`, `onPushToStartToken`, `onUpdated`로, 앱이 호출하지 않은
|
|
203
203
|
액티비티의 변화는 `onState`, `onStarted`, `onOpened`(Android: 액티비티의 알림으로 앱을 연 일. 앱을 실행시킨 열림도 페이지가 구독할 때까지 보관됩니다), `onPermissions`로 옵니다.
|
|
204
204
|
|
package/README.md
CHANGED
|
@@ -199,7 +199,8 @@ await updateLayout({ id: snack.id, snapshot: { revision: 1, values: { title: 'Mo
|
|
|
199
199
|
await endLayout({ id: snack.id, policy: { kind: 'immediate' } });
|
|
200
200
|
```
|
|
201
201
|
|
|
202
|
-
A start may also carry `scheduled: { at, alert }` to begin later (iOS 26 and Android
|
|
202
|
+
A start may also carry `scheduled: { at, alert }` to begin later (iOS 26 and Android; on Android it is on the minute once the
|
|
203
|
+
person allows exact alarms, where `openExactAlarmSettings()` takes them), and `ios: { transient: true }` for a transient
|
|
203
204
|
activity (iOS 18). The layout stays as it started; each update sends every value again, with a higher revision. Taps come to
|
|
204
205
|
`onAction`, push tokens and pushed content to `onPushToken`, `onPushToStartToken` and `onUpdated`, and what happens
|
|
205
206
|
to an activity outside the app's calls to `onState`, `onStarted`, `onOpened` (Android: the person opened the app from an
|
package/cli/setup.mjs
CHANGED
|
@@ -12,10 +12,14 @@ export { SetupError } from './steps.mjs';
|
|
|
12
12
|
export const CRATE = 'tauri-plugin-live-activity';
|
|
13
13
|
/** The crate whose Swift package the widget extension and the app target link. */
|
|
14
14
|
export const ACTIVITYKIT = 'activitykit';
|
|
15
|
-
/**
|
|
15
|
+
/**
|
|
16
|
+
* `default` reads; the others allow the commands that change activities, and the two that ask the person: with
|
|
17
|
+
* Android's dialog, and in its setting for exact alarms.
|
|
18
|
+
*/
|
|
16
19
|
export const PERMISSIONS = [
|
|
17
20
|
'live-activity:default',
|
|
18
|
-
...['request-permissions', 'start', 'update', 'end', 'start-layout', 'update-layout', 'end-layout',
|
|
21
|
+
...['request-permissions', 'open-exact-alarm-settings', 'start', 'update', 'end', 'start-layout', 'update-layout', 'end-layout',
|
|
22
|
+
'write-image']
|
|
19
23
|
.map(command => `live-activity:allow-${command}`),
|
|
20
24
|
];
|
|
21
25
|
// The plugin's Android library needs API 26: Tauri's Jackson runtime fails below it.
|
package/dist-js/index.d.ts
CHANGED
|
@@ -9,6 +9,24 @@ export declare function getCapabilities(): Promise<Capabilities>;
|
|
|
9
9
|
export declare function checkPermissions(): Promise<Permissions>;
|
|
10
10
|
/** Request an OS permission where supported; settings-only controls report that state. */
|
|
11
11
|
export declare function requestPermissions(kind: PermissionKind): Promise<Permissions>;
|
|
12
|
+
/**
|
|
13
|
+
* Open Android's setting where the person allows the app exact alarms ("Alarms & reminders"), which a scheduled
|
|
14
|
+
* start needs to begin at its time, and resolve when they are back, with the capabilities as they are then:
|
|
15
|
+
* `androidPresentation.exactStart` says whether they allowed it. Call it when `exactStart` is false and the app
|
|
16
|
+
* schedules starts; where exact alarms are allowed already, or need no permission (before Android 12), it resolves
|
|
17
|
+
* at once and opens nothing.
|
|
18
|
+
*
|
|
19
|
+
* Android shows the setting only for an app whose own manifest declares `SCHEDULE_EXACT_ALARM`: where exact
|
|
20
|
+
* alarms are not allowed and the declaration is missing, the call rejects with `CONFIGURATION_REQUIRED`. It
|
|
21
|
+
* rejects with `NOT_FOREGROUND` while the app is not on screen, with `UNSUPPORTED_FEATURE` on a device without
|
|
22
|
+
* the setting and on iOS, which starts a scheduled activity itself, and with `UNSUPPORTED_PLATFORM` on desktop.
|
|
23
|
+
* A call that comes while the setting is open resolves with the first.
|
|
24
|
+
*
|
|
25
|
+
* The page may be gone when the person is back: Android may have closed it meanwhile, and it stops the app when
|
|
26
|
+
* the person takes the permission away. Read `getCapabilities()` when the page loads rather than rely on this
|
|
27
|
+
* promise alone. The command needs its own grant, `live-activity:allow-open-exact-alarm-settings`.
|
|
28
|
+
*/
|
|
29
|
+
export declare function openExactAlarmSettings(): Promise<Capabilities>;
|
|
12
30
|
/** Start an activity; repeated identical starts for an active key are idempotent. */
|
|
13
31
|
export declare function start(input: StartInput): Promise<ActivityRecord>;
|
|
14
32
|
/** Replace the entire snapshot with a newer revision. */
|
package/dist-js/index.js
CHANGED
|
@@ -14,6 +14,26 @@ export function checkPermissions() {
|
|
|
14
14
|
export function requestPermissions(kind) {
|
|
15
15
|
return invoke('plugin:live-activity|request_permissions', { kind });
|
|
16
16
|
}
|
|
17
|
+
/**
|
|
18
|
+
* Open Android's setting where the person allows the app exact alarms ("Alarms & reminders"), which a scheduled
|
|
19
|
+
* start needs to begin at its time, and resolve when they are back, with the capabilities as they are then:
|
|
20
|
+
* `androidPresentation.exactStart` says whether they allowed it. Call it when `exactStart` is false and the app
|
|
21
|
+
* schedules starts; where exact alarms are allowed already, or need no permission (before Android 12), it resolves
|
|
22
|
+
* at once and opens nothing.
|
|
23
|
+
*
|
|
24
|
+
* Android shows the setting only for an app whose own manifest declares `SCHEDULE_EXACT_ALARM`: where exact
|
|
25
|
+
* alarms are not allowed and the declaration is missing, the call rejects with `CONFIGURATION_REQUIRED`. It
|
|
26
|
+
* rejects with `NOT_FOREGROUND` while the app is not on screen, with `UNSUPPORTED_FEATURE` on a device without
|
|
27
|
+
* the setting and on iOS, which starts a scheduled activity itself, and with `UNSUPPORTED_PLATFORM` on desktop.
|
|
28
|
+
* A call that comes while the setting is open resolves with the first.
|
|
29
|
+
*
|
|
30
|
+
* The page may be gone when the person is back: Android may have closed it meanwhile, and it stops the app when
|
|
31
|
+
* the person takes the permission away. Read `getCapabilities()` when the page loads rather than rely on this
|
|
32
|
+
* promise alone. The command needs its own grant, `live-activity:allow-open-exact-alarm-settings`.
|
|
33
|
+
*/
|
|
34
|
+
export function openExactAlarmSettings() {
|
|
35
|
+
return invoke('plugin:live-activity|open_exact_alarm_settings', {});
|
|
36
|
+
}
|
|
17
37
|
/** Start an activity; repeated identical starts for an active key are idempotent. */
|
|
18
38
|
export function start(input) {
|
|
19
39
|
return invoke('plugin:live-activity|start', { input });
|
package/dist-js/types.d.ts
CHANGED
|
@@ -64,7 +64,8 @@ export interface AndroidPresentationSupport {
|
|
|
64
64
|
readonly scheduledStart: boolean;
|
|
65
65
|
/**
|
|
66
66
|
* Whether a scheduled start begins at its time: the app may set exact alarms. Without it Android chooses the
|
|
67
|
-
* moment: up to ten minutes late while the device is awake, an hour while it dozes.
|
|
67
|
+
* moment: up to ten minutes late while the device is awake, an hour while it dozes. `openExactAlarmSettings()`
|
|
68
|
+
* takes the person to the setting that allows it.
|
|
68
69
|
*/
|
|
69
70
|
readonly exactStart: boolean;
|
|
70
71
|
}
|
|
@@ -793,7 +794,8 @@ export interface LayoutIosOptions {
|
|
|
793
794
|
* A start at a later time instead of now: iOS 26, and Android where `getCapabilities().androidPresentation.scheduledStart`
|
|
794
795
|
* is true. Until then the record is `pending`: the activity holds its key, it can be ended, and an update is
|
|
795
796
|
* `CONFLICT`, since it begins with the content of its start. `onState` reports `active` when it begins. On Android
|
|
796
|
-
* it begins at its time with the permission for exact alarms (`exactStart`) and late without, by minutes
|
|
797
|
+
* it begins at its time with the permission for exact alarms (`exactStart`) and late without, by minutes;
|
|
798
|
+
* `openExactAlarmSettings()` takes the person to the setting that allows it. It is
|
|
797
799
|
* `UNSUPPORTED_FEATURE`, and nothing is kept, before iOS 26, with the foreground placement on Android, and where
|
|
798
800
|
* `scheduledStart` is false.
|
|
799
801
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tauri-plugin-live-activity",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.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",
|