スタートガイド
このプラグインの設定プロンプトをインストールステップと完全なマークダウンガイドを含めてコピーする。
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 { MockLocationDetector } from '@capgo/capacitor-mock-location-detector';推奨フロー
「推奨フローの」セクションconst result = await MockLocationDetector.analyze({ requestLocationSample: true, minDetectedChecks: 1,});
if (result.isSimulated) { console.warn('Possible GPS spoofing detected', result.riskScore, result.checks);}1回のチェック実行
「1回のチェック実行」のセクションconst mockFlag = await MockLocationDetector.runCheck({ check: 'system_mock_flag',});連続監視
「連続監視」のセクションawait MockLocationDetector.addListener('locationIntegrityChanged', (event) => { console.log('Integrity changed', event.confidence, event.checks);});
await MockLocationDetector.startMonitoring({ intervalMs: 30000 });ユーザーに設定を案内する
「ユーザーに設定を案内する」のセクションアプリは開発者モードまたはモックロケーションを自動で無効にすることはできません。設定を開いてください。
await MockLocationDetector.openDeveloperSettings();プラットフォーム設定
「プラットフォーム設定」のセクション- iOS: iOSの設定
- Android: Androidの設定
真実の源
「真実の源」というセクションこのページではプラグインの src/definitions.ts. APIが公開されたときに再度上流のdocgenを実行してください。