メニューに進む

スタート

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);
}

__CAPGO_KEEP_1__

__CAPGO_KEEP_2__
const mockFlag = await MockLocationDetector.runCheck({
check: 'system_mock_flag',
});

__CAPGO_KEEP_3__

__CAPGO_KEEP_4__
await MockLocationDetector.addListener('locationIntegrityChanged', (event) => {
console.log('Integrity changed', event.confidence, event.checks);
});
await MockLocationDetector.startMonitoring({ intervalMs: 30000 });

__CAPGO_KEEP_5__

__CAPGO_KEEP_6__

__CAPGO_KEEP_7__

await MockLocationDetector.openDeveloperSettings();

This page follows the plugin’s src/definitions.tsパブリックのAPIが変更されたときに、上流のdocgenを再実行してください。