0

I am using Capgo for over-the-air updates to my Ionic/Capacitor app. This plugin works very well. The app uses Firebase/Firestore and I found that on iOS after the plugin downloads and installs a new bundle version the app is not connected to Firestore resulting in blank content. On app restart this is resolved and things are normal.

How can this be resolved?

Larry King
  • 419
  • 6
  • 19

1 Answers1

0

Testing and debugging the app, there was a firestore connection error during the new bundle version install. This SO link solved the problem for me. By deleting the firebase app prior to Capgo/capacitor-updater install, the new install connected to firestore correctly and the app started normally. This was only an issue on iOS, but the solution works on both iOS and Android.

I use angular/fire so my solution looked like this:

    const firebaseAppSub = firebaseApp$.subscribe(async (app) => {
      if (app) {
        await deleteApp(app);
        await CapacitorUpdater.set({ id: this.bundleInfo.id });
        this.bundleInfo = null;
        firebaseAppSub.unsubscribe();
      }
    });
Larry King
  • 419
  • 6
  • 19