시작하기
이 플러그인의 설치 단계와 전체 마크다운 가이드가 포함된 설정 프롬프트를 복사하세요.
Set up this Capacitor plugin in the project.
Use the package manager already used by the project.
Install these package(s): `@capgo/capacitor-alarm`
Run the required Capacitor sync/update step after installation.
Read this markdown guide for the full setup steps: https://raw.githubusercontent.com/Cap-go/website/refs/heads/main/apps/docs/src/content/docs/docs/plugins/alarm/getting-started.mdx
Use that guide for platform-specific steps, native file edits, permissions, config changes, imports, and usage setup.
If that guide references other docs pages, read them too.
AI-Assisted Setup으로 플러그인을 설치할 수 있습니다. 다음 명령어로 AI 도구에 Capgo 스킬을 추가하세요:
npx skills add https://github.com/Cap-go/capgo-skills --skill capacitor-plugins그런 다음 아래 프롬프트를 사용하세요:
Use the `capacitor-plugins` skill from `Cap-go/capgo-skills` to install the `@capgo/capacitor-alarm` plugin in my project.수동 설정을 선호한다면, 다음 명령어를 실행하여 플러그인을 설치하고 아래의 플랫폼별 지침을 따르세요:
bun add @capgo/capacitor-alarmnpx cap sync가져오기
“Import” 섹션import { CapgoAlarm } from '@capgo/capacitor-alarm';빠른 시작
“빠른 시작” 섹션import { CapgoAlarm } from '@capgo/capacitor-alarm';
const result = await CapgoAlarm.createAlarm({ hour: 7, minute: 30, label: 'Wake up', skipUi: false, vibrate: true});console.log('Alarm created:', result.success);예제: openAlarms
“예제: openAlarms” 제목의 섹션import { CapgoAlarm } from '@capgo/capacitor-alarm';
const result = await CapgoAlarm.openAlarms();if (result.success) { console.log('Alarms UI opened');}예제: getOSInfo
“예제: getOSInfo” 제목의 섹션import { CapgoAlarm } from '@capgo/capacitor-alarm';
const info = await CapgoAlarm.getOSInfo();console.log('Platform:', info.platform);console.log('Supports native alarms:', info.supportsNativeAlarms);if (info.platform === 'android') { console.log('Can schedule exact alarms:', info.canScheduleExactAlarms);}자주 하는 실수
“흔한 실수” 섹션- 권한: 호출
checkPermissions()그다음requestPermissions()필요할 때. - 네이티브 동기화: 실행
npx cap sync플러그인 업그레이드 후. - 신뢰할 수 있는 소스: 신뢰
src/definitions.tsGitHub 레포지토리에서.
API 개요
“API 개요” 섹션createAlarm
“createAlarm” 섹션플랫폼의 시계 앱을 사용하여 네이티브 OS 알람을 생성합니다. Android에서는 Alarm Clock intent를 사용하며, iOS에서는 사용 가능한 경우(iOS 16+) AlarmKit을 사용합니다.
import { CapgoAlarm } from '@capgo/capacitor-alarm';
const result = await CapgoAlarm.createAlarm({ hour: 7, minute: 30, label: 'Wake up', skipUi: false, vibrate: true});console.log('Alarm created:', result.success);openAlarms
“openAlarms” 섹션사용 가능한 경우 플랫폼의 네이티브 알람 목록 UI를 엽니다.
import { CapgoAlarm } from '@capgo/capacitor-alarm';
const result = await CapgoAlarm.openAlarms();if (result.success) { console.log('Alarms UI opened');}getOSInfo
“getOSInfo” 섹션OS 및 기능에 대한 정보를 가져옵니다.
import { CapgoAlarm } from '@capgo/capacitor-alarm';
const info = await CapgoAlarm.getOSInfo();console.log('Platform:', info.platform);console.log('Supports native alarms:', info.supportsNativeAlarms);if (info.platform === 'android') { console.log('Can schedule exact alarms:', info.canScheduleExactAlarms);}requestPermissions
“requestPermissions” 섹션플랫폼에서 알람 사용에 필요한 권한을 요청합니다. Android의 경우, 정확한 알람 설정을 위해 설정 화면으로 이동할 수 있습니다.
import { CapgoAlarm } from '@capgo/capacitor-alarm';
const result = await CapgoAlarm.requestPermissions({ exactAlarm: true });if (result.granted) { console.log('Permissions granted');} else { console.log('Permissions denied');}checkPermissions
“checkPermissions” 섹션UI를 띄우지 않고 네이티브 알람 접근 권한 상태를 확인합니다. iOS에서는 AlarmKit 준비 상태를, Android에서는 기능 상세 정보를 반환합니다.
import { CapgoAlarm } from '@capgo/capacitor-alarm';
const status = await CapgoAlarm.checkPermissions();console.log('AlarmKit allowed?', status.details?.alarmKit);getAlarms
“getAlarms” 섹션이 앱이 예약한 알람 목록을 가져옵니다. iOS 26+ 버전은 AlarmKit의 알람을 반환합니다. Android는 시스템에서 알람 조회를 위한 API를 제공하지 않아 지원되지 않습니다.
import { CapgoAlarm } from '@capgo/capacitor-alarm';
const { alarms } = await CapgoAlarm.getAlarms();console.log('Scheduled alarms:', alarms);alarms.forEach(alarm => { console.log(`Alarm ${alarm.id}: ${alarm.hour}:${alarm.minute} - ${alarm.label}`);});타입 레퍼런스
“타입 참조” 섹션NativeAlarmCreateOptions
“NativeAlarmCreateOptions” 섹션플랫폼 시계 앱을 통해 네이티브 OS 알람을 생성하기 위한 옵션입니다.
export interface NativeAlarmCreateOptions { /** Hour of day in 24h format (0-23) */ hour: number; /** Minute of hour (0-59) */ minute: number; /** Optional label for the alarm */ label?: string; /** Android only: attempt to skip UI if possible */ skipUi?: boolean; /** Android only: set alarm to vibrate */ vibrate?: boolean;}NativeActionResult
“NativeActionResult” 섹션네이티브 액션의 결과값입니다.
export interface NativeActionResult { /** Whether the action was successful */ success: boolean; /** Optional message with additional information */ message?: string;}OSInfo
“OSInfo” 섹션현재 OS 및 기능에 대한 정보입니다.
export interface OSInfo { /** Platform identifier: 'ios' | 'android' | 'web' */ platform: string; /** OS version string */ version: string; /** Whether the platform exposes a native alarm app integration */ supportsNativeAlarms: boolean; /** Whether scheduling local notifications is supported */ supportsScheduledNotifications: boolean; /** Android only: whether exact alarms are allowed */ canScheduleExactAlarms?: boolean;}PermissionResult
“PermissionResult” 섹션권한 요청 결과입니다.
export interface PermissionResult { /** Overall grant for requested scope */ granted: boolean; /** Optional details by permission key */ details?: Record<string, boolean>; /** Optional human readable diagnostic */ message?: string;}AlarmInfo
“AlarmInfo” 섹션예약된 알람에 대한 정보입니다.
export interface AlarmInfo { /** Unique identifier for the alarm */ id: string; /** Hour of day in 24h format (0-23) */ hour: number; /** Minute of hour (0-59) */ minute: number; /** Optional label for the alarm */ label?: string; /** Whether the alarm is enabled */ enabled?: boolean;}Source of Truth
“Source Of Truth” 섹션이 페이지는 플러그인의 src/definitions.tsupstream에서 public API가 변경되면 sync를 다시 실행하세요.
시작하기 다음 단계
“Getting Started에서 계속하기” 섹션사용 중이라면 시작하기 대시보드 및 API 운영을 계획하려면, 이를 다음과 연결하세요 @capgo/capacitor-alarm 사용하기 @capgo/capacitor-alarm를 사용하여 네이티브 기능을 구현할 때, API 개요 구현 세부 사항은 API 개요에서 소개 구현 세부 사항은 소개에서 API 키 API Keys의 구현 세부 사항은, 기기 Devices의 구현 세부 사항은.