시작하기
이 플러그인의 설치 단계와 전체 마크다운 가이드가 포함된 설정 프롬프트를 복사하세요.
Set up this Capacitor plugin in the project.
Use the package manager already used by the project.
Install these package(s): `@capgo/capacitor-persistent-uuid`
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/persistent-uuid/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-Assisted Setup으로 플러그인을 설치할 수 있습니다. 다음 명령어로 AI 도구에 Capgo 스킬을 추가하세요:
bunx 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-persistent-uuid` plugin in my project.수동 설정을 선호한다면, 다음 명령어를 실행하여 플러그인을 설치하고 아래의 플랫폼별 지침을 따르세요:
bun add @capgo/capacitor-persistent-uuidbunx cap sync빠른 시작
“빠른 시작” 섹션import { PersistentUuid } from '@capgo/capacitor-persistent-uuid';
const result = await PersistentUuid.getId();console.log(result);예시: resetId
“예시: resetId”라는 제목의 섹션import { PersistentUuid } from '@capgo/capacitor-persistent-uuid';
const result = await PersistentUuid.resetId();console.log(result);자주 하는 실수
“흔한 실수” 섹션- 네이티브 동기화: 실행
bunx cap sync플러그인 업그레이드 후. - 신뢰할 수 있는 소스: 신뢰
src/definitions.tsGitHub 레포지토리에서.
가져오기
“Import” 섹션import { PersistentUuid } from '@capgo/capacitor-persistent-uuid';UUID 읽기 또는 생성하기
“UUID 읽기 또는 생성하기” 섹션import { PersistentUuid } from '@capgo/capacitor-persistent-uuid';
const result = await PersistentUuid.getId();
console.log(result.id);console.log(result.scope);console.log(result.created);첫 호출 시 UUID가 생성 및 저장됩니다. 이후 동일한 scope에 대해 호출하면 저장된 동일한 UUID를 반환합니다.
안정적인 커스텀 scope 사용하기
“안정적인 커스텀 스코프 사용” 섹션네이티브 기본 스코프는 Android에서는 패키지명, iOS에서는 번들 식별자입니다. 디버그 빌드와 프로덕션 빌드가 서로 다른 패키지 식별자를 사용하지만 하나의 UUID를 공유해야 한다면 공유 스코프를 전달하세요.
const result = await PersistentUuid.getId({ scope: 'com.example.app',});UUID 초기화
“UUID 초기화” 섹션사용자가 로그아웃하거나 개인정보 초기화를 요청할 때, 또는 자동화 테스트에 새 식별자가 필요할 때 resetId를 호출하세요.
const replacement = await PersistentUuid.resetId();console.log(replacement.id);지속성 기대 동작
“지속성 기대 동작” 섹션- 패키지명이나 커스텀 스코프가 안정적이면 Android는 앱을 삭제하고 재설치해도 UUID가 유지됩니다. 서명 키가 다른 Android Studio와 Play Store 설치도 마찬가지입니다.
- iOS는 Keychain 접근 규칙이 동일하게 유지되는 한 앱 업데이트와 iOS 업데이트 후에도 UUID가 유지됩니다.
- 웹은 localStorage를 사용하며, 개발용 폴백일 뿐입니다.
시작하기 다음 단계
“Getting Started에서 계속하기” 섹션사용 중이라면 시작하기 영구 앱 ID를 추가하려면 다음과 연결하세요: @capgo/capacitor-persistent-uuid 개요는, Android 동작 방식 재설치 동작은, iOS 동작 Keychain 동작은, @capgo/capacitor-persistent-uuid 사용하기 튜토리얼을 위해, 그리고 Capgo 플러그인 디렉토리 다른 native plugin의 경우.