__CAPGO_KEEP_3__

시작하기

GitHub

Capgo의 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-rich-notifications` plugin in my project.

만약 Manual Setup을 선호한다면, 플러그인을 설치하기 위해 다음 명령어를 실행하고 아래의 플랫폼별 지침을 따르세요:

터미널 창
npm install @capgo/capacitor-rich-notifications
npx cap sync

수입

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

플랫폼 설정

플랫폼 설정
  • iOS 설정 카테고리 및 중단 수준에 대한
  • Android 설정 위 POST_NOTIFICATIONS, 채널 및 선택적 정확한 경고 또는 전면 서비스 권한.

사용 방법

사용 방법
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',
});
await RichNotifications.addListener('press', (event) => {
console.log(event.id, event.actionId, event.input);
});