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.
インストール
「インストール」のセクションCapgoのAIアシストセットアップを使用してプラグインをインストールできます。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.手動設定を使用する場合は、以下のコマンドを実行して、下記のプラットフォーム固有の手順に従ってください:
bun add @capgo/capacitor-proximitybunx cap syncインポート
「インポート」のセクションimport { CapacitorProximity } from '@capgo/capacitor-proximity';APIの概要
「APIの概要」のセクションenable
「有効化」のセクション近接モニタリングを有効にします。
On iOS では有効になります。 UIDevice.isProximityMonitoringEnabledOn Android ではセンサーを監視するよう始まります。 TYPE_PROXIMITY センサーがカバーされている間、現在のアプリウィンドウを暗くします。
import { CapacitorProximity } from '@capgo/capacitor-proximity';
await CapacitorProximity.enable();disable
セクション「無効」近接モニタリングを無効にします。
デフォルトのアプリウィンドウの動作を復元し、センサー監視を停止します。
import { CapacitorProximity } from '@capgo/capacitor-proximity';
await CapacitorProximity.disable();getStatus
セクション「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;}真実の源
真実の源このページはプラグインの src/definitions.ts再同期を実行してください。 公開 API がアップストリームで変更されたとき
続けて、Getting Started
Section titled “Getting Startedを続ける”Capgoを使用している場合 Getting Started を使用してダッシュボードとAPIの操作を計画する Using @capgo/capacitor-proximity Using @capgo/capacitor-proximity API まとめ API Overview Introduction Introduction API キー API Keys デバイス __CAPGO_KEEP_0__の実装詳細についてはデバイスを参照してください。