Getting Started
복사할 수 있는 지시문으로 설치 단계와 이 플러그인의 전체 마크다운 가이드를 포함한 설정 지시문을 복사하세요.
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.
설치
설치Capgo의 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-ibeacon` plugin in my project.만약 Manual Setup을 선호한다면, 플러그인을 설치하기 위해 다음 명령어를 실행하고 아래의 플랫폼별 지침을 따르세요:
bun add @capgo/capacitor-ibeaconbunx cap syncImport
Importimport { CapacitorIbeacon } from '@capgo/capacitor-ibeacon';API Overview
API OverviewstartMonitoringForRegion
Section titled “startMonitoringForRegion”Start monitoring for a beacon region. Triggers events when entering/exiting the region.
import { CapacitorIbeacon } from '@capgo/capacitor-ibeacon';
await CapacitorIbeacon.startMonitoringForRegion({ identifier: 'MyBeaconRegion', uuid: 'B9407F30-F5F8-466E-AFF9-25556B57FE6D'});stopMonitoringForRegion
Section titled “stopMonitoringForRegion”Stop monitoring for a beacon region.
import { CapacitorIbeacon } from '@capgo/capacitor-ibeacon';
await CapacitorIbeacon.stopMonitoringForRegion({ identifier: 'MyBeaconRegion', uuid: 'B9407F30-F5F8-466E-AFF9-25556B57FE6D'});startRangingBeaconsInRegion
Section titled “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’ 섹션iOS에서만 기기(디바이스)를 iBeacon으로 광고합니다.
import { CapacitorIbeacon } from '@capgo/capacitor-ibeacon';
await CapacitorIbeacon.startAdvertising({ uuid: 'B9407F30-F5F8-466E-AFF9-25556B57FE6D', major: 1, minor: 2, identifier: 'MyBeacon'});stopAdvertising
‘stopAdvertising’ 섹션iOS에서만 기기(디바이스)를 iBeacon으로 광고 중지합니다.
import { CapacitorIbeacon } from '@capgo/capacitor-ibeacon';
await CapacitorIbeacon.stopAdvertising();requestWhenInUseAuthorization
‘requestWhenInUseAuthorization’ 섹션__CAPGO_KEEP_0__ 위치 권한을 요청하세요 (범위/감시를 위해 필요합니다).
import { CapacitorIbeacon } from '@capgo/capacitor-ibeacon';
const { status } = await CapacitorIbeacon.requestWhenInUseAuthorization();console.log('Authorization status:', status);requestAlwaysAuthorization
__CAPGO_KEEP_1____CAPGO_KEEP_0__ 위치 권한을 항상 요청하세요 (배경 감시를 위해 필요합니다).
import { CapacitorIbeacon } from '@capgo/capacitor-ibeacon';
const { status } = await CapacitorIbeacon.requestAlwaysAuthorization();console.log('Authorization status:', status);getAuthorizationStatus
__CAPGO_KEEP_2__현재 위치 권한 상태를 가져오세요.
import { CapacitorIbeacon } from '@capgo/capacitor-ibeacon';
const { status } = await CapacitorIbeacon.getAuthorizationStatus();console.log('Current status:', status);isBluetoothEnabled
__CAPGO_KEEP_3__장치의 블루투스를 활성화되어 있는지 확인하세요.
import { CapacitorIbeacon } from '@capgo/capacitor-ibeacon';
const { enabled } = await CapacitorIbeacon.isBluetoothEnabled();if (!enabled) { console.log('Please enable Bluetooth');}isRangingAvailable
__CAPGO_KEEP_4__장치에서 ranging이 사용 가능한지 확인합니다.
import { CapacitorIbeacon } from '@capgo/capacitor-ibeacon';
const { available } = await CapacitorIbeacon.isRangingAvailable();if (available) { console.log('Ranging is supported');}enableARMAFilter
ARMA 필터링을 활성화하는 섹션거리 계산을 위해 ARMA 필터링을 활성화합니다 (안드로이드 전용).
import { CapacitorIbeacon } from '@capgo/capacitor-ibeacon';
await CapacitorIbeacon.enableARMAFilter({ enabled: true});enableBackgroundMode
배경 모드 활성화하는 섹션배경 비콘 스캐닝 모드를 활성화하거나 비활성화합니다 (안드로이드 전용). 정확한 배경 비콘 감지를 위해 foreground 서비스를 활성화합니다. 항상 위치 권한을 요청한 후에 호출해야 합니다.
import { CapacitorIbeacon } from '@capgo/capacitor-ibeacon';
// Enable background mode for beacon scanningawait CapacitorIbeacon.enableBackgroundMode({ enabled: true });
// Disable background modeawait CapacitorIbeacon.enableBackgroundMode({ enabled: false });setBackgroundScanPeriod
배경 스캔 기간을 설정하는 섹션배경에서 비콘을 스캔하는 빈도와 기간을 제어합니다 (안드로이드 전용).
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});타입 참조
Type ReferenceBeaconRegion
BeaconRegioniOS 및 Android에서 모니터링 및 범위 측정에 사용되는 비콘 지역 정의입니다.
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
BeaconAdvertisingOptionsiOS에서만 전송하는 비콘 광고 옵션입니다.
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
BackgroundScanPeriodOptionsAndroid에서만 사용하는 배경 스캔 기간 구성 옵션입니다.
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비콘을 범위 측정할 때 발생하는 이벤트 데이터입니다.
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공개 API이 업스트림에서 변경될 때 다시 싱크를 실행하세요.
Getting Started에서 계속하세요.
Getting Started만약에 Getting Started 계획을 세우고 API 연산을 수행하기 위해 Using @capgo/capacitor-ibeacon Using @capgo/capacitor-ibeacon API 개요 API 개요 소개 소개 API 키 API 키 장치 장치에 대한 구현 세부 정보.