본문 바로가기
@capgo/capacitor-alarm Device API 오픈 소스

알람 Capacitor 플러그인

앱이 종료된 상태에서도 네이티브 알람 및 알림 예약 가능

설치

bun add @capgo/capacitor-alarm bunx cap sync
npm, pnpm 또는 yarn
  • npm install @capgo/capacitor-alarm
  • pnpm add @capgo/capacitor-alarm
  • yarn add @capgo/capacitor-alarm

가이드

Capacitor에서 Alarm 사용법

@capgo/capacitor-alarm 사용하기

네이티브 OS 알람을 관리하기 위한 Capacitor Alarm Plugin 인터페이스.

설치

bun add @capgo/capacitor-alarm
bunx cap sync

bunx cap sync 플러그인의 네이티브 code를 네이티브 프로젝트에 복사합니다. 플러그인을 업그레이드할 때마다 다시 실행하세요.

가져오기

import { CapgoAlarm } from '@capgo/capacitor-alarm';

API 한눈에 보기

메서드 설명
createAlarm 플랫폼 시계 앱으로 네이티브 OS 알람을 생성합니다. Android에서는 Alarm Clock intent를 사용하고, iOS에서는 사용 가능한 경우(iOS 16+) AlarmKit을 사용합니다.
openAlarms 가능한 경우 플랫폼의 네이티브 알람 목록 UI를 엽니다.
getOSInfo OS와 지원 기능에 대한 정보를 가져옵니다.
requestPermissions 플랫폼에서 알람 사용에 필요한 권한을 요청합니다. Android에서는 정확한 알람 설정 화면으로 이동할 수 있습니다.
checkPermissions UI를 띄우지 않고 네이티브 알람 접근 권한의 현재 상태를 확인합니다. iOS에서는 AlarmKit 준비 상태를, Android에서는 기능 세부 정보를 알려줍니다.
getAlarms 이 앱이 예약한 알람 목록을 가져옵니다. iOS 26+에서는 AlarmKit의 알람을 반환합니다. Android에서는 시스템이 알람을 조회할 API을 제공하지 않아 지원되지 않습니다.
cancelAlarm 예약된 알람을 ID로 취소합니다. iOS 26+에서는 AlarmKit에서 알람을 제거합니다. Android/웹에서는 '지원되지 않음'을 반환합니다.

예시

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()

가능한 경우 플랫폼의 네이티브 알람 목록 UI를 엽니다.

import { CapgoAlarm } from '@capgo/capacitor-alarm';

const result = await CapgoAlarm.openAlarms();
if (result.success) {
  console.log('Alarms UI opened');
}

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()

플랫폼에서 알람 사용에 필요한 권한을 요청합니다. 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()

UI를 띄우지 않고 네이티브 알람 접근 권한의 현재 상태를 확인합니다. iOS에서는 AlarmKit 준비 상태를, Android에서는 기능 세부 정보를 알려줍니다.

import { CapgoAlarm } from '@capgo/capacitor-alarm';

const status = await CapgoAlarm.checkPermissions();
console.log('AlarmKit allowed?', status.details?.alarmKit);

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}`);
});

위 표에는 7가지 핵심 메서드가 나와 있습니다. 리스너와 버전 헬퍼, 각 메서드의 전체 스펙은 다음 문서에 정리되어 있습니다. GitHub 리포지토리.

전체 레퍼런스

@capgo/capacitor-alarm 사용하기부터 계속하기

사용 중이라면 @capgo/capacitor-alarm 사용하기 네이티브 플러그인 작업을 계획하려면, 이를 다음 항목과 연결하세요: @capgo/capacitor-alarm @capgo/capacitor-alarm의 구현 세부 사항에 대해, 시작하기 Getting Started의 구현 상세 내용은 Capgo 플러그인 디렉토리 Capgo Plugin Directory의 제품 워크플로우에 맞춰, Capgo의 Capacitor 플러그인 Capgo의 Capacitor Plugins 구현 세부 사항 및 플러그인 추가 또는 업데이트 플러그인 추가 또는 업데이트의 구현 세부 사항은.

자주 묻는 질문

Alarm 플러그인 FAQ

Capacitor 앱에 Alarm plugin을 어떻게 설치하나요?

"bun add @capgo/capacitor-alarm" (또는 "npm install @capgo/capacitor-alarm")를 실행한 다음, "bunx cap sync"를 실행하여 iOS 및 Android 프로젝트에 네이티브 code가 반영되도록 하세요. 그 후 앱의 code에서 "@capgo/capacitor-alarm"를 통해 import하세요.

@capgo/capacitor-alarm가 React, Vue, Angular와 호환되나요?

네. Alarm은 Capacitor 패키지이므로 Ionic, React, Vue, Angular, Svelte 및 일반 JavaScript를 포함하여 Capacitor에서 실행되는 모든 웹 프레임워크와 호환됩니다.

@capgo/capacitor-alarm은 어떤 Capacitor 버전을 지원하나요?

Capgo 플러그인은 Capacitor의 메이저 버전을 따릅니다. 사용 중인 Capacitor 메이저 버전과 일치하는 플러그인 메이저 버전을 사용하세요 (예: Capacitor 8에는 플러그인 v8). 유지 관리되는 버전은 GitHub README의 호환성 표에서 확인할 수 있습니다.

@capgo/capacitor-alarm는 무료 오픈 소스인가요?

네. code 소스 코드는 GitHub의 https://github.com/Cap-go/capacitor-alarm/에 공개되어 있으며, npm에서 무료로 설치할 수 있습니다. 버그 리포트와 pull request를 언제든 환영합니다.

App Store 심사 없이 Alarm을 사용하는 code를 업데이트할 수 있나요?

플러그인을 설치하거나 업그레이드하면 네이티브 code가 변경되므로 새로운 스토어 빌드가 필요합니다. 그 이후에는 플러그인을 호출하는 JavaScript, HTML, CSS 변경 사항을 Capgo live updates로 즉시 배포할 수 있습니다.

앱 심사 기다리지 않고 Alarm 변경 사항 배포하세요

스토어 빌드에 플러그인이 포함되면, Capgo live updates로 JavaScript, HTML, CSS 변경 사항을 몇 분 만에 사용자에게 푸시할 수 있습니다.

Capgo로 시작하기