Skip to content

Getting Started

터미널 창
bun add @capgo/capacitor-proximity
bunx cap sync
import { CapacitorProximity } from '@capgo/capacitor-proximity';

근접 센서 모니터링을 활성화합니다.

iOS에서 이 기능을 활성화하면 UIDevice.isProximityMonitoringEnabledAndroid에서 이 기능은 센서를 감지하기 시작하고 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

Type Reference 섹션

ProximityStatusResult

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

Source Of Truth

Source Of Truth 섹션

이 페이지는 플러그인의 소스에서 생성됩니다. src/definitions.ts. upstream의 API이 변경되면 다시 싱크를 실행하세요.

Getting Started에서 계속

Getting Started에서 계속하는 섹션

Capgo를 사용 중이라면 Getting Started 대시보드와 Capgo의 API를 계획하고 운영하기 위해 Capgo의 @capgo/capacitor-proximity를 사용하세요. Capgo의 @capgo/capacitor-proximity를 사용하는 native capability에 대한 설명 Capgo의 API Overview Capgo의 API Overview에 대한 implementation detail 소개 소개에 대한 implementation detail API 키 implementation 세부 정보에 대한 API 키 장치 implementation 세부 정보에 대한 장치.