Getting Started
Copy a setup prompt with the install steps and the full markdown guide for this plugin.
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.
Install
Section titled “Install”bun add @capgo/capacitor-mock-location-detectorbunx cap syncImport
Section titled “Import”import { MockLocationDetector } from '@capgo/capacitor-mock-location-detector';Recommended Flow
Section titled “Recommended Flow”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
Section titled “Run One Check”const mockFlag = await MockLocationDetector.runCheck({ check: 'system_mock_flag',});Monitor Continuously
Section titled “Monitor Continuously”await MockLocationDetector.addListener('locationIntegrityChanged', (event) => { console.log('Integrity changed', event.confidence, event.checks);});
await MockLocationDetector.startMonitoring({ intervalMs: 30000 });Guide Users To Settings
Section titled “Guide Users To Settings”Apps cannot disable developer mode or mock location automatically. Open settings instead:
await MockLocationDetector.openDeveloperSettings();Platform Setup
Section titled “Platform Setup”- iOS: iOS setup
- Android: Android setup
Source Of Truth
Section titled “Source Of Truth”This page follows the plugin’s src/definitions.ts. Re-run docgen upstream when the public API changes.