Update API エンドポイント
インストール手順とこのプラグインのフルマークダウンガイドのセットアッププロンプトをコピーしてください。
JavaScriptの例です。codeを使用してプラグインにアップデートを送信します。
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: '', } }}レスポンスフォーマット
レスポンスフォーマットのセクション非暗号化のバンドル用に __CAPGO_KEEP_0__, ご提供するエンドポイントは次のようになります:
{ "version": "1.0.2", "url": "https://apiurl.com/mybuild_102.zip", "checksum": "sha256_checksum_of_bundle"}For 暗号化されたバンドル, また、セッションキーも含める必要があります:
{ "version": "1.0.2", "url": "https://apiurl.com/mybuild_102.zip", "checksum": "encrypted_checksum_from_encrypt_command", "session_key": "ivSessionKey_from_encrypt_command"}エラーまたはアップデートがなければ、 message キーと、オプションで error:
{ "message": "Version not found", "error": "The backend crashed", "version": "1.0.2",}フィールドの説明
「フィールドの説明」というタイトルのセクションchecksum: バンドル zip ファイルの SHA256 ハッシュ値 (整合性検証用)session_key: 必須は暗号化されたバンドル用にのみ - これはivSessionKeyはエンコード コマンドによって返されるversion: の形式url: HTTPS でバンドルがダウンロードできる URL
バンドル作成
「バンドル作成」のセクションバンドルを作成し、チェックサムを生成する方法を学ぶには、 暗号化されたバンドル用の場合は、.
暗号化されたバンドルに関するドキュメント 暗号化されたバンドル全体の暗号化フローについて説明している which explains the complete encryption workflow.
アップデート API エンドポイントから続ける
「アップデート API エンドポイントから続ける」あなたがCI/CD自動化を計画するために アップデート API エンドポイント を使用している場合、__CAPGO_KEEP_0__-updater Using @capgo/capacitor-updater 「@capgo/capacitor-updater」 Capgo CI/CD 「@Capgo/__CAPGO_KEEP_1__-updater」のネイティブ機能 Capgo CI/CD for the product workflow in Capgo Native Builds, 「Capgo CI/CD」製品ワークフローでCapgo CI/CDを使用する場合、 Capgo製品ワークフローにおけるCapgo統合と CI/CD統合 CI/CD統合の実装詳細