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-updater`
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/updater/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-updater` plugin in my project.만약 Manual Setup을 선호한다면, 플러그인을 설치하기 위해 다음 명령어를 실행하고 아래의 플랫폼별 지침을 따르세요:
bun add @capgo/capacitor-updaterbunx cap syncyarn add @capgo/capacitor-updaterbunx cap syncpnpm add @capgo/capacitor-updaterbunx cap syncbun add @capgo/capacitor-updaterbunx cap sync빠른 시작
Quick Start대부분의 사용자에게는 __CAPGO_KEEP_0__ main Quickstart guide 주로 플러그인 설치 및 Capgo 클라우드 통합을 다룹니다.
이 시작 가이드는 기술적인 플러그인 세부 사항에 중점을 두고 있습니다. 이 가이드는 고급 사용자에게서 이해하는 underlying 메커니즘 또는 self-hosted 업데이트를 implement하는 데 도움이 됩니다.
개요
OverviewCapacitor 업데이터 플러그인은 Capacitor 애플리케이션에 대한 over-the-air (OTA) 업데이트를 지원합니다. 이 기능을 사용하면 앱 스토어 리뷰를 거치지 않고 앱 업데이트를 푸시할 수 있습니다.
작동 방식
How It Works- __CAPGO_KEEP_0__ 업데이터 플러그인은 __CAPGO_KEEP_1__ 애플리케이션에 대한 over-the-air (OTA) 업데이트를 지원합니다. 이 기능을 사용하면 앱 스토어 리뷰를 거치지 않고 앱 업데이트를 푸시할 수 있습니다. : 업데이트 플러그인은 웹 자산이 포함된 ZIP 파일인 업데이트 번들 (bundle)을 다운로드합니다.
- 추출: 번들은 기기의 저장소에 추출됩니다.
- 핫 리로드: 앱은 재시작 없이 새로운 번들로 Switch합니다.
- 폴백: 업데이트가 실패하면 앱은 이전에 작동하던 버전으로 돌아갑니다.
1. 자동 업데이트 모드 (권장)
Section titled “1. 자동 업데이트 모드 (권장)”자동 업데이트 관리와 함께 플러그인을 사용하는 가장 쉬운 방법입니다.
import { CapacitorUpdater } from '@capgo/capacitor-updater';
// Plugin handles everything automatically// Configure in capacitor.config.ts앱에 추가 capacitor.config.ts:
{ plugins: { CapacitorUpdater: { autoUpdate: 'atBackground', updateUrl: 'https://your-update-server.com/api/updates' } }}2. 수동 모드
2. 수동 모드 섹션업데이트 프로세스에 대한 고급 제어를 위해:
import { CapacitorUpdater } from '@capgo/capacitor-updater';
// Download an updateconst bundle = await CapacitorUpdater.download({ url: 'https://your-server.com/updates/v1.0.1.zip', version: '1.0.1'});
// Set the bundle (will be used on next app start)await CapacitorUpdater.set({ id: bundle.id});
// Or reload immediatelyawait CapacitorUpdater.reload();플랫폼 설정
iOSiOS
안드로이드
안드로이드추가 설정이 필요하지 않습니다. 플러그인은 box에서 작동합니다.
API 기본 사용
API 기본 사용업데이트 다운로드
업데이트 다운로드import { CapacitorUpdater } from '@capgo/capacitor-updater';
const bundle = await CapacitorUpdater.download({ url: 'https://example.com/update.zip', version: '1.0.1'});
console.log('Downloaded bundle:', bundle.id);활성 배포본 설정
활성 배포본 설정// Set bundle to be used on next app startawait CapacitorUpdater.set({ id: bundle.id});새로운 배포본으로 다시 로드
새로운 패키지로 리로드하기// Reload app immediately with new bundleawait CapacitorUpdater.reload();패키지 목록
패키지 목록const { bundles } = await CapacitorUpdater.list();console.log('Available bundles:', bundles);패키지 삭제
패키지 삭제await CapacitorUpdater.delete({ id: 'bundle-id'});현재 패키지 가져오기
현재 패키지 가져오기const { bundle } = await CapacitorUpdater.current();console.log('Current bundle:', bundle.version);이벤트 리스너
이벤트 리스너업데이트 이벤트를 듣기:
import { CapacitorUpdater } from '@capgo/capacitor-updater';
// Listen for download progressCapacitorUpdater.addListener('download', (info) => { console.log('Download progress:', info.percent);});
// Listen for download completionCapacitorUpdater.addListener('downloadComplete', (bundle) => { console.log('Download complete:', bundle.version);});
// Listen for update failuresCapacitorUpdater.addListener('updateFailed', (error) => { console.error('Update failed:', error);});
// Listen for successful updatesCapacitorUpdater.addListener('updateAvailable', (info) => { console.log('Update available:', info.version);});설정 옵션
설정 옵션설정에서 플러그인을 구성하세요. capacitor.config.ts:
{ plugins: { CapacitorUpdater: { // Auto-update settings autoUpdate: 'atBackground', updateUrl: 'https://api.example.com/updates',
// Update behavior resetWhenUpdate: true,
// Version settings version: '1.0.0',
// Security allowModifyUrl: false,
// Stats collection statsUrl: 'https://api.example.com/stats',
// Channel (for Capgo cloud) defaultChannel: 'production' } }}설정 옵션과 함께 Capgo Cloud
Section titled “With Capgo Cloud”__CAPGO_KEEP_0__
// Install the Capgo CLIbun add -g @capgo/cli
// Login to Capgonpx @capgo/cli login
// Upload your first bundlenpx @capgo/cli bundle upload
// The plugin auto-updates from Capgo cloud자세한 내용은 기본적인 Quickstart 가이드
자세한 내용은
Self-Hosted Updates자신의 업데이트 서버를 호스팅하세요:
// Configure your update endpoint{ plugins: { CapacitorUpdater: { autoUpdate: 'atBackground', updateUrl: 'https://your-server.com/api/check-update' } }}서버는 다음을 반환해야 합니다:
{ "version": "1.0.1", "url": "https://your-server.com/updates/1.0.1.zip"}자세한 내용은 Self-Hosted Mode 업데이트에 대한 자세한 내용은 여기서 확인하실 수 있습니다.
수동 업데이트 흐름
수동 업데이트 흐름업데이트에 대한 완전한 제어:
import { CapacitorUpdater } from '@capgo/capacitor-updater';
async function checkAndUpdate() { // Check for updates from your server const response = await fetch('https://api.example.com/check-update'); const { version, url } = await response.json();
// Download the update const bundle = await CapacitorUpdater.download({ url, version });
// Notify bundle is ready await CapacitorUpdater.notifyAppReady();
// Set as next version await CapacitorUpdater.set({ id: bundle.id });
// Reload when ready await CapacitorUpdater.reload();}최선의 방법
수동 업데이트 흐름- 앱이 성공적으로 로드되면 항상 호출
notifyAppReady()업데이트를 테스트하기 전에 프로덕션으로 푸시하기 전에 반드시 테스트하십시오. - 네트워크 오류에 대한 적절한 오류 처리를 구현하십시오.
- 버전 번호를 일관되게 사용하십시오.
- 클립보드에 복사
- 다운로드 속도가 빠른 작은 패키지 크기를 유지하세요
- 업데이트 성공률을 모니터링하세요
- Plugin API Reference 플러그인 API 참조
- 플러그인 __CAPGO_KEEP_0__ 문서를 완료하세요 플러그인 설정
- 모든 구성 옵션 이벤트
- 업데이트 가능한 이벤트 자체 호스팅 모드
- 개발 환경 - 로컬 업데이트 테스트
- 디버깅 - 문제 해결 가이드
지원
지원- 지원 알려진 문제
- GitHub Discussions __CAPGO_KEEP_0__ 토론
- - 커뮤니티 지원 디스코드 (Discord) - 실시간 채팅
다음 단계로 진행하세요
다음 단계로 진행하세요Capacitor를 사용 중이라면 Getting Started Capacitor를 사용 중이라면 Capgo 업데이터와 연결하세요 Using @capgo/capacitor-updater for the native capability in Using @capgo/capacitor-updater, Capgo Plugin Directory for the product workflow in Capgo Plugin Directory, Capacitor Plugins by Capgo for the implementation detail in Capacitor Plugins by Capgo, __CAPGO_KEEP_0__ 업데이트 플러그인 구축에 대한 구현 세부 정보는 Adding or Updating Plugins 항목에서 찾을 수 있으며 아이온 enterprise 플러그인 대체 항목 아이온 enterprise 플러그인 워크플로에 대한 제품 워크플로는 Ionic Enterprise Plugin Alternatives 항목에서 찾을 수 있습니다.