본문 바로가기
@capgo/capacitor-rich-notifications 커뮤니케이션 오픈 소스

리치 알림 (Rich Notifications) Capacitor 플러그인

Android 채널, 프로그레스 레이아웃, 액션 버튼, 예약, iOS 인터럽션 레벨을 지원하는 로컬 알림

설치

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

가이드

Capacitor에서 Rich Notifications 사용법

@capgo/capacitor-rich-notifications 사용하기

Android 채널, 프로그레스 레이아웃, 액션 버튼, 스케줄링, iOS interruption level을 지원하는 로컬 알림.

설치

bun add @capgo/capacitor-rich-notifications
bunx cap sync

플러그인이 제공하는 기능

  • checkPermission - 로컬 알림 권한 상태 확인
  • requestPermission - 로컬 알림 권한 요청
  • createChannel - Android 알림 채널 생성
  • createChannelGroup - Android 채널 그룹 생성
  • deleteChannel - Android 알림 채널 삭제
  • display - 로컬 알림 즉시 표시
  • schedule - 로컬 알림 예약
  • cancel - ID로 알림 하나 취소
  • cancelAll - 이 플러그인으로 관리되는 모든 알림 취소
  • getDisplayed - 알림창 또는 알림 센터에 표시된 알림 목록 조회
  • getPending - 아직 표시되지 않은 예약 알림 목록 조회
  • getInitialNotification - 앱을 연 알림이 있으면 반환
  • setBadge - iOS에서 앱 아이콘 배지 수를 설정합니다.
  • registerActions - 재사용 가능한 액션 카테고리를 등록합니다.
  • getPluginVersion - 플랫폼 구현체의 버전 마커를 반환합니다.
  • addListener - press 및 dismiss 이벤트를 수신합니다.

사용 예시

requestPermission 및 display

import { RichNotifications } from '@capgo/capacitor-rich-notifications';

await RichNotifications.requestPermission();

await RichNotifications.createChannel({
  id: 'messages',
  name: 'Messages',
  importance: 'high',
});

await RichNotifications.display({
  title: 'Hello',
  body: 'Tap to open the app',
  channelId: 'messages',
});

schedule

import { RichNotifications } from '@capgo/capacitor-rich-notifications';

await RichNotifications.schedule({
  notification: {
    id: 'reminder-1',
    title: 'Reminder',
    body: 'Your appointment starts soon',
    channelId: 'messages',
  },
  trigger: { type: 'timestamp', timestamp: Date.now() + 60_000 },
});

전체 레퍼런스

자주 묻는 질문

Rich Notifications 플러그인 FAQ

Capacitor 앱에 Rich Notifications 플러그인을 설치하는 방법은 무엇인가요?

"bun add @capgo/capacitor-rich-notifications" (또는 "npm install @capgo/capacitor-rich-notifications")를 실행한 후, iOS 및 Android 프로젝트가 네이티브 code를 인식하도록 "bunx cap sync"를 실행하세요. 앱 code에서 "@capgo/capacitor-rich-notifications"로 가져오세요.

@capgo/capacitor-rich-notifications은 React, Vue, Angular와 호환되나요?

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

@capgo/capacitor-rich-notifications이 지원하는 Capacitor 버전은 무엇인가요?

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

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

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

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

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

앱 심사 기다리지 않고 Rich Notifications 변경 사항 배포

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

Capgo로 시작하기