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-mqtt`
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/mqtt/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-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-mqtt` plugin in my project.Copy to clipboard
bun add @capgo/capacitor-mqttbunx cap syncCopy to clipboard
Importimport { MqttBridge } from '@capgo/capacitor-mqtt';API Overview
API 개요"connect"라는 제목의 섹션
import { MqttBridge } from '@capgo/capacitor-mqtt';
await MqttBridge.connect({} as { serverURI: string; port: number; clientId: string; username: string; password: string; setCleanSession: boolean; connectionTimeout: number; keepAliveInterval: number; setAutomaticReconnect: boolean; setLastWill?: { willTopic: string; willPayload: string; willQoS: number; setRetained: boolean; }; });disconnect
연결 끊기현재 계약의 소스 정의를 참조하세요.
import { MqttBridge } from '@capgo/capacitor-mqtt';
await MqttBridge.disconnect();subscribe
구독현재 계약의 소스 정의를 참조하세요.
import { MqttBridge } from '@capgo/capacitor-mqtt';
await MqttBridge.subscribe({} as { topic: string; qos: number });publish
게시현재 계약의 소스 정의를 참조하세요.
import { MqttBridge } from '@capgo/capacitor-mqtt';
await MqttBridge.publish({} as { topic: string; payload: string; qos: number; retained: boolean });타입 참조
타입 참조onConnectionLostListener
연결 끊기 리스너export type onConnectionLostListener = (x: { connectionStatus: string; reasonCode: number; message: string }) => void;onConnectCompleteListener
onConnectCompleteListenerexport type onConnectCompleteListener = (x: { reconnected: boolean; serverURI: string }) => void;onMessageArrivedListener
onMessageArrivedListenerexport type onMessageArrivedListener = (x: { topic: string; message: string }) => void;실질적인 원천
실질적인 원천이 페이지는 플러그인의 src/definitions.tsAPI이 업스트림에서 변경될 때 다시 싱크를 실행하세요.
Getting Started에서 계속하기
Getting Started에서 계속하기이 페이지는 플러그인의 If you are using 시작하기 API 대시보드를 계획하고 API 운영을 위해 연결하세요. @capgo/capacitor-mqtt 사용 native 기능을 사용하는 @capgo/capacitor-mqtt API 개요 API 개요의 구현 세부 정보 소개 소개의 구현 세부 정보 API 키 API 키의 구현 세부 정보 장치 장치의 구현 세부 정보