近接 __CAPGO_KEEP_0__ リポジトリ
インストールステップとフルマークダウンガイドのセットアッププロンプトをコピーしてください。
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.
インストール
「インストール」と題されたセクションCapgoのAI-Assistedセットアップを使用してプラグインをインストールできます。AIツールにCapgoスキルを追加するには、以下のコマンドを使用してください:
npx skills add https://github.com/Cap-go/capgo-skills --skill capacitor-plugins次に、以下のプロンプトを使用してください:
Use the `capacitor-plugins` skill from `Cap-go/capgo-skills` to install the `@capgo/capacitor-proximity` plugin in my project.__CAPGO_KEEP_0__の場合、プラグインをインストールするには、以下のコマンドを実行し、下記のプラットフォーム固有の説明を参照してください。
bun add @capgo/capacitor-proximitybunx cap syncインポート
「インポート」のセクションimport { CapacitorProximity } from '@capgo/capacitor-proximity';APIの概要
「APIの概要」のセクションenable
「有効化」のセクションiOSではこの設定で近接監視を有効化します。
iOSではこの設定で近接監視を有効化します。 UIDevice.isProximityMonitoringEnabled.
Androidではこの機能は TYPE_PROXIMITY と現在のアプリウィンドウを暗くします。
センサーが覆われたときに
import { CapacitorProximity } from '@capgo/capacitor-proximity';
await CapacitorProximity.enable();disable
セクションのタイトルは “disable”近接モニタリングを無効にします。
この機能はアプリのデフォルトのウィンドウの動作を復元し、センサー監視を停止します。
import { CapacitorProximity } from '@capgo/capacitor-proximity';
await CapacitorProximity.disable();getStatus
セクションのタイトルは “getStatus”現在のセンサー利用可能性とプラグインの有効状態を取得します。
import { CapacitorProximity } from '@capgo/capacitor-proximity';
const status = await CapacitorProximity.getStatus();タイプ リファレンス
セクションのタイトルは “Type Reference”ProximityStatusResult
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
PluginVersionResultプラグイン バージョンを要求したときに返される結果
export interface PluginVersionResult { /** * Native plugin version string. * * @since 0.0.1 */ version: string;}ソース オブ トゥルース
ソース オブ トゥルースこのページはプラグインの src/definitions.tsパブリック API がアップストリームで変更されたときに再度 Sync を実行してください。
Getting Started から続けて
Getting Started から続けてCapgoを使用している場合 Getting Started APIと連携することで、ダッシュボードとAPIの操作を計画できます。 capgo/capacitor-proximityを使用することで、native capabilityを実現します。 for the native capability in Using @capgo/capacitor-proximity, API Overviewの実装詳細を参照してください。 for the implementation detail in API Overview, Introductionの実装詳細を参照してください。 __CAPGO_KEEP_0__ Keys API Keysの実装詳細を参照してください。 for the implementation detail in API Keys, and __CAPGO_KEEP_0__と__CAPGO_KEEP_1__を使用して、デバイスを管理します。 __CAPGO_KEEP_0__の実装詳細については、デバイスのページを参照してください。