시작하기
__CAPGO_KEEP_0__
Set up this Capacitor plugin in the project.
Use the package manager already used by the project.
Install these package(s): `@capgo/capacitor-proximity`
Run the required Capacitor sync/update step after installation.
Read this markdown guide for the full setup steps: https://raw.githubusercontent.com/Cap-go/website/refs/heads/main/apps/docs/src/content/docs/docs/plugins/proximity/getting-started.mdx
Use that guide for platform-specific steps, native file edits, permissions, config changes, imports, and usage setup.
If that guide references other docs pages, read them too.
설치
설치bun add @capgo/capacitor-proximitybunx cap syncImport
Importimport { CapacitorProximity } from '@capgo/capacitor-proximity';enable
Section titled “enable”근접 모니터링을 활성화합니다.
iOS에서 이 옵션을 활성화하면 UIDevice.isProximityMonitoringEnabledAndroid에서 이 옵션을 활성화하면 센서가 가려질 때까지 현재 앱 창을 어둡게 합니다. TYPE_PROXIMITY 센서가 가려질 때까지 현재 앱 창을 어둡게 합니다.
import { CapacitorProximity } from '@capgo/capacitor-proximity';
await CapacitorProximity.enable();disable
“disable”라는 제목의 섹션근접 센서 모니터링을 끕니다.
기본 앱 창 동작을 복원하고 센서 모니터링을 중지합니다.
import { CapacitorProximity } from '@capgo/capacitor-proximity';
await CapacitorProximity.disable();getStatus
“getStatus”라는 제목의 섹션현재 센서 사용 가능성과 플러그인 활성화 상태를 가져옵니다.
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';}PluginVersionResult
플러그인 버전 결과 섹션플러그인 버전을 요청할 때 반환되는 결과
export interface PluginVersionResult { /** * Native plugin version string. * * @since 0.0.1 */ version: string;}진실의 근원
진실의 근원 섹션이 페이지는 플러그인의 src/definitions.ts공개 API이 업스트림에서 변경될 때 다시 싱크를 실행하세요.
시작부터 계속하세요
시작부터 계속하기__CAPGO_KEEP_0__을 사용 중이라면 시작하기 API 대시보드와 API 연산을 계획하기 위해 Using @capgo/capacitor-proximity Using @capgo/capacitor-proximity Using @API/__CAPGO_KEEP_1__-proximity API 개요 __CAPGO_KEEP_0__ 개요 소개 API Keys API 키 기기 기기 구현 세부 정보에 대한 구현 세부 정보.