コンテンツにスキップ

Getting Started

GitHub
アシットバートバーグンター。
bun add @capgo/capacitor-proximity
bunx cap sync
import { CapacitorProximity } from '@capgo/capacitor-proximity';

__CAPGO_KEEP_0__を有効にします。

iOSではこの機能を UIDevice.isProximityMonitoringEnabled. Androidではこの機能は TYPE_PROXIMITY を検知し、センサーがカバーされている間、現在のアプリウィンドウを暗くします。

import { CapacitorProximity } from '@capgo/capacitor-proximity';
await CapacitorProximity.enable();

__CAPGO_KEEP_0__を無効にします。

この機能はデフォルトのアプリウィンドウの動作を復元し、センサー監視を停止します。

import { CapacitorProximity } from '@capgo/capacitor-proximity';
await CapacitorProximity.disable();

現在のセンサー利用可能性とプラグイン有効化状態を取得します。

import { CapacitorProximity } from '@capgo/capacitor-proximity';
const status = await CapacitorProximity.getStatus();

「近接状態の結果」を返します。 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';
}

コピーをクリップボード

export interface PluginVersionResult {
/**
* Native plugin version string.
*
* @since 0.0.1
*/
version: string;
}

「真実の源」のセクション

このページはプラグインの

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

__CAPGO_KEEP_0__を使用している場合 Getting Started APIを使用してダッシュボードとAPIの操作を計画する場合、APIを接続してください capgo/capacitor-proximityを使用して@capgo/capacitor-proximity capgo/capacitor-proximityのネイティブ機能の実装詳細 APIの概要 APIの実装詳細 導入 __CAPGO_KEEP_0__の実装詳細 APIのキー 実装詳細については API キーを参照してください。 デバイス 実装詳細についてはデバイスを参照してください。