본문 바로가기

시작하기

GitHub

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-pretty-toast` plugin in my project.

수동 설정을 선호한다면, 다음 명령어를 실행하여 플러그인을 설치하고 아래의 플랫폼별 지침을 따르세요:

터미널 창
npm install @capgo/capacitor-pretty-toast
npx cap sync
import { toast } from '@capgo/capacitor-pretty-toast';
import { toast } from '@capgo/capacitor-pretty-toast';
toast.success('Saved', { message: 'Draft synced.' });

자주 하는 실수

“흔한 실수” 섹션
  • ids 로딩 중: 호출 시 ids 유지 toast.update().
  • 디바운싱: 연속된 에러는 하나의 토스트로 통합됩니다.
  • 브랜딩: 플랫폼별로 아이콘과 색상을 조정하세요.
toast.success('Saved', {
message: 'Your changes are ready.',
});

로딩 토스트 업데이트

“로딩 토스트 업데이트” 섹션
const id = toast.loading('Uploading', {
message: 'Waiting for the server response.',
});
setTimeout(() => {
toast.update(id, {
title: 'Upload complete',
message: 'The file was stored successfully.',
icon: 'checkmark.circle.fill',
autoDismiss: true,
});
}, 1500);
await toast.promise(uploadFile(), {
loading: {
title: 'Uploading',
message: 'Keep the app open while the file is sent.',
},
success: 'Uploaded',
error: 'Upload failed',
});

사용 icon 심볼 이름 또는 원시 SVG 마크업을 사용할 경우:

toast.info('New message', {
icon: 'message.fill',
message: 'Open the inbox to reply.',
});

사용 iconSource URI 형식의 이미지에 사용됩니다. 다음을 지원합니다: https://, http://, file://, data:, blob:, 절대 파일 경로, 또는 { uri }.

toast.show({
title: 'Profile updated',
message: 'Your avatar changed.',
iconSource: 'https://example.com/avatar.png',
});

iconSource 이 우선 적용됩니다 icon.

사용 중이라면 시작하기 네이티브 플러그인 작업을 계획하려면, 이를 다음 항목과 연결하세요: Capgo 플러그인 디렉토리 Capgo Plugin Directory의 제품 워크플로우에 맞춰, Capgo의 Capacitor 플러그인 Capgo의 Capacitor 플러그인 구현 상세 내용에 대해서는, 플러그인 추가 또는 업데이트 플러그인 추가 또는 업데이트의 구현 세부 사항은, Ionic Enterprise 플러그인 대안 Ionic Enterprise 플러그인 대안의 제품 워크플로우와, Capgo Native Build Capgo Native Builds의 제품 워크플로우를 위해.