メインコンテンツにジャンプ

V3からV4まで

あなたとディスコードコミュニティで多くの話し合いをした結果、手動モードは非常に手動的で安全でないことがわかりました。例えば、自動リバートは不可能でした。したがって、手動でアップデートに失敗した場合、ユーザーはアプリを削除して再インストールする必要がありました。これは、悪いユーザー体験です。

Meanwhile, I took this as an opportunity to give more freedom to you, and remove all bad code I made.

「Install」セクション

クラウド自動更新

npm i @capgo/capacitor-updater@4

自主ホスト自動更新

あなたにとっては、まだ簡単です。変更点は次のとおりです。

  • 設定名 autoUpdateUrl から updateUrl
  • エンドポイントのメソッドは GET からPOSTに変更されました

あなたにとっては、これが最大の変更点ですが、最良のものです!多くの改善点がありますので、よく読んでください。

  • autoUpdateUrl 変更点は updateUrl この設定は、手動モードでも使用できるようになりました
  • 削除 cancelDelaydelayUpdate の代わりに setDelay
  • もうない versionName のセット
  • 変更 version キー、多くの関数から返されたオブジェクト BundleInfo
interface BundleInfo {
id: string;
version: string;
downloaded: string;
status: 'success' | 'error' | 'pending' | 'downloading'
}
  • 名前が誤解を招く名前は、説明ができないかもしれませんが、使用する際は新しいものがわかりやすくなりました:
    • これまで呼ばれていた version は、現在は参照されるものに変更されました bundle
    • id refer to the old version who was a random string of 10 char, this id is the only trustable and unique way to access to your bundles, example 7Dfcd2RedN.
    • version refer now to the versionName you choose for a bundle, example 1.0.0
  • updateUrl move from get to post, since custom headers were a problem for some of you and post is more logical, all previous headers go to the body and prefix cap_ disappear.
  • versionName method is deleted, in favor of getId
  • list returns now a list of BundleInfo
  • Rename getId in getDeviceId
  • autoUpdate becomes true by default, if you use Manual mode, set it to false.
  • Method getLatest, this method allows you to get from your server set with updateUrl the last version available.
  • Method setDelay who take {kind: “background” | “kill” | “nativeVersion” | “date”, value? : string} as argument to set delay to different modes.
  • メソッド nextバックグラウンドでのバージョン設定を次回実行するために、逆に set 誰がすぐに実行するか。
  • メソッド isAutoUpdateEnabled自動更新のコンテキスト内であれば、通知するようにします。
  • イベント downloadComplete ダウンロードが100%に達したとき
  • ダウンロードメソッドで必須のフィールド version 手動モードでも必須になりました。10秒以内に呼び出さない場合は、元のバージョンに戻します。
  • notifyAppReady コントリビューター

「コントリビューター」セクション

Section titled “Contributors”

@lincolnthree あなたの協力のおかげでこのアップデートを実行することができました。ありがとうございます。

V3からV4まで

V3からV4まで

Capacitorを使用している場合 V3からV4まで ライブアップデートの配信計画を行う場合、__CAPGO_KEEP_0__ Live Updatesと接続してください。 Capacitorの製品ワークフローにCapgo Live Updatesを使用する場合 for the product workflow in Capgo Live Updates, Capacitorの実装詳細については概要を参照してください。 機能 __CAPGO_KEEP_0__ Live Updates 機能の実装詳細については、Features 更新の動作 機能の実装詳細については、Update Behavior、 更新の種類 機能の実装詳細については、Update Types。