__CAPGO_KEEP_3__

Getting Started

GitHub

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-proximity
bunx cap sync
import { CapacitorProximity } from '@capgo/capacitor-proximity';

近接モニタリングを有効にします。

On iOS では有効になります。 UIDevice.isProximityMonitoringEnabledOn Android ではセンサーを監視するよう始まります。 TYPE_PROXIMITY センサーがカバーされている間、現在のアプリウィンドウを暗くします。

import { CapacitorProximity } from '@capgo/capacitor-proximity';
await CapacitorProximity.enable();

近接モニタリングを無効にします。

デフォルトのアプリウィンドウの動作を復元し、センサー監視を停止します。

import { CapacitorProximity } from '@capgo/capacitor-proximity';
await CapacitorProximity.disable();

現在のセンサー利用可能性とプラグイン有効状態を取得します。

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';
}

プラグインバージョンを要求したときに返される結果

export interface PluginVersionResult {
/**
* Native plugin version string.
*
* @since 0.0.1
*/
version: string;
}

真実の源

真実の源

このページはプラグインの src/definitions.ts再同期を実行してください。 公開 API がアップストリームで変更されたとき

Capgoを使用している場合 Getting Started を使用してダッシュボードとAPIの操作を計画する Using @capgo/capacitor-proximity Using @capgo/capacitor-proximity API まとめ API Overview Introduction Introduction API キー API Keys デバイス __CAPGO_KEEP_0__の実装詳細についてはデバイスを参照してください。