API 업데이트 엔드포인트
설치 단계와 이 플러그인의 전체 마크다운 가이드를 포함한 설정 프롬프트를 복사할 수 있습니다.
code을 JavaScript에서 다음 예시와 같이 플러그인 업데이트를 전송하는 방법입니다.
interface AppInfos { version_name: string version_build: string version_os: string custom_id?: string is_prod?: boolean is_emulator?: boolean plugin_version: string platform: string app_id: string device_id: string}
export const handler: Handler = async (event) => { const body = JSON.parse(event.body || '{}') as AppInfos const { platform, app_id, version_os, device_id, version_name, version_build, plugin_version, } = body console.log('update asked', platform, app_id, version_os, device_id, version_name, version_build, plugin_version) if (version_name === '1.0.0') { return { version: '1.0.1', url: 'https://apiurl.com/mybuild_101.zip', checksum: 'sha256_checksum_of_bundle', } } else if (version_name === '1.0.1') { return { version: '1.0.2', url: 'https://apiurl.com/mybuild_102.zip', checksum: 'sha256_checksum_of_bundle', } } else { return { message: 'Error version not found' version: '', url: '', } }}응답 형식
응답 형식위의 형식과 같은 형식으로 비암호화된 배포본, 업데이트를 반환하는 엔드포인트는:
{ "version": "1.0.2", "url": "https://apiurl.com/mybuild_102.zip", "checksum": "sha256_checksum_of_bundle"}위하여 암호화된 패키지, 또한 세션 키도 포함해야 합니다:
{ "version": "1.0.2", "url": "https://apiurl.com/mybuild_102.zip", "checksum": "encrypted_checksum_from_encrypt_command", "session_key": "ivSessionKey_from_encrypt_command"}업데이트나 오류가 없으면 키와 optionally의 message 키와 optionally의 error:
{ "message": "Version not found", "error": "The backend crashed", "version": "1.0.2",}Field Descriptions
Field Descriptionschecksum: 업데이트를 위한 패키지 zip 파일의 SHA256 해시session_key: 암호화된 번들에만 필요 - 이 것은ivSessionKeyencrypt 명령어로 반환되는version: semver 형식의 버전 식별자 : 암호화된 번들이 다운로드할 수 있는 HTTPS URLurl번들 생성
자동 업데이트 문서 암호화된 번들에 대한 경우 .
암호화된 번들 문서 암호화된 번들의 완전한 암호화 워크플로를 설명합니다. which explains the complete encryption workflow.
업데이트 API 엔드포인트에서 계속
“업데이트 API 엔드포인트에서 계속” 제목CI/CD 자동화 계획을 사용하는 경우 __CAPGO_KEEP_0__ 업데이트 API 엔드포인트 __CAPGO_KEEP_0__ CI/CD와 연결 capgo/capacitor-업데이터를 사용하는 @capgo/capacitor-업데이터 capgo/capacitor-업데이터를 사용하는 @capgo/capacitor-업데이터의 원시 기능 Capgo CI/CD Capgo CI/CD의 제품 워크플로 Capgo 네이티브 빌드 Capgo 네이티브 빌드의 제품 워크플로 Capgo 통합 Capgo 제품 워크플로우에 대한 Capgo 통합 및 CI/CD 통합 __CAPGO_KEEP_0__ CI/CD 통합에 대한 구현 세부 정보