본문으로 바로가기

Capacitor 알람을 __CAPGO_KEEP_0__에서 보기

설명서

Using @capgo/capacitor-알람

Capacitor 알람 플러그인: OS 알람 관리를 위한 네이티브 OS 인터페이스

설치

bun add @capgo/capacitor-alarm
bunx cap sync

이 플러그인이 제공하는 것

  • createAlarm - 네이티브 OS 알람을 생성하여 플랫폼 시계 앱을 사용합니다. 안드로이드에서는 알람 시계 인텐트를 사용하고, iOS에서는 알람 킷이 사용 가능할 때 (iOS 16+) 사용합니다.
  • openAlarms - 플랫폼의 네이티브 알람 목록 UI를 열 수 있습니다. (사용 가능할 때)
  • getOSInfo - OS 정보 및 기능에 대한 정보를 가져옵니다.
  • requestPermissions - 알람 사용을 위한 플랫폼의 관련 권한을 요청합니다. 안드로이드에서는 정확한 알람을 위해 설정으로 라우팅할 수 있습니다.

예시 사용

createAlarm

네이티브 OS 알람을 생성하여 플랫폼 시계 앱을 사용합니다. 안드로이드에서는 알람 시계 인텐트를 사용하고, iOS에서는 알람 킷이 사용 가능할 때 (iOS 16+) 사용합니다.

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

알람 사용을 위한 권한을 요청하세요. 안드로이드에서는 정확한 알람을 위해 설정으로 라우팅할 수 있습니다.

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

전체 참조

Using @capgo/capacitor-alarm에서 계속하세요.

Capacitor 알람 플러그인을 사용 중이라면 Using @capgo/capacitor-alarm Capacitor 알람 플러그인을 사용 중이라면 @capgo/capacitor-alarm @capgo/capacitor-알람 구현 세부 사항을 위해 시작하기 __CAPGO_KEEP_0__ 플러그인 디렉토리 구현 세부 사항을 위해 Capgo 플러그인 디렉토리 Capgo 플러그인들 - __CAPGO_KEEP_1__ 구현 세부 사항을 위해, 그리고 Capacitor Plugins by Capgo for the implementation detail in Capacitor Plugins by Capgo, and 사이트 하단 Capgo 앱을 __CAPGO_KEEP_0__으로 강화하세요.