I’m using the server.url parameter in capacitor.config.json to load a PWA into a Capacitor app.
It’s working fine on iOS… but on Android, the PWA side is having trouble accessing the global Capacitor instance. It works on the first run (after deleting the app and doing a fresh install from Android Studio)… but on subsequent runs window.Capacitor just isn’t there! Apart from that it’s loading and working okay.
For example …
if (window.Capacitor !== undefined) {
window.Capacitor.Plugins.SplashScreen.hide()
}
SplashScreen hides perfectly on first run, then fails every time after that. It’s working fine on iOS…
Installed dependencies:
@capacitor/cli 2.1.2
@capacitor/ios 2.1.2
@capacitor/core 2.1.2
@capacitor/android 2.1.2
Any ideas? Thanks