컨텐츠로 바로가기

Getting Started

GitHub

__CAPGO_KEEP_11__

설치 제목

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-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'
});

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

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

__CAPGO_KEEP_0__ 지역 내 비콘 거리 측정 시작. 연속 거리 업데이트 제공.

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

__CAPGO_KEEP_0__ 지역에서 비콘을 범위하지 않습니다.

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

startAdvertising

__CAPGO_KEEP_0__ 섹션

__CAPGO_KEEP_0__를 iOS에서만 iBeacon 장치로 광고합니다.

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

__CAPGO_KEEP_0__를 iOS에서만 iBeacon 장치로 광고 중지합니다.

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

requestWhenInUseAuthorization

__CAPGO_KEEP_0__ 섹션

__CAPGO_KEEP_0__ 위치 권한을 요청합니다 (범위/감시를 위해 필요).

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

requestAlwaysAuthorization

__CAPGO_KEEP_0__ 섹션

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만 지원). __CAPGO_KEEP_0__.

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

enableBackgroundMode

__CAPGO_KEEP_0__

__CAPGO_KEEP_0__ (Android만 지원). __CAPGO_KEEP_1__ __CAPGO_KEEP_0__ __CAPGO_KEEP_1__ __CAPGO_KEEP_0__ __CAPGO_KEEP_1__ __CAPGO_KEEP_0__ __CAPGO_KEEP_1__.

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

__CAPGO_KEEP_0__

__CAPGO_KEEP_0__

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
});

__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;
}

iOS에서만 iBeacon으로 전송하는 비콘 광고 옵션입니다.

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;
}

안드로이드에서만 배경 스캔 기간 구성 옵션입니다.

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;
}

클립보드 복사

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

클립보드 복사

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

비콘 정보가 감지되었습니다.

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를 사용 중이라면 Getting Started API 대시보드와 운영을 계획하고 연결하기 위해 Using @capgo/capacitor-ibeacon capgo에서 사용하는 네이티브 기능은 Using @capgo/capacitor-ibeacon API 개요 API의 구현 세부 사항은 for the implementation detail in API Overview, __CAPGO_KEEP_0__ 소개 __CAPGO_KEEP_0__의 구현 세부 사항은 for the implementation detail in Introduction, API 키 API의 구현 세부 사항은 API Keys, and __CAPGO_KEEP_0__ 장치 __CAPGO_KEEP_0__의 구현 세부 사항은 Devices.