본문 바로가기

Siri, Shortcuts, 위젯, 시스템 인텐트

Expo가 최근 출시한 expo-app-intents는 Apple의 App Intents를 framework를 JavaScript와 연결합니다: Siri 및 Shortcuts 구문, 런타임 엔티티 카탈로그, Apple Intelligence용 Apple 앱 스키마, Spotlight 인덱싱, 그리고 JavaScript가 시작되기 전에 도착하는 호출을 위한 네이티브 큐.

@capgo/capacitor-app-intents 는 Apple용 Capacitor 브리지입니다 App Intents를: Siri 및 Shortcuts 구문(컴파일 타임 codegen), 런타임 엔티티 카탈로그, Spotlight 인덱싱, 홈 화면 퀵 액션, 그리고 콜드 스타트를 위한 대기 호출 큐를 제공합니다. Widget Kit, Live Activities, Share Target, Intent Launcher는 여전히 인접한 영역을 커버합니다. 이 페이지에서는 이들이 어떻게 맞물리는지, Android와 혼용하지 않고 시스템 통합을 배포할 수 있도록 설명합니다. Intent Apple App Intents를 활용한 API.

한눈에 보기

“Quick map” 섹션
시스템 영역Capgo 플러그인을 설치하세요.플러그인이 실제로 하는 일
홈 화면 위젯, 잠금 화면 Live Activities, Dynamic Island (SVG 또는 네이티브 위젯 code)@capgo/capacitor-widget-kit템플릿 액티비티 유지, 선언적 액션 실행, 위젯 또는 Live Activity 탭 로그 기록, App Groups를 통한 완전 네이티브 위젯 세션 동기화.
JSON 레이아웃 트리를 활용한 Live Activities@capgo/capacitor-live-activitiesCapacitor에서 ActivityKit 액티비티 시작, 업데이트, 종료; 타이머 시퀀스; App Group 내 이미지 공유.
다른 앱에서 공유 받기@capgo/capacitor-share-targetshareReceived Android intent 또는 iOS Share Extension과 App Group을 통해 제목, 텍스트, 파일에 대한 이벤트를 받습니다.
Android 설정 또는 액티비티 열기; iOS 설정 URL 열기@capgo/capacitor-intent-launcherstartActivityAsync, openIOSSettings, openApplication. 이는 하지 마세요 Apple App Intents입니다.
Siri 문구, Shortcuts, Spotlight, 빠른 동작, App Intent 대기열@capgo/capacitor-app-intents브릿지 디스패치, setEntityCatalog, indexSpotlightEntities, setHomeScreenShortcutItems, getPendingInvocations, useAppIntentsListener. iOS 16 이상.
온디바이스 LLM (지원되는 iPhone의 Apple Intelligence)@capgo/capacitor-llm채팅 및 모델 API. App Intent 또는 스키마 브리지 없음.

expo-app-intents와의 비교

“expo-app-intents와의 비교” 섹션

동등성 평가 시 이 표를 사용하세요. 표시된 행은 부분 으로, 일부 영역만 겹친다는 뜻입니다.

expo-app-intents 기능현재 Capgo
음성 구문을 사용한 Siri 및 Shortcuts 앱의 커스텀 액션지원 포함 @capgo/capacitor-app-intents. 문구는 컴파일 타임 리터럴 생성된 Swift(AppShortcutsProvider)에 있으며, 런타임 JavaScript 문자열이 아닙니다.
JS 엔티티 카탈로그(AppEntity, EntityQuery)지원 포함 @capgo/capacitor-app-intents 을 통해 setEntityCatalog() 및 네이티브 EntityQuery 연결.
Apple 앱 스키마 (예: Apple Intelligence용 메일 초안 인텐트)부분 지원. App Intents가 노출하는 performAppleSchemaTemplate 하나의 JavaScript 큐만 (네이티브 메일 API 없음). 앱에서 작성 UI나 딥 링크를 구현해야 합니다.
Spotlight 인덱싱 및 검색 가능한 앱 콘텐츠지원 포함 @capgo/capacitor-app-intents 을 통해 indexSpotlightEntities() (CSSearchableItem, 그리고 IndexedEntity iOS 18 이상에서 지원).
시스템 인텔리전스를 위해 화면 콘텐츠를 엔티티와 연결부분 지원. 엔티티 카탈로그는 Shortcuts 파라미터의 기반이 되지만, 전체 화면 연결 API는 아직 노출되지 않았습니다.
JavaScript가 준비되기 전에 실행되는 액션을 위한 네이티브 큐지원 를 통한 App Intents 지원 @capgo/capacitor-app-intents (getPendingInvocations, appIntentInvoked). Share Target 및 Widget Kit은 여전히 공유 및 템플릿 이벤트를 위해 자체 유지 모델을 사용합니다.
App Intents를 통한 대화형 Live Activity 또는 위젯 버튼부분 지원. Widget Kit 포함 CapgoTemplateActionIntent 및 CompleteSetIntent 로 LiveActivityIntent 타입 템플릿 iOS 17+의 핫스팟 및 워크아웃 액션입니다. 네이티브 상태와 이벤트 로그를 업데이트하지만, JavaScript에서 임의의 Siri 구문을 노출하지 않습니다.
앱 JavaScript에서 WidgetKit 및 ActivityKit네. Widget Kit 및 Live Activities 플러그인(아래 참조).
Android Intent 액션(설정, VIEW, SEND 등)지원 Intent Launcher와 Share Target을 통해 실행 및 수신하는 데 사용됩니다.

Widget Kit: 위젯, Live Activities, 템플릿 액션

섹션 제목: “Widget Kit: 위젯, Live Activities, 템플릿 액션”

@capgo/capacitor-widget-kit 가장 가까운 매칭은 시스템 가시성 UI WebView 외부입니다. Capacitor에서 잠금 화면과 Dynamic Island 표면을 제어하고, SVG 템플릿 또는 네이티브 Swift/Kotlin code으로 홈 화면 위젯을 렌더링하며, 탭 이벤트를 사후 처리할 수 있습니다.

템플릿 Live Activity를 시작하고 JavaScript로 액션 처리하기

섹션 제목: “템플릿 Live Activity 시작 및 JavaScript에서 액션 처리”

앱 부팅 시 리스너를 등록한 후, 다음을 폴링하거나 호출합니다 App WebView가 아직 로딩 중일 때 위젯 탭이 실행될 수 있으므로 resume 시:

import { App } from '@capacitor/app';
import { CapgoWidgetKit } from '@capgo/capacitor-widget-kit';
const ACTIVITY_ID = 'order-tracker';
async function drainTemplateEvents() {
const { events } = await CapgoWidgetKit.listTemplateEvents({
activityId: ACTIVITY_ID,
unacknowledgedOnly: true,
});
for (const event of events) {
if (event.actionId === 'mark-delivered') {
// Update your app state from event.state or event.payload
}
await CapgoWidgetKit.acknowledgeTemplateEvents({
eventIds: [event.eventId],
});
}
}
await CapgoWidgetKit.startTemplateActivity({
activityId: ACTIVITY_ID,
state: { status: 'On the way' },
definition: {
id: 'delivery-card',
actions: [
{
id: 'mark-delivered',
eventName: 'delivery.marked',
},
],
layouts: {
lockScreen: {
width: 200,
height: 80,
svg: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 80"><text x="8" y="40">{{state.status}}</text></svg>',
hotspots: [
{
id: 'deliver',
actionId: 'mark-delivered',
x: 120,
y: 20,
width: 70,
height: 40,
label: 'Mark delivered',
},
],
},
},
},
});
App.addListener('resume', () => {
void drainTemplateEvents();
});
void drainTemplateEvents();

iOS에서 위젯 확장 내 인터랙티브 컨트롤은 번들된 CapgoTemplateActionIntent (LiveActivityIntent). 해당 경로는 저장된 템플릿 상태를 업데이트하고, JavaScript가 읽는 동일한 이벤트 로그에 항목을 추가합니다. 이는 하지 마세요 Shortcuts 앱에서 사용자 표시용 Shortcut 문구를 추가하는 것과 동일합니다.

자세한 내용은 Widget Kit 시작하기 App Group 설정 및 완전 네이티브 위젯 세션에 대해.

Live Activities: Capacitor 기반 JSON 레이아웃

“Live Activities: Capacitor에서 가져온 JSON 레이아웃” 섹션

@capgo/capacitor-live-activities 에 초점을 맞춥니다 ActivityKit 선언적 레이아웃 JSON(텍스트, 이미지, 타이머, 게이지, Dynamic Island 영역)을 지원합니다. App Intents나 Siri 단축方式是 등록하지 않습니다.

import { CapgoLiveActivities } from '@capgo/capacitor-live-activities';
const { supported } = await CapgoLiveActivities.areActivitiesSupported();
if (!supported) {
return;
}
const { activityId } = await CapgoLiveActivities.startActivity({
layout: {
type: 'container',
direction: 'vertical',
children: [
{ type: 'text', content: 'Order {{orderId}}', fontWeight: 'bold' },
{ type: 'text', content: '{{status}}' },
],
},
data: { orderId: '42', status: 'Preparing' },
});
await CapgoLiveActivities.updateActivity({
activityId,
data: { orderId: '42', status: 'Out for delivery' },
});

선택 Live Activities 레이아웃 DSL과 이미지 헬퍼가 필요할 때 선택하세요. 위젯 키트 홈 화면 위젯, SVG 프레임 또는 템플릿 이벤트 로그와 LiveActivityIntent 버튼이 필요할 때

Share Target: 수신 공유 (Shortcuts 송신 제외)

“Share Target: incoming shares (not outgoing Shortcuts)” 섹션

@capgo/capacitor-share-target 다른 앱이 콘텐츠를 앱으로 보내도록 합니다. iOS에서는 App Group에 쓰는 Share Extension을 추가합니다. 메인 앱 플러그인이 해당 페이로드를 읽고 비운 뒤 다음을 emit합니다: shareReceived.

iOS에서는 콜드 스타트를 처리합니다. 네이티브 플러그인이 호출하는 대상: notifyListeners(..., retainUntilConsumed: true) 첫 번째 JavaScript 리스너가 여전히 이벤트를 수신할 수 있도록 합니다.

import { CapacitorShareTarget } from '@capgo/capacitor-share-target';
await CapacitorShareTarget.addListener('shareReceived', (event) => {
const firstText = event.texts[0] ?? '';
const firstFile = event.files[0];
console.log(event.title, firstText, firstFile?.uri);
});

이것은 Android의 SEND intent filters를 보완합니다. 이 플러그인은 하지 마세요 앱에서 공유 단축키나 Siri 액션을 게시하지 않습니다.

Intent Launcher: Android intents, iOS Settings (App Intents 제외)

섹션 제목: “Intent Launcher: Android intents와 iOS 설정 (App Intents 아님)”

이름이 Apple의 App Intents를. @capgo/capacitor-intent-launcher App Intents와 혼동하기 쉽습니다. 이 플러그인은 오직 Android activity(포함 ActivityAction.CREATE_SHORTCUT 레거시 런처 단축어용) 및 열기 iOS 설정 URL scheme.

import { IntentLauncher, ActivityAction, IOSSettings } from '@capgo/capacitor-intent-launcher';
await IntentLauncher.startActivityAsync({
action: ActivityAction.WIFI_SETTINGS,
});
await IntentLauncher.openIOSSettings({ option: IOSSettings.App });

Siri, 단축어 앱 및 AppIntent 유형에는 다음을 사용하세요. @capgo/capacitor-app-intents. Intent Launcher는 Android activity와 iOS Settings URL만 실행합니다.

목표여기서 시작
SVG 및 탭 로깅을 활용한 잠금 화면 및 Dynamic Island위젯 키트
풍부한 레이아웃 JSON 및 타이머 시퀀스Live Activities
사용자가 링크나 파일을 앱으로 공유공유 대상
Wi-Fi 또는 앱 설정으로 딥 링크인텐트 런처
엔티티 매개변수와 함께 JS 핸들러를 실행하는 Siri 구문App Intents를 (구문용 codegen, setEntityCatalog, useAppIntentsListener)
영역상태
Widget Kit 커스텀 AppShortcut 템플릿 이벤트 로그에 연결된 구문Widget Kit은 여전히 번들링 LiveActivityIntent 헬퍼만 포함합니다. 임의의 Siri 구문은 App Intents 코드 생성에 속합니다.
Share Target 폴링 API현재는 이벤트만 지원하며, 사용 addListener('shareReceived') 부팅 시 초기에.
네이티브 Apple Mail 스키마 인텐트서드파티 앱에서는 사용할 수 없습니다. App Intents는 대신 JS 핸들러를 큐에 넣습니다.
Android App Intents 호환성App Intents는 iOS 16 이상에서만 지원되며, Android에서는 명확한 오류를 반환합니다.