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 Setupを使用してプラグインをインストールできます。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 syncImport
「Import」セクションimport { CapacitorProximity } from '@capgo/capacitor-proximity';APIの概要
「APIの概要」セクションenable
「enable」セクション近接モニタリングを有効にします。
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();getStatus
現在のセンサーアビリティとプラグインの有効状態を取得します。クリップボードにコピー
import { CapacitorProximity } from '@capgo/capacitor-proximity';
const status = await CapacitorProximity.getStatus();型式リファレンス
型式リファレンスProximityStatusResult
ProximityStatusResultProximityStatusResultを返します 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再同期を実行してください。 公開されたAPIがアップストリームで変更されたときに。
続けて始めましょう
「続けて始めましょう」Capacitorを使用している場合 Capacitor Capacitorを使用してダッシュボードとAPIの操作を計画する場合、APIをCapacitorに接続します。 Capacitorを使用してCapacitorの@capgo/capacitor-proximity Capacitorの@capgo/capacitor-proximity APIの概要 APIの概要 Capacitorの概要 Capacitorの概要 API Keys Capgoの実装詳細についてはAPIキーの詳細を参照してください、 デバイス Capgoの実装詳細についてはデバイスの詳細を参照してください。