Passer à la navigation

Prise en main

GitHub
Fenêtre de terminal
bun add @capgo/capacitor-mock-location-detector
bunx cap sync
import { MockLocationDetector } from '@capgo/capacitor-mock-location-detector';
import { MockLocationDetector } from '@capgo/capacitor-mock-location-detector';
const result = await MockLocationDetector.getCapabilities();
console.log(result);
import { MockLocationDetector } from '@capgo/capacitor-mock-location-detector';
const result = await MockLocationDetector.analyze();
console.log(result);

Exemple : exécuter la vérification

Exemple : exécution de la vérification
import { MockLocationDetector } from '@capgo/capacitor-mock-location-detector';
const result = await MockLocationDetector.runCheck({ check: 'system_mock_flag' });
console.log(result);
  • Écouteurs: supprimez les handles lorsqu'il n'y a plus d'écran.
  • Native sync: exécutez bunx cap sync Après mises à jour du plugin.
  • Source de vérité: trust src/definitions.ts au GitHub repo.
const result = await MockLocationDetector.analyze({
requestLocationSample: true,
minDetectedChecks: 1,
});
if (result.isSimulated) {
console.warn('Possible GPS spoofing detected', result.riskScore, result.checks);
}

Exécutez une vérification unique

Section titled “Run One Check”
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 });

Guider les utilisateurs vers les paramètres

Guide des utilisateurs vers les paramètres

Apps cannot disable developer mode or mock location automatically. Open settings instead:

await MockLocationDetector.openDeveloperSettings();

Configuration du plateau

Paramètres de plateforme

Cette page suit les étapes du plugin. src/definitions.tsRe-run docgen upstream lorsque les modifications publiques API sont effectuées.