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.
Install
Installbun add @capgo/capacitor-proximitybunx cap syncImport
Importimport { CapacitorProximity } from '@capgo/capacitor-proximity';API Overview
API OverviewEnable proximity monitoring.
iOSではこの機能を有効にします。 UIDevice.isProximityMonitoringEnabled.
Androidではセンサーがカバーされるまでの間、
このアプリのウィンドウを暗くします。 TYPE_PROXIMITY カバーされたセンサーを検出すると、
現在のアプリウィンドウを暗くします。
import { CapacitorProximity } from '@capgo/capacitor-proximity';
await CapacitorProximity.enable();disable
「無効化」をタイトルにしたセクション近接モニタリングを無効にします。
デフォルトのアプリウィンドウの動作を復元し、 センサー監視を停止します。
import { CapacitorProximity } from '@capgo/capacitor-proximity';
await CapacitorProximity.disable();現在のセンサー利用可能性とプラグインの有効化状態を取得します。
import { CapacitorProximity } from '@capgo/capacitor-proximity';
const status = await CapacitorProximity.getStatus();型参照
種類の参照ProximityStatusResult
近接状態の結果__CAPGO_KEEP_0__がアップストリームで変更された場合に返される結果 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__がアップストリームで変更された場合に再度Syncを実行してください。 src/definitions.ts. Re-run the sync when the public API changes upstream.
__CAPGO_KEEP_0__
「Getting Started」から続けてあなたが「を使用している場合 Getting Started APIとを連携して、ダッシュボードとAPIの操作を計画する native capabilityの実装に使用する@capgo/capacitor-proximity for the native capability in Using @capgo/capacitor-proximity, APIの実装詳細 for the implementation detail in API Overview, Introductionの実装詳細 __CAPGO_KEEP_0__ Keys API Keysの実装詳細 API デバイス デバイスの実装詳細について