시작하기
이 플러그인의 설치 단계와 전체 markdown 가이드가 포함된 설정 프롬프트를 복사하세요.
Set up this Capacitor plugin in the project.
Use the package manager already used by the project.
Install these package(s): `@capgo/capacitor-permissions`
Run the required Capacitor sync/update step after installation.
Read this markdown guide for the full setup steps: https://raw.githubusercontent.com/Cap-go/website/refs/heads/main/apps/docs/src/content/docs/docs/plugins/permissions/getting-started.mdx
Use that guide for platform-specific steps, native file edits, permissions, config changes, imports, and usage setup.
If that guide references other docs pages, read them too.
설치
“설치” 섹션AI 지원 설정으로 플러그인을 설치할 수 있습니다. 다음 명령어로 AI 도구에 Capgo 스킬을 추가하세요:
bunx skills add https://github.com/Cap-go/capgo-skills --skill capacitor-plugins그다음 아래 prompt를 사용하세요:
Use the `capacitor-plugins` skill from `Cap-go/capgo-skills` to install the `@capgo/capacitor-permissions` plugin in my project.Manual Setup을 선호한다면, 다음 명령어를 실행하여 플러그인을 설치하고 아래의 플랫폼별 지침을 따르세요:
bun add @capgo/capacitor-permissionsbunx cap sync가져오기
“Import” 섹션import { Permissions } from '@capgo/capacitor-permissions';빠른 시작
“Quick start” 섹션import { Permissions } from '@capgo/capacitor-permissions';
const { status } = await Permissions.check({ permission: 'camera' });예시: request
“예시: request” 제목의 섹션import { Permissions } from '@capgo/capacitor-permissions';
const { status } = await Permissions.request({ permission: 'notifications' });예시: checkMultiple
“예시: checkMultiple” 제목의 섹션import { Permissions } from '@capgo/capacitor-permissions';
const { statuses } = await Permissions.checkMultiple({ permissions: ['camera', 'microphone'],});자주 하는 실수
“자주 하는 실수” 섹션- 네이티브 동기화: 실행
bunx cap sync플러그인 업그레이드 후. - 단일 진실 공급원: 신뢰
src/definitions.tsGitHub 레포지토리에서.
플랫폼 설정
“플랫폼 설정” 섹션- iOS 설정 Info.plist 사용 설명 문구 및
PermissionName. - Android 설정 다음에 해당하는
uses-permissionminSdk 24 기준
사용량
“Usage” 섹션import { Permissions } from '@capgo/capacitor-permissions';
export async function ensureCamera(): Promise<boolean> { const { status } = await Permissions.check({ permission: 'camera' }); if (status === 'granted') return true; const { status: afterRequest } = await Permissions.request({ permission: 'camera' }); return afterRequest === 'granted';}상태가 다음과 같을 때: blocked, 사용자를 설정 화면으로 이동시킵니다:
await Permissions.openSettings({ type: 'application' });