Getting Started
Copy a setup prompt with the install steps and the full markdown guide for this plugin.
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.
Sie können unsere AI-gestützte Einrichtung verwenden, um das Plugin zu installieren. Fügen Sie die Capgo Fähigkeiten Ihrem AI-Tool mit folgendem Befehl hinzu:
npx skills add https://github.com/Cap-go/capgo-skills --skill capacitor-pluginsVerwenden Sie dann die folgende Anweisung:
Use the `capacitor-plugins` skill from `Cap-go/capgo-skills` to install the `@capgo/capacitor-proximity` plugin in my project.If you prefer Manual Setup, install the plugin by running the following commands and follow the platform-specific instructions below:
bun add @capgo/capacitor-proximitybunx cap syncImportieren
Abschnitt mit der Überschrift „Importieren“import { CapacitorProximity } from '@capgo/capacitor-proximity';API Übersicht
Abschnitt mit der Überschrift „API Übersicht“Proximitätsüberwachung aktivieren.
Auf iOS aktiviert dies UIDevice.isProximityMonitoringEnabled.
Auf Android beginnt das Abhören des TYPE_PROXIMITY und dimmt die aktuelle Anwendungsfenster, während der Sensor abgedeckt ist.
import { CapacitorProximity } from '@capgo/capacitor-proximity';
await CapacitorProximity.enable();Proximitätserkennung deaktivieren.
Dies setzt die Standardverhalten der Anwendung und beendet die Sensorüberwachung.
import { CapacitorProximity } from '@capgo/capacitor-proximity';
await CapacitorProximity.disable();getStatus
Abschnitt mit dem Titel „getStatus“Ermitteln Sie den aktuellen Sensorstatus und die Plugin-Einstellung.
import { CapacitorProximity } from '@capgo/capacitor-proximity';
const status = await CapacitorProximity.getStatus();Typenreferenz
Abschnitt mit dem Titel “Typenreferenz”ProximityStatusResult
Abschnitt mit dem Titel “ProximityStatusResult”Ergibt zurück 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”Ergibt zurück, wenn die Pluginversion angefordert wird.
export interface PluginVersionResult { /** * Native plugin version string. * * @since 0.0.1 */ version: string;}Quelle der Wahrheit
Abschnitt mit dem Titel “Quelle der Wahrheit”Diese Seite wird aus dem Plugin generiert. src/definitions.ts. Re-run the sync when the public API changes upstream.
Weiter von Getting Started
Abschnitt mit dem Titel “Weitermachen von Getting Started”Wenn Sie Capgo verwenden Getting Started" to plan dashboard and API operations, connect it with Verwenden Sie @capgo/capacitor-proximity für die native Fähigkeit in Verwenden Sie @capgo/capacitor-proximity, 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 zur Implementierungsdetail in Geräte.