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.
インストール
「インストール」のセクション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.Manual Setup を使用する場合は、以下のコマンドを実行してプラットフォーム固有の指示に従ってください:
bun add @capgo/capacitor-proximitybunx cap syncインポート
「インポート」のセクションimport { CapacitorProximity } from '@capgo/capacitor-proximity';API の概要
「API の概要」のセクションenable
「有効化」のセクション__CAPGO_KEEP_0__を有効にします。
__CAPGO_KEEP_1__でiOSを有効にすると UIDevice.isProximityMonitoringEnabled.
__CAPGO_KEEP_2__でAndroidを有効にすると TYPE_PROXIMITY __CAPGO_KEEP_3__を有効にすると、現在のアプリウィンドウは暗くされます。
import { CapacitorProximity } from '@capgo/capacitor-proximity';
await CapacitorProximity.enable();disable
__CAPGO_KEEP_5____CAPGO_KEEP_6__を無効にします。
__CAPGO_KEEP_7__でデフォルトのアプリウィンドウの動作を復元し、センサーの監視を停止します。
import { CapacitorProximity } from '@capgo/capacitor-proximity';
await CapacitorProximity.disable();getStatus
__CAPGO_KEEP_8____CAPGO_KEEP_4__をクリップボードにコピー
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 native capabilityの@capgo/capacitor-proximityの実装詳細 API Overview API Overviewの実装詳細 Introduction Introductionの実装詳細 API Keys APIの実装詳細については、 デバイス __CAPGO_KEEP_0__の実装詳細については、デバイス.