시작하기
이 플러그인의 설치 단계와 전체 마크다운 가이드가 포함된 설정 프롬프트를 복사하세요.
Set up this Capacitor plugin in the project.
Use the package manager already used by the project.
Install these package(s): `@capgo/capacitor-mock-location-detector`
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/mock-location-detector/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.
bun add @capgo/capacitor-mock-location-detectorbunx cap sync가져오기
“Import” 섹션import { MockLocationDetector } from '@capgo/capacitor-mock-location-detector';빠른 시작
“빠른 시작” 섹션import { MockLocationDetector } from '@capgo/capacitor-mock-location-detector';
const result = await MockLocationDetector.getCapabilities();console.log(result);예시: analyze
“예시: analyze” 섹션import { MockLocationDetector } from '@capgo/capacitor-mock-location-detector';
const result = await MockLocationDetector.analyze();console.log(result);예시: runCheck
“예시: runCheck” 섹션import { MockLocationDetector } from '@capgo/capacitor-mock-location-detector';
const result = await MockLocationDetector.runCheck({ check: 'system_mock_flag' });console.log(result);자주 하는 실수
“흔한 실수” 섹션- 리스너: 화면이 언마운트될 때 핸들을 제거합니다.
- 네이티브 동기화: 실행
bunx cap sync플러그인 업그레이드 후. - 신뢰할 수 있는 소스: 신뢰
src/definitions.tsGitHub 레포지토리에서.
권장 플로우
“권장 플로우” 섹션const result = await MockLocationDetector.analyze({ requestLocationSample: true, minDetectedChecks: 1,});
if (result.isSimulated) { console.warn('Possible GPS spoofing detected', result.riskScore, result.checks);}단일 체크 실행
“Run One Check” 섹션const mockFlag = await MockLocationDetector.runCheck({ check: 'system_mock_flag',});지속적 모니터링
“Monitor Continuously” 섹션await MockLocationDetector.addListener('locationIntegrityChanged', (event) => { console.log('Integrity changed', event.confidence, event.checks);});
await MockLocationDetector.startMonitoring({ intervalMs: 30000 });사용자를 설정으로 안내
“Guide Users To Settings” 섹션앱은 개발자 모드나 모의 위치를 자동으로 비활성화할 수 없습니다. 대신 설정을 열어야 합니다:
await MockLocationDetector.openDeveloperSettings();플랫폼 설정
“Platform Setup” 섹션- iOS: iOS 설정
- Android: Android 설정
Source of Truth
“Source Of Truth” 섹션이 페이지는 플러그인의 src/definitions.ts을 따릅니다. 공개된 API가 변경되면 docgen을 다시 실행하세요.