Getting Started
インストール手順とこのプラグインのフルマークダウンガイドまでの手順を含むセットアップ用の質問をコピーする。
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.
bun add @capgo/capacitor-proximitybunx cap syncバートバーグンター。
バートバーグンターバートバーグンター。import { CapacitorProximity } from '@capgo/capacitor-proximity';API Overview
Section titled “API Overview”enable
コンターコンター。__CAPGO_KEEP_0__を有効にします。
iOSではこの機能を UIDevice.isProximityMonitoringEnabled.
Androidではこの機能は TYPE_PROXIMITY を検知し、センサーがカバーされている間、現在のアプリウィンドウを暗くします。
import { CapacitorProximity } from '@capgo/capacitor-proximity';
await CapacitorProximity.enable();disable
「無効化」をタイトルにしたセクション__CAPGO_KEEP_0__を無効にします。
この機能はデフォルトのアプリウィンドウの動作を復元し、センサー監視を停止します。
import { CapacitorProximity } from '@capgo/capacitor-proximity';
await CapacitorProximity.disable();getStatus
「ステータスを取得」をタイトルにしたセクション現在のセンサー利用可能性とプラグイン有効化状態を取得します。
import { CapacitorProximity } from '@capgo/capacitor-proximity';
const status = await CapacitorProximity.getStatus();種類の参照
種類の参照セクションProximityStatusResult
「近接状態の結果」のセクション「近接状態の結果」を返します。 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
プラグインのバージョンを要求したときに返される結果コピーをクリップボード
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.
Getting Startedから続けてください
Getting Startedから続けてくださいというセクション__CAPGO_KEEP_0__を使用している場合 Getting Started APIを使用してダッシュボードとAPIの操作を計画する場合、APIを接続してください capgo/capacitor-proximityを使用して@capgo/capacitor-proximity capgo/capacitor-proximityのネイティブ機能の実装詳細 APIの概要 APIの実装詳細 導入 __CAPGO_KEEP_0__の実装詳細 APIのキー 実装詳細については API キーを参照してください。 デバイス 実装詳細についてはデバイスを参照してください。