Skip to main content

Differentials

Live Updates are smaller and faster if they include only the modified files, or differentials, from previous updates. This can be done using manifest file.

Why do I need manifest file?

A deploy manifest file (pro-manifest.json) includes a hash for every file in the www/ dir. If the original native app has a deploy manifest file, the original file is compared against the manifest in the update and only changed files will be downloaded. This makes the update much smaller and faster, resulting in improved performance over slower connections. If there isn't a manifest file in the bundled web app, all files will be downloaded, resulting in unnecessarily slower updates.

How do I generate manifest file?

If using Appflow for Native Builds

  • If you are using Appflow to build the native binaries, Appflow creates the manifest file for you automatically and includes it in the static files. This leads to better subsequent deploys.
  • This can be seen in Appflow right after the npm run build step alongside ionic info and before step: cap_sync.
 Generating app manifest...
$ ionic live-update manifest
▸ [OK] Appflow Deploy manifest written to ./www/pro-manifest.json!

If using Cordova and not using Appflow for Native Builds

  • The manifest should be generated automatically on the cordova prepare event (Cordova hooks). No additional action required.

  • Since Cordova takes care of this, any subsequent live deploys to the native build should download only the differentials.

If using Capacitor and not using Appflow for Native Builds

  • For Capacitor, you are required to generate the manifest files manually.

  • This can be done by using the command ionic live-update manifest.

ionic live-update manifest
[OK] Appflow Deploy manifest written to ./www/pro-manifest.json!

Since the manifest file needs to be created after you have modified the web assets, you need to run npm run build after creating the web assets and before you copy or update the plugins and platforms using npx cap sync or npx cap copy.

npm run build
ionic live-update manifest
npx cap sync

The simplest way to manage that locally is by adding it to the build script in package.json.

 "scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build; ionic live-update manifest",
},
note

There can be issues when the manifest is prepared on Windows due to how line endings are handled and commited. If you're building for native on Windows you may want to try a build using Appflow and see if you notice an improvement.

How do I know if my app contains a manifest file that is already built?

You can verify the deploy manifest file by extracting the production .ipa/.apk file and checking for the presence of pro-manifest.json in the www/ dir.