__CAPGO_KEEP_2__

スタート

GitHub
ターミナルウィンドウ
bun add @capgo/capacitor-mock-location-detector
bunx 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);
}
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();

プラットフォームの設定

プラットフォームの設定

__CAPGO_KEEP_0__ が公開されたときにアップストリームの docgen を再実行してください。 src/definitions.ts. Re-run docgen upstream when the public API changes.