메인 콘텐츠로 건너뛰기
플러그인으로 돌아가기
@capgo/capacitor-persistent-uuid
튜토리얼
@capgo/capacitor-persistent-uuid

UUID

앱이 재설치, 업데이트, OS 업데이트 시에도 유지되는 앱 범위 UUID를 생성하고 저장합니다.

가이드

퍼스턴트 UUID 튜토리얼

퍼스턴트 UUID를 사용하는 @capgo/capacitor

Generate one persistent app-scoped UUID for Capacitor and keep it stable across reinstall and update flows where normal app storage is removed.

설치

npm install @capgo/capacitor-persistent-uuid
npx cap sync

이 플러그인이 제공하는 것

  • getId - 선택한 범위에 대해 저장된 UUID를 읽어, 하나가 없으면 생성합니다.
  • resetId - 로그아웃, 개인 정보 초기화, 테스트 청소 흐름에서 저장된 UUID를 회전합니다.
  • scope - 앱의 디버그 및 프로덕션 패키지 식별자가 다른 경우 옵션 namespace입니다.

예시 사용

import { PersistentUuid } from '@capgo/capacitor-persistent-uuid';

const { id, created, scope } = await PersistentUuid.getId();

console.log(id);
console.log(created);
console.log(scope);

빌드 버전 간 UUID 공유

const result = await PersistentUuid.getId({
  scope: 'com.example.app',
});

console.log(result.id);

식별자 초기화

const replacement = await PersistentUuid.resetId();
console.log(replacement.id);

플랫폼 참고 사항

Android는 패키지 이름이나 커스텀 스코프가 안정적일 때 Android Studio 재설치 주기와 디버그 vs Play signing 차이점을 생존시킨다. iOS는 Keychain에 UUID를 저장하고 앱 및 iOS 업데이트를 통해 Keychain 접근이 호환되는 동안 생존한다. Web은 개발용으로 localStorage를 사용한다.

이 플러그인은 하드웨어 ID를 노출하지 않고 factory reset, 수동 계정 제거, Keychain 초기화, 브라우저 저장소 초기화, 또는 resetId를 생존시키지 않는다.

전체 참조

계속하기

이 플러그인을 사용하는 경우 @capgo/capacitor-persistent-uuid 앱의 고유성을 안정적으로 유지하기 위해 연결하세요. @capgo/capacitor-persistent-uuid 개요를 보시려면 Getting Started 설치 및 API 예시를 위해 Android의 동작 재설치에 대한 자세한 내용을 보시려면 iOS의 동작 Keychain에 대한 자세한 내용을 보시려면 @capgo/capacitor-persistent-account @__CAPGO_KEEP_0__/__CAPGO_KEEP_1__-persistent-account