When using appflow-hosted/self-hosted live-update is not working .
appflow-hosted steps:
-
ENV Ionic 7.2.0 Node v18.18.0
-
Build app ionic start first-ionic-app blank --type=vue --link –capacitor Select option: Create a new app on Ionic Appflow Select option : Don't use a git host Build success , app id: 8efeb6b1
-
Create sign key in the project root appflow live-update generate-signing-key
-
Config live update and plugins i. npm install @capacitor/live-updates -S ii. ionic build iii. ionic capacitor add android iv. ionic live-update add --app-id=8efeb6b1 --channel-name="Production" --update-method=background --max-store=2 v. Add live update config in capacitor.config.ts plugins: { LiveUpdates: { appId: "350da132 ", channel: "Production", autoUpdateMethod: "background", maxVersions: 2, strategy: "zip", key: "appflow_public.pem", }, }, vi. npx cap sync
-
Run app in android i. ionic capacitor sync android ii. ionic capacitor open android iii. run app on phone
-
Build new version i. Change page content. ii. Git add . & git commit -m ‘init’ ,SHA: 7b7962112708501517d5d7862eb02856e5c1b10e iii. Upload artifact: appflow live-update upload-artifact --app-id=8efeb6b1 --build-dir=dist --commit-sha=7b7962112708501517d5d7862eb02856e5c1b10e --signing-key=appflow_private.pem --commit-ref=main --commit-message=init --token=xxxxx Build ID: 9418217 We can see the builds in appflow dashboard , but the Deploy Live Update button is disabled and shows tip ‘Build stack is retired’
Download the ZIP , artifact is ok.
-
Deploy live update appflow deploy web --app-id=8efeb6b1 --build-id=9418217 --destination="Production" --token=xxxx The app has not been updated to the latest version.