コンテンツにジャンプ

Getting Started

GitHub

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.

Manual Setup を使用する場合は、以下のコマンドを実行してプラットフォーム固有の指示に従ってください:

ターミナル画面
bun add @capgo/capacitor-proximity
bunx cap sync
import { CapacitorProximity } from '@capgo/capacitor-proximity';

__CAPGO_KEEP_0__を有効にします。

__CAPGO_KEEP_1__でiOSを有効にすると UIDevice.isProximityMonitoringEnabled. __CAPGO_KEEP_2__でAndroidを有効にすると TYPE_PROXIMITY __CAPGO_KEEP_3__を有効にすると、現在のアプリウィンドウは暗くされます。

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

__CAPGO_KEEP_6__を無効にします。

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

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

__CAPGO_KEEP_4__をクリップボードにコピー

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

ソース オブ トゥース

このページはプラグインの

パブリック __CAPGO_KEEP_0__ がアップストリームで変更されたときに再度同期してください。 src/definitions.ts. Re-run the sync when the public API changes upstream.

__CAPGO_KEEP_0__を使用している場合 Getting Started APIを使用してダッシュボードとAPIの操作を計画する場合、APIを接続してください capgo/capacitor-proximityを使用して@capgo/capacitor-proximity native capabilityの@capgo/capacitor-proximityの実装詳細 API Overview API Overviewの実装詳細 Introduction Introductionの実装詳細 API Keys APIの実装詳細については、 デバイス __CAPGO_KEEP_0__の実装詳細については、デバイス.