近接 __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
センサーの現在の利用可能性とプラグインの有効状態を取得します。コピー
import { CapacitorProximity } from '@capgo/capacitor-proximity';
const status = await CapacitorProximity.getStatus();タイトル「型の参照」
Type ReferenceProximityStatusResult
「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 を再度同步してください。
「Getting Started」から続けてください
「Getting Started」から続けてくださいセクションあなたが使用している場合 Getting Started ダッシュボードとAPIの操作を計画するには @capgo/capacitor-proximityを使用 @capgo/capacitor-proximityのネイティブ機能のために APIの概要 APIの実装詳細について 導入 導入の実装詳細について APIのキー APIのキーについての実装詳細、そして デバイス __CAPGO_KEEP_0__の実装詳細についての情報は、デバイスのページにあります。