시작하기
복사할 수 있는 설치 지시문
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 기능을 추가하려면 다음 명령어를 사용하세요:
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-persistent-uuid` plugin in my project.만약 Manual Setup을 선호한다면, 플러그인을 설치하기 위해 다음 명령어를 실행하고 아래의 플랫폼별 지침을 따르세요:
bun add @capgo/capacitor-persistent-uuidbunx cap sync수입
Importimport { PersistentUuid } from '@capgo/capacitor-persistent-uuid';UUID를 읽거나 생성하세요
Section titled “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를 생성하고 저장합니다. 이후 호출은 동일한 범위에 대해 동일한 UUID를 반환합니다.
안정적인 커스텀 범위 사용
Section titled “안정적인 커스텀 범위 사용”네이티브 기본 범위는 안드로이드에서는 패키지 이름, iOS에서는 번들 식별자입니다. debug 및 production 빌드가 서로 다른 패키지 식별자를 사용하지만 하나의 UUID를 공유해야 하는 경우 공유 범위를 전달하세요.
const result = await PersistentUuid.getId({ scope: 'com.example.app',});UUID 초기화
Section titled “UUID 초기화”로그아웃, 개인 정보 초기화 요청 또는 자동 테스트를 위해 새로운 식별자를 필요로 할 때 resetId를 호출하세요.
const replacement = await PersistentUuid.resetId();console.log(replacement.id);지속성 기대
지속성 기대- 안드로이드는 패키지 이름 또는 커스텀 범위가 안정적일 때, 다른 서명 키를 사용하는 안드로이드 스튜디오 및 플레이 스토어 설치와 함께 제거 및 다시 설치가 가능합니다.
- iOS는 앱 업데이트와 iOS 업데이트를 포함하여 키체인 접근 규칙이 동일한 경우 살아남습니다.
- 웹은 localStorage를 사용하고 개발용으로만 fallback입니다.
Getting Started에서 계속하세요
Getting Started에서 계속하세요이러한 경우 Getting Started 지속적인 앱 식별성을 추가하기 위해 @capgo/capacitor-persistent-uuid 설명서를 보려면 안드로이드 동작 재설치 동작 iOS 동작 키체인 동작 @capgo/capacitor-persistent-uuid 사용 설명서를 보려면 Capgo 플러그인 디렉토리 __CAPGO_KEEP_0__ 시작