내용으로 건너뛰기

업데이터 __CAPGO_KEEP_0__ 저장소

GitHub

플러그인을 설치하기 위해 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-updater
bunx cap sync

빠른 시작

Quick Start

빠른 시작 main Quickstart guide which covers both the plugin installation and Capgo cloud integration.

cloud integration

빠른 시작

Overview

The Capacitor Updater plugin enables over-the-air (OTA) updates for your Capacitor applications. This allows you to push updates to your app without going through app store reviews.

__CAPGO_KEEP_0__ 앱의 OTA 업데이트를 지원합니다.

__CAPGO_KEEP_1__ 앱에 OTA 업데이트를 푸시할 수 있습니다.
  1. 업데이트 방법입니다.: 업데이트 패키지를 다운로드합니다 (ZIP 파일에 웹 자산이 포함되어 있습니다)
  2. 추출: 패키지는 장치의 저장소에 추출됩니다
  3. 급속 재로드: 앱은 새 패키지로 전환되며 재시작이 필요하지 않습니다
  4. 대체: 업데이트가 실패하면 이전에 작동하던 버전으로 돌아갑니다
제목 ‘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 update
const 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 immediately
await CapacitorUpdater.reload();

플랫폼 구성

iOS

설정에 추가하세요

안드로이드

안드로이드 제목

추가 설정이 필요하지 않습니다. 플러그인은 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 start
await CapacitorUpdater.set({
id: bundle.id
});
// Reload app immediately with new bundle
await 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 progress
CapacitorUpdater.addListener('download', (info) => {
console.log('Download progress:', info.percent);
});
// Listen for download completion
CapacitorUpdater.addListener('downloadComplete', (bundle) => {
console.log('Download complete:', bundle.version);
});
// Listen for update failures
CapacitorUpdater.addListener('updateFailed', (error) => {
console.error('Update failed:', error);
});
// Listen for successful updates
CapacitorUpdater.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'
}
}
}

시작하는 가장 쉬운 방법:

// Install the Capgo CLI
bun add -g @capgo/cli
// Login to Capgo
npx @capgo/cli login
// Upload your first bundle
npx @capgo/cli bundle upload
// The plugin auto-updates from Capgo cloud

See the 기본적인 Quickstart 가이드 자세한 내용은

자체 호스팅 업데이트

자체 호스팅 업데이트

자체 호스팅 업데이트 서버를 호스팅하세요:

// 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"
}

자체 호스팅 모드 See 자세한 내용은 여기서 확인하세요.

수동 업데이트 흐름

수동 업데이트 흐름

업데이트에 대한 완전한 제어:

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() 네트워크 오류에 대한 적절한 오류 처리를 구현
  • 버전 번호를 일관적으로 사용
  • protectedTokens
  • pagePath
  • 다운로드 속도를 높이기 위해 패키지 크기를 작게 유지하세요.
  • 업데이트 성공률을 모니터링하세요.

지원

지원

다음 단계로

“다음 단계로”

Capacitor @__CAPGO_KEEP_0__/__CAPGO_KEEP_1__-업데이터를 사용 중이라면 Capacitor @__CAPGO_KEEP_0__/__CAPGO_KEEP_1__-업데이터 __CAPGO_KEEP_0__ 플러그인 디렉토리 Using @capgo/capacitor-updater for the native capability in Using @capgo/capacitor-updater, Capgo 플러그인들 for the product workflow in Capgo Plugin Directory, Capacitor Plugins by Capgo for the implementation detail in Capacitor Plugins by Capgo, Adding or Updating Plugins Capgo Ionic Enterprise Plugin Alternatives Capgo