I have a Next.js app that I deploy to web, let’s say to URL https://example.com
, and also wrap with Capacitor to release to Android and iOS. To enable the autofill feature on Android, we set server.androidScheme
to https
, and server.hostname
to example.com
in capacitor config. The autofill works fine, however I realised that when I statically build my app and run it, the app renders the contents of my web deployment and completely ignoring what is bundled with the app on build time.
Please let me know if any of this is wrong but how I assume a Capacitor app works is that when I run the app, it starts a locally running server that serves the contents of the web app, and renders it on the web view. The URL of this locally running server is made up of what is in Capacitor config files, so in my case, it’s https://example.com
which is the same as my web deployment. So when the app tries to fetch the contents of the app from this local server, it fetches them from the web deployment instead, hence the local contents being ignored.
This is currently blocking an Android release because we don’t want our mobile apps to be completely in sync with our web deployments, at least without our control. Has anyone else experienced a similar issue?