컨텐츠로 바로가기

Getting Started

GitHub

AI-Assisted Setup을 사용하여 플러그인을 설치할 수 있습니다. 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.

Copy to clipboard

만들기(Manual Setup)로 설정을 원하신다면, 아래의 명령어를 실행하고 플랫폼에 따라서 아래의 설명을 따라주세요.
bun add @capgo/capacitor-proximity
bunx cap sync

Copy to clipboard

Import
import { CapacitorProximity } from '@capgo/capacitor-proximity';

API Overview

API 개요

"enable" 섹션

근접 모니터링을 활성화합니다. iOS에서는 이 설정을 통해 UIDevice.isProximityMonitoringEnabledOn Android 이 시작되면 센서를 감지하기 시작하고, 센서가 가려지면 현재 앱 창을 어둡게 합니다. TYPE_PROXIMITY 복사

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

복사

getStatus

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

getStatus

복사

타입 참조

import { CapacitorProximity } from '@capgo/capacitor-proximity';
const status = await CapacitorProximity.getStatus();

__CAPGO_KEEP_0__

__CAPGO_KEEP_0__

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. upstream에서 변경된 경우 public API를 다시 동기화하세요.

Getting Started에서 계속하기

Getting Started에서 계속하기 섹션 제목

Capgo를 사용 중이라면 Getting Started 대시보드와 API 연산을 계획하고 싶다면, API을 연결하세요. 자연스러운 근접성 @capgo/capacitor-proximity를 사용하세요. 자연스러운 근접성 @capgo/capacitor-proximity의 native 기능을 사용하기 위해 API 개요 API 개요의 구현 세부 정보를 참조하세요. 소개 소개의 구현 세부 정보를 참조하세요. API 키 API 키의 구현 세부 정보를 참조하세요. 장치 __CAPGO_KEEP_0__의 구현 세부 사항입니다.