__CAPGO_KEEP_5__
설치 단계와 이 플러그인에 대한 전체 마크다운 가이드를 포함한 설정 프롬프트를 복사하세요.
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.
설치
설치bun add @capgo/capacitor-ibeaconbunx cap syncImport
Importimport { CapacitorIbeacon } from '@capgo/capacitor-ibeacon';API 개요
API 개요startMonitoringForRegion
__CAPGO_KEEP_0__ 시작지역에 들어오거나 나갈 때 이벤트를 트리거하는 지역을 시작합니다.
import { CapacitorIbeacon } from '@capgo/capacitor-ibeacon';
await CapacitorIbeacon.startMonitoringForRegion({ identifier: 'MyBeaconRegion', uuid: 'B9407F30-F5F8-466E-AFF9-25556B57FE6D'});stopMonitoringForRegion
__CAPGO_KEEP_0__ 중지지역을 중지합니다.
import { CapacitorIbeacon } from '@capgo/capacitor-ibeacon';
await CapacitorIbeacon.stopMonitoringForRegion({ identifier: 'MyBeaconRegion', uuid: 'B9407F30-F5F8-466E-AFF9-25556B57FE6D'});startRangingBeaconsInRegion
__CAPGO_KEEP_0__ 시작지역 내에서 비콘의 거리 정보를 지속적으로 업데이트합니다.
import { CapacitorIbeacon } from '@capgo/capacitor-ibeacon';
await CapacitorIbeacon.startRangingBeaconsInRegion({ identifier: 'MyBeaconRegion', uuid: 'B9407F30-F5F8-466E-AFF9-25556B57FE6D'});stopRangingBeaconsInRegion
__CAPGO_KEEP_0__ 중지범위 내 비콘을 중지합니다.
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’ 섹션위치 권한을 요청합니다. (범위 내 비콘/모니터링을 위해 필요)
import { CapacitorIbeacon } from '@capgo/capacitor-ibeacon';
const { status } = await CapacitorIbeacon.requestWhenInUseAuthorization();console.log('Authorization status:', status);requestAlwaysAuthorization
‘requestAlwaysAuthorization’ 섹션Request “Always” 위치 권한 (배경 모니터링을 위해 필요함).
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장치의 블루투스를 확인
import { CapacitorIbeacon } from '@capgo/capacitor-ibeacon';
const { enabled } = await CapacitorIbeacon.isBluetoothEnabled();if (!enabled) { console.log('Please enable Bluetooth');}isRangingAvailable
isRangingAvailable장치의 범위가 사용 가능한지 확인
import { CapacitorIbeacon } from '@capgo/capacitor-ibeacon';
const { available } = await CapacitorIbeacon.isRangingAvailable();if (available) { console.log('Ranging is supported');}enableARMAFilter
enableARMAFilter__CAPGO_KEEP_0__ (Android 전용)에서 거리 계산을 위해 ARMA 필터링을 활성화합니다.
import { CapacitorIbeacon } from '@capgo/capacitor-ibeacon';
await CapacitorIbeacon.enableARMAFilter({ enabled: true});enableBackgroundMode
__CAPGO_KEEP_0____CAPGO_KEEP_0__ (Android 전용)에서 배경 스캔 모드를 활성화하거나 비활성화합니다. 배경 비컨 감지를 위한 신뢰할 수 있는 전면 서비스를 활성화합니다. '항상' 위치 권한을 요청한 후에 호출해야 합니다.
import { CapacitorIbeacon } from '@capgo/capacitor-ibeacon';
// Enable background mode for beacon scanningawait CapacitorIbeacon.enableBackgroundMode({ enabled: true });
// Disable background modeawait CapacitorIbeacon.enableBackgroundMode({ enabled: false });setBackgroundScanPeriod
__CAPGO_KEEP_0____CAPGO_KEEP_0__ (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});__CAPGO_KEEP_0__
__CAPGO_KEEP_0__BeaconRegion
__CAPGO_KEEP_0____CAPGO_KEEP_0__
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
__CAPGO_KEEP_1____CAPGO_KEEP_2__
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
__CAPGO_KEEP_1____CAPGO_KEEP_3__
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
__CAPGO_KEEP_1____CAPGO_KEEP_4__
export interface RangingEventData { /** * Region that was ranged. */ region: BeaconRegion;
/** * Array of detected beacons. */ beacons: Beacon[];}MonitoringEventData
__CAPGO_KEEP_1____CAPGO_KEEP_5__
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.tsAPI이 업스트림에서 변경될 때마다 다시 싱크를 실행하세요.
Getting Started에서 계속하기
' Getting Started에서 계속하기 ' 섹션__CAPGO_KEEP_0__이 업스트림에서 변경될 때마다 다시 싱크를 실행하세요. Getting Started에서 시작하는 경우 대시보드와 API 운영을 계획하고 연결하세요. Using @capgo/capacitor-ibeacon Using @capgo/capacitor-ibeacon API 개요 API 개요 소개 소개 API 키 API 키 기기 기기