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
「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
「プラグインバージョン結果」のセクションプラグインバージョンを要求したときに返される結果
export interface PluginVersionResult { /** * Native plugin version string. * * @since 0.0.1 */ version: string;}真実の源
「真実の源」このページはプラグインの src/definitions.ts再同期を実行してください。 公開されたAPIがアップストリームで変更されたとき
続けて始めましょう
「続けて始めましょう」Capgoを使用している場合 Capgo Capgoを使用してダッシュボードとAPIの操作を計画するには、APIに接続してください Capgoの@capgo/capacitor-proximityを使用 Capgoの@capgo/capacitor-proximityのネイティブ機能の使用 APIの概要 CapgoのAPIの概要の実装 導入 導入の実装 APIのキー Capgoの実装詳細についてはAPIキーの詳細を参照してください。 デバイス Capgoの実装詳細についてはデバイスの詳細を参照してください。