메뉴로 이동

Getting Started

GitHub

You can use our AI-Assisted Setup to install the plugin. Add the Capgo skills to your AI tool using the following command:

터미널 창
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-ibeacon
bunx cap sync
import { CapacitorIbeacon } from '@capgo/capacitor-ibeacon';

__CAPGO_KEEP_0__을 위한 지역에 대한 비콘 모니터링 시작.

import { CapacitorIbeacon } from '@capgo/capacitor-ibeacon';
await CapacitorIbeacon.startMonitoringForRegion({
identifier: 'MyBeaconRegion',
uuid: 'B9407F30-F5F8-466E-AFF9-25556B57FE6D'
});

stopMonitoringForRegion

__CAPGO_KEEP_1__

__CAPGO_KEEP_0__을 위한 지역에 대한 비콘 모니터링 중지.

import { CapacitorIbeacon } from '@capgo/capacitor-ibeacon';
await CapacitorIbeacon.stopMonitoringForRegion({
identifier: 'MyBeaconRegion',
uuid: 'B9407F30-F5F8-466E-AFF9-25556B57FE6D'
});

startRangingBeaconsInRegion

__CAPGO_KEEP_2__

__CAPGO_KEEP_0__을 위한 지역에 비콘을 검색 시작.

import { CapacitorIbeacon } from '@capgo/capacitor-ibeacon';
await CapacitorIbeacon.startRangingBeaconsInRegion({
identifier: 'MyBeaconRegion',
uuid: 'B9407F30-F5F8-466E-AFF9-25556B57FE6D'
});

stopRangingBeaconsInRegion

__CAPGO_KEEP_3__

__CAPGO_KEEP_0__을 위한 지역에 비콘을 검색 중지.

import { CapacitorIbeacon } from '@capgo/capacitor-ibeacon';
await CapacitorIbeacon.stopRangingBeaconsInRegion({
identifier: 'MyBeaconRegion',
uuid: 'B9407F30-F5F8-466E-AFF9-25556B57FE6D'
});

startAdvertising

__CAPGO_KEEP_4__

iOS만 지원하는 iBeacon 장치로 광고하기

import { CapacitorIbeacon } from '@capgo/capacitor-ibeacon';
await CapacitorIbeacon.startAdvertising({
uuid: 'B9407F30-F5F8-466E-AFF9-25556B57FE6D',
major: 1,
minor: 2,
identifier: 'MyBeacon'
});

stopAdvertising

광고 중지

iOS만 지원하는 iBeacon 장치로 광고 중지하기

import { CapacitorIbeacon } from '@capgo/capacitor-ibeacon';
await CapacitorIbeacon.stopAdvertising();

requestWhenInUseAuthorization

사용 중인 경우 위치 권한 요청

위치 범위/감시를 위해 필요합니다. 사용 중인 경우 위치 권한 요청하기

import { CapacitorIbeacon } from '@capgo/capacitor-ibeacon';
const { status } = await CapacitorIbeacon.requestWhenInUseAuthorization();
console.log('Authorization status:', status);

requestAlwaysAuthorization

항상 위치 권한 요청

배경 감시를 위해 항상 위치 권한 요청하기

import { CapacitorIbeacon } from '@capgo/capacitor-ibeacon';
const { status } = await CapacitorIbeacon.requestAlwaysAuthorization();
console.log('Authorization status:', status);

getAuthorizationStatus

권한 상태 가져오기

__CAPGO_KEEP_0__ 허가 상태를 확인합니다.

import { CapacitorIbeacon } from '@capgo/capacitor-ibeacon';
const { status } = await CapacitorIbeacon.getAuthorizationStatus();
console.log('Current status:', status);

isBluetoothEnabled

__CAPGO_KEEP_0__ 섹션

__CAPGO_KEEP_1__ 장치에서 블루투스를 활성화했는지 확인합니다.

import { CapacitorIbeacon } from '@capgo/capacitor-ibeacon';
const { enabled } = await CapacitorIbeacon.isBluetoothEnabled();
if (!enabled) {
console.log('Please enable Bluetooth');
}

isRangingAvailable

__CAPGO_KEEP_2__ 섹션

__CAPGO_KEEP_3__ 장치에서 범위가 사용 가능한지 확인합니다.

import { CapacitorIbeacon } from '@capgo/capacitor-ibeacon';
const { available } = await CapacitorIbeacon.isRangingAvailable();
if (available) {
console.log('Ranging is supported');
}

enableARMAFilter

__CAPGO_KEEP_4__ 섹션

__CAPGO_KEEP_5__ (안드로이드 전용) 거리 계산에 ARMA 필터링을 활성화합니다.

import { CapacitorIbeacon } from '@capgo/capacitor-ibeacon';
await CapacitorIbeacon.enableARMAFilter({
enabled: true
});

enableBackgroundMode

__CAPGO_KEEP_6__ 섹션

배경 비콘 스캔 모드 활성화 또는 비활성화 (Android만). 이 옵션은 신뢰할 수 있는 배경 비콘 감지를 위해 전면 서비스를 활성화합니다. '항상' 위치 권한 요청 후에 호출해야 합니다.

import { CapacitorIbeacon } from '@capgo/capacitor-ibeacon';
// Enable background mode for beacon scanning
await CapacitorIbeacon.enableBackgroundMode({ enabled: true });
// Disable background mode
await CapacitorIbeacon.enableBackgroundMode({ enabled: false });

setBackgroundScanPeriod

setBackgroundScanPeriod

배경 스캔 기간 설정 (Android만). 배경에서 비콘을 스캔하는 빈도와 기간을 제어합니다.

import { CapacitorIbeacon } from '@capgo/capacitor-ibeacon';
// Set background scan to 10 seconds every 30 seconds
await CapacitorIbeacon.setBackgroundScanPeriod({
scanPeriod: 10000, // 10 seconds of scanning
betweenScanPeriod: 30000 // 30 seconds between scans
});

타입 참조

타입 참조

클립보드에 복사

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

비콘 광고 옵션 (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

__CAPGO_KEEP_1__

__CAPGO_KEEP_2__

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_3__

export interface RangingEventData {
/**
* Region that was ranged.
*/
region: BeaconRegion;
/**
* Array of detected beacons.
*/
beacons: Beacon[];
}

MonitoringEventData

__CAPGO_KEEP_1__

__CAPGO_KEEP_4__

export interface MonitoringEventData {
/**
* Region that triggered the event.
*/
region: BeaconRegion;
/**
* Event state: 'enter' or 'exit'.
*/
state: 'enter' | 'exit';
}

__CAPGO_KEEP_6__

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를 사용하여 대시보드와 __CAPGO_KEEP_0__를 계획하고 운영하세요. 이 플러그인을 Using @API/__CAPGO_KEEP_1__-ibeacon Using @capgo/capacitor-ibeacon 플러그인을 사용하여 for the native capability in Using @capgo/capacitor-ibeacon, API 개요 API 개요의 구현 세부 정보를 위해 소개 소개의 구현 세부 정보를 위해 API 키 API 키의 구현 세부 정보를 위해, 및 장치 장치의 구현 세부 정보를 위해.