ページ/エリア: Capgo マーケティング ウェブサイト。役割: ウェブサイト コピー文。見つかった場所: component doc/SignupCta.astro, component Hero.astro。
このプラグインのインストール手順とフルマークダウンガイドをコピーします。
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.手動セットアップを使用する場合は、以下のコマンドを実行してください。プラットフォーム固有の指示に従ってください。
bun add @capgo/capacitor-proximitybunx cap syncインポート
__CAPGO_KEEP_0__の概要import { CapacitorProximity } from '@capgo/capacitor-proximity';APIの概要
APIの有効化enable
近接モニタリングを有効にします。__CAPGO_KEEP_0__ Overview
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
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 Capgoを使用してダッシュボードとAPIの操作を計画する場合、Capgoに接続してください。 Capgoの@capgo/capacitor-proximityを使用して Capgoの@capgo/capacitor-proximityを使用してnative capabilityを実装する CapgoのAPI Overview CapgoのAPI Overviewを使用して実装詳細を確認する Introduction Introductionを使用して実装詳細を確認する CapgoのAPI Keys CapgoのAPI Keysを使用して実装詳細を確認する デバイス デバイスの実装詳細