I’m evaluating appflow as it’d be very useful for our project and would be keen to get one of the paid plans.
However, I don’t seem to be able to get the basic live deployments working with my Ionic/Angular/Capacitor app, and I’m a bit at a loss as to how to troubleshoot.
I have followed the docs and installed the SDK in my app.
I can see the app id, channel name (Production) and update method (auto) in string.xml and info.plist.
I have successfully built the app in appflow (web build), and I can see on the deployments screen my build assigned to the production channel of type ‘Live Update’.
I’m not seeing changes on device after the splash screen, so I’ve put together a screen using the ‘Deploy’ plugin to show me what version is installed, and if updates are available.
import { Deploy } from 'cordova-plugin-ionic/dist/ngx';
...
private async loadDeployInfo()
{
const info = await this.deploy.getCurrentVersion();
if (info) {
this.liveUpdateId = info.buildId;
}
const updateCheck = await this.deploy.checkForUpdate();
console.log(updateCheck);
if (updateCheck.available) {
this.updateAvailable = updateCheck.build;
}
}
I call the above ‘loadDeployInfo()’ when my view loads and display out the build Id and whether an update is available. Neither show up anything when testing on device. I’m using capacitor, so running locally involves running ngx cap commands and opening android studio, which is not a tool I know how to get debug information out of, but I’m not seeing any red in the console as it’s running.
I’m a bit stuck. I’m keen to use app flow, but I’m not seeing basic live updates take effect and there’s not much documentation on troubleshooting.
I’ve tried to get some more in depth information using chrome://inspect to see what’s in the console on the device.
I can see this, I imagine this can have an impact on whether the live update stuff will work:
deviceready has not fired after 5 seconds.
capacitor-runtime.js:2181 Channel not fired: onIonicProReady
vendor.js:95897 Ionic Native: deviceready did not fire within 5000ms. This can happen when plugins are in an inconsistent state. Try removing plugins from plugins/ and reinstalling them.
(anonymous) @ vendor.js:95897
I also see this error:
Resources$NotFoundException: String resource ID #0x0
Then I stumbled across this post:
If I add this to strings.xml it seems to fix the error above, I will test if this means my updates are applying…
Ok, I’ve found a similar fix for iOS editing info.plist. I’ve changed these values where there seems to be some kind of variable substitution that is supposed to happen some where: