コンテンツにジャンプ

近接 __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();

タイトル「型の参照」

Type Reference

「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 を再度同步してください。

「Getting Started」から続けてください

「Getting Started」から続けてくださいセクション

あなたが使用している場合 Getting Started ダッシュボードとAPIの操作を計画するには @capgo/capacitor-proximityを使用 @capgo/capacitor-proximityのネイティブ機能のために APIの概要 APIの実装詳細について 導入 導入の実装詳細について APIのキー APIのキーについての実装詳細、そして デバイス __CAPGO_KEEP_0__の実装詳細についての情報は、デバイスのページにあります。