コンテンツにジャンプ

近接 __CAPGO_KEEP_0__ リポジトリ

GitHub

Capgoの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.

__CAPGO_KEEP_0__の場合、プラグインをインストールするには、以下のコマンドを実行し、下記のプラットフォーム固有の説明を参照してください。

ターミナルウィンドウ
bun add @capgo/capacitor-proximity
bunx cap sync
import { CapacitorProximity } from '@capgo/capacitor-proximity';

iOSではこの設定で近接監視を有効化します。

iOSではこの設定で近接監視を有効化します。 UIDevice.isProximityMonitoringEnabled. 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

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

PluginVersionResult

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

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

ソース オブ トゥルース

ソース オブ トゥルース

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

Getting Started から続けて

Getting Started から続けて

Capgoを使用している場合 Getting Started APIと連携することで、ダッシュボードとAPIの操作を計画できます。 capgo/capacitor-proximityを使用することで、native capabilityを実現します。 for the native capability in Using @capgo/capacitor-proximity, API Overviewの実装詳細を参照してください。 for the implementation detail in API Overview, Introductionの実装詳細を参照してください。 __CAPGO_KEEP_0__ Keys API Keysの実装詳細を参照してください。 for the implementation detail in API Keys, and __CAPGO_KEEP_0__と__CAPGO_KEEP_1__を使用して、デバイスを管理します。 __CAPGO_KEEP_0__の実装詳細については、デバイスのページを参照してください。