Getting Started
Einen Setup-Befehl mit den Installationsanweisungen und der vollständigen Markdown-Anleitung für diesen Plugin kopieren.
Set up this Capacitor plugin in the project.
Use the package manager already used by the project.
Install these package(s): `@capgo/capacitor-proximity`
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/proximity/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.
Installieren
Abschnitt mit dem Titel „Installieren“bun add @capgo/capacitor-proximitybunx cap syncImportieren
Abschnitt: Importimport { CapacitorProximity } from '@capgo/capacitor-proximity';API Übersicht
Abschnitt: API Übersichtenable
Abschnitt: aktivierenProximitätsüberwachung aktivieren.
Auf iOS aktiviert dies UIDevice.isProximityMonitoringEnabledAuf Android beginnt es, auf TYPE_PROXIMITY und dimmt die aktuelle Anwendungsansicht, während der Sensor abgedeckt ist.
import { CapacitorProximity } from '@capgo/capacitor-proximity';
await CapacitorProximity.enable();disable
Abschnitt: deaktivierenProximityüberwachung deaktivieren.
Dies setzt die Standardverhalten des Anwendungsfensters wieder her und beendet die Sensorüberwachung.
import { CapacitorProximity } from '@capgo/capacitor-proximity';
await CapacitorProximity.disable();getStatus
Abschnitt mit dem Titel “getStatus”Aktuelle Sensorverfügbarkeit und Plugin-Status abrufen.
import { CapacitorProximity } from '@capgo/capacitor-proximity';
const status = await CapacitorProximity.getStatus();Typenreferenz
Abschnitt mit dem Titel “Typenreferenz”ProximityStatusResult
Abschnitt mit dem Titel “ProximityStatusResult”Ergibt durch getStatus().
export interface ProximityStatusResult { /** * Whether the current device exposes a usable proximity sensor. * * @since 0.0.1 */ available: boolean;
/** * Whether proximity monitoring is currently enabled by the plugin. * * @since 0.0.1 */ enabled: boolean;
/** * Platform label returned by the native or web implementation. * * @since 0.0.1 */ platform: 'ios' | 'android' | 'web';}PluginVersionResult
Abschnitt mit dem Titel “PluginVersionResult”Ergebnis, das bei der Anfrage der Pluginversion zurückgegeben wird.
export interface PluginVersionResult { /** * Native plugin version string. * * @since 0.0.1 */ version: string;}Quellwahrheit
Abschnitt mit dem Titel “Quellwahrheit”Diese Seite wird aus dem Plugin generiert. src/definitions.tsRe-run die Synchronisation, wenn die öffentliche API upstream geändert wird.
Weitermachen von Getting Started
Abschnitt mit dem Titel “Weitermachen von Getting Started”Wenn Sie " Getting Started für die Planung von Dashboard und API-Operationen verwenden, verbinden Sie es mit Mit @capgo/capacitor-Proximity für die native Fähigkeit in Using @capgo/capacitor-Nähe, API Übersicht für die Implementierungsdetails in API Übersicht, Einführung für die Implementierungsdetails in Einführung, API Schlüssel für die Implementierungsdetails in API Schlüssel, und Geräte für die Implementierungsdetails in Geräte.