시작하기
이 플러그인의 설치 단계와 전체 markdown 가이드가 포함된 설정 프롬프트를 복사하세요.
Set up this Capacitor plugin in the project.
Use the package manager already used by the project.
Install these package(s): `@capgo/capacitor-ibeacon`
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/ibeacon/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.
설치
“설치” 섹션AI 지원 설정으로 플러그인을 설치할 수 있습니다. 다음 명령어로 AI 도구에 Capgo 스킬을 추가하세요:
bunx skills add https://github.com/Cap-go/capgo-skills --skill capacitor-plugins그다음 아래 prompt를 사용하세요:
Use the `capacitor-plugins` skill from `Cap-go/capgo-skills` to install the `@capgo/capacitor-ibeacon` plugin in my project.Manual Setup을 선호한다면, 다음 명령어를 실행하여 플러그인을 설치하고 아래의 플랫폼별 지침을 따르세요:
bun add @capgo/capacitor-ibeaconbunx cap sync가져오기
“Import” 섹션import { CapacitorIbeacon } from '@capgo/capacitor-ibeacon';빠른 시작
“Quick start” 섹션import { CapacitorIbeacon } from '@capgo/capacitor-ibeacon';
await CapacitorIbeacon.startMonitoringForRegion({ identifier: 'MyBeaconRegion', uuid: 'B9407F30-F5F8-466E-AFF9-25556B57FE6D'});예시: stopMonitoringForRegion
“예시: stopMonitoringForRegion” 섹션import { CapacitorIbeacon } from '@capgo/capacitor-ibeacon';
await CapacitorIbeacon.stopMonitoringForRegion({ identifier: 'MyBeaconRegion', uuid: 'B9407F30-F5F8-466E-AFF9-25556B57FE6D'});예시: startRangingBeaconsInRegion
“예시: startRangingBeaconsInRegion” 섹션import { CapacitorIbeacon } from '@capgo/capacitor-ibeacon';
await CapacitorIbeacon.startRangingBeaconsInRegion({ identifier: 'MyBeaconRegion', uuid: 'B9407F30-F5F8-466E-AFF9-25556B57FE6D'});자주 하는 실수
“자주 하는 실수” 섹션- 리스너: 화면이 unmount될 때 핸들을 제거하세요.
- 네이티브 동기화: 실행
bunx cap sync플러그인 업그레이드 후. - 단일 진실 공급원: 신뢰
src/definitions.tsGitHub 레포지토리에서.
API 개요
“API 개요” 섹션startMonitoringForRegion
“startMonitoringForRegion” 섹션비콘 영역 모니터링을 시작합니다. 영역에 진입하거나 벗어날 때 이벤트를 발생시킵니다.
import { CapacitorIbeacon } from '@capgo/capacitor-ibeacon';
await CapacitorIbeacon.startMonitoringForRegion({ identifier: 'MyBeaconRegion', uuid: 'B9407F30-F5F8-466E-AFF9-25556B57FE6D'});stopMonitoringForRegion
“stopMonitoringForRegion” 섹션비콘 영역 모니터링을 중단합니다.
import { CapacitorIbeacon } from '@capgo/capacitor-ibeacon';
await CapacitorIbeacon.stopMonitoringForRegion({ identifier: 'MyBeaconRegion', uuid: 'B9407F30-F5F8-466E-AFF9-25556B57FE6D'});startRangingBeaconsInRegion
“startRangingBeaconsInRegion” 섹션특정 영역 내에서 비콘의 거리를 측정하기 시작합니다. 지속적인 거리 업데이트를 제공합니다.
import { CapacitorIbeacon } from '@capgo/capacitor-ibeacon';
await CapacitorIbeacon.startRangingBeaconsInRegion({ identifier: 'MyBeaconRegion', uuid: 'B9407F30-F5F8-466E-AFF9-25556B57FE6D'});stopRangingBeaconsInRegion
“stopRangingBeaconsInRegion” 섹션특정 영역 내에서 비콘의 거리 측정을 중단합니다.
import { CapacitorIbeacon } from '@capgo/capacitor-ibeacon';
await CapacitorIbeacon.stopRangingBeaconsInRegion({ identifier: 'MyBeaconRegion', uuid: 'B9407F30-F5F8-466E-AFF9-25556B57FE6D'});startAdvertising
“startAdvertising” 섹션기기를 iBeacon으로 광고하기 시작합니다 (iOS 전용).
import { CapacitorIbeacon } from '@capgo/capacitor-ibeacon';
await CapacitorIbeacon.startAdvertising({ uuid: 'B9407F30-F5F8-466E-AFF9-25556B57FE6D', major: 1, minor: 2, identifier: 'MyBeacon'});stopAdvertising
“stopAdvertising” 섹션기기의 iBeacon 광고를 중단합니다 (iOS 전용).
import { CapacitorIbeacon } from '@capgo/capacitor-ibeacon';
await CapacitorIbeacon.stopAdvertising();requestWhenInUseAuthorization
“requestWhenInUseAuthorization” 섹션“앱 사용 중” 위치 권한 요청 (ranging/monitoring에 필요).
import { CapacitorIbeacon } from '@capgo/capacitor-ibeacon';
const { status } = await CapacitorIbeacon.requestWhenInUseAuthorization();console.log('Authorization status:', status);requestAlwaysAuthorization
“requestAlwaysAuthorization” 섹션“항상 허용” 위치 권한 요청 (백그라운드 monitoring에 필요).
import { CapacitorIbeacon } from '@capgo/capacitor-ibeacon';
const { status } = await CapacitorIbeacon.requestAlwaysAuthorization();console.log('Authorization status:', status);getAuthorizationStatus
“getAuthorizationStatus” 섹션현재 위치 권한 상태를 가져옵니다.
import { CapacitorIbeacon } from '@capgo/capacitor-ibeacon';
const { status } = await CapacitorIbeacon.getAuthorizationStatus();console.log('Current status:', status);isBluetoothEnabled
“isBluetoothEnabled” 섹션기기의 Bluetooth 활성화 여부를 확인합니다.
import { CapacitorIbeacon } from '@capgo/capacitor-ibeacon';
const { enabled } = await CapacitorIbeacon.isBluetoothEnabled();if (!enabled) { console.log('Please enable Bluetooth');}isRangingAvailable
“isRangingAvailable” 섹션기기에서 ranging 기능을 사용할 수 있는지 확인합니다.
import { CapacitorIbeacon } from '@capgo/capacitor-ibeacon';
const { available } = await CapacitorIbeacon.isRangingAvailable();if (available) { console.log('Ranging is supported');}enableARMAFilter
“enableARMAFilter” 섹션거리 계산을 위한 ARMA 필터링을 활성화합니다 (Android 전용).
import { CapacitorIbeacon } from '@capgo/capacitor-ibeacon';
await CapacitorIbeacon.enableARMAFilter({ enabled: true});enableBackgroundMode
“enableBackgroundMode” 섹션백그라운드 비콘 스캔 모드를 활성화하거나 비활성화합니다 (Android 전용). 이 기능을 사용하면 안정적인 백그라운드 비콘 감지를 위해 foreground service가 실행됩니다. “Always” 위치 권한을 요청한 후에 호출해야 합니다.
import { CapacitorIbeacon } from '@capgo/capacitor-ibeacon';
// Enable background mode for beacon scanningawait CapacitorIbeacon.enableBackgroundMode({ enabled: true });
// Disable background modeawait CapacitorIbeacon.enableBackgroundMode({ enabled: false });setBackgroundScanPeriod
“setBackgroundScanPeriod” 섹션백그라운드 스캔 주기를 설정합니다 (Android 전용). 백그라운드 상태에서 기기가 비콘을 얼마나 자주, 얼마나 오래 스캔할지 제어합니다.
import { CapacitorIbeacon } from '@capgo/capacitor-ibeacon';
// Set background scan to 10 seconds every 30 secondsawait CapacitorIbeacon.setBackgroundScanPeriod({ scanPeriod: 10000, // 10 seconds of scanning betweenScanPeriod: 30000 // 30 seconds between scans});타입 참조
“타입 레퍼런스” 섹션BeaconRegion
“BeaconRegion” 섹션모니터링 및 Ranging을 위한 Beacon 영역 정의.
export interface BeaconRegion { /** * Unique identifier for this region. */ identifier: string;
/** * UUID of the beacon(s) to detect. */ uuid: string;
/** * Major value for filtering (optional). */ major?: number;
/** * Minor value for filtering (optional). */ minor?: number;
/** * Notify when device enters region (iOS only). */ notifyEntryStateOnDisplay?: boolean;
/** * Enable Android background mode for this monitoring/ranging call. * When true, the plugin will keep scanning in background using a foreground service. */ enableBackgroundMode?: boolean;}BeaconAdvertisingOptions
“BeaconAdvertisingOptions” 섹션iBeacon으로 송신하기 위한 Beacon 광고 옵션 (iOS 전용).
export interface BeaconAdvertisingOptions { /** * UUID to advertise. */ uuid: string;
/** * Major value (0-65535). */ major: number;
/** * Minor value (0-65535). */ minor: number;
/** * Identifier for the advertising beacon. */ identifier: string;
/** * Measured power (RSSI at 1 meter). Optional, defaults to -59. */ measuredPower?: number;}BackgroundScanPeriodOptions
“BackgroundScanPeriodOptions” 섹션백그라운드 스캔 주기 설정 옵션 (Android 전용).
export interface BackgroundScanPeriodOptions { /** * Duration of each scan period in milliseconds. * Default: 10000 (10 seconds) */ scanPeriod?: number;
/** * Duration between scan periods in milliseconds. * Default: 15000 (15 seconds) */ betweenScanPeriod?: number;}RangingEventData
“RangingEventData” 섹션비콘의 거리 측정(ranging) 시 발생하는 이벤트 데이터입니다.
export interface RangingEventData { /** * Region that was ranged. */ region: BeaconRegion;
/** * Array of detected beacons. */ beacons: Beacon[];}MonitoringEventData
“MonitoringEventData” 섹션리전에 진입하거나 벗어날 때 발생하는 이벤트 데이터입니다.
export interface MonitoringEventData { /** * Region that triggered the event. */ region: BeaconRegion;
/** * Event state: 'enter' or 'exit'. */ state: 'enter' | 'exit';}Beacon
“Beacon” 섹션감지된 비콘 정보입니다.
export interface Beacon { /** * Beacon UUID. */ uuid: string;
/** * Major value. */ major: number;
/** * Minor value. */ minor: number;
/** * RSSI (Received Signal Strength Indicator). */ rssi: number;
/** * Proximity: 'immediate', 'near', 'far', or 'unknown'. */ proximity: 'immediate' | 'near' | 'far' | 'unknown';
/** * Estimated distance in meters. */ accuracy: number;}기준 소스
“기준 소스” 섹션이 페이지는 플러그인의 src/definitions.ts에서 생성되었습니다. public API가 업스트림에서 변경되면 동기화를 다시 실행하세요.
Getting Started에서 계속하기
“Getting Started에서 계속하기”라는 제목의 섹션사용 중인 경우 시작하기 대시보드와 API 운영을 계획하려면, 이를 다음 항목과 연결하세요: @capgo/capacitor-ibeacon 사용하기 @capgo/capacitor-ibeacon를 사용하여 네이티브 기능을 구현할 때, API 개요 API Overview의 구현 상세 내용은 소개 Introduction의 구현 상세 내용은 API 키 API Keys의 구현 세부 사항은, 디바이스 Devices의 구현 세부 사항은.