skip to Main Content

I have a react-js app and I use capacitor to leverage with native mobile API’s (eg: BLE). My objective is to live update the app upon a minor change (eg: adding a new label) without going through the whole appstore submission process. I know Ionic has AppFlow that could work well with Capacitor, but it is way too expensive for me. Thus, I saw some are suggesting writing a script that pulls in the JS perfectly from somewhere like the S3 bucket, and when you build the app you build in all of the native code and replace the HTML scripts with one that comes from a remote source (But I have no idea how to do it)

  1. Is this how most people handle live-updating webview apps or is there a better way ?
  2. If so what are the steps to achieve this objective using scripts and so on (with code examples)?

2

Answers


  1. You need a subscription to Ionic’s AppFlow, as of yet ionic is the only company that offers live updates.

    Login or Signup to reply.
  2. Hey I’m the Maker of Capacitor-updater, the only alternative to ionic AppFlow.

    The updater allows you to manage update by yourself, store your zip update where you want and use the download method.

    How to start

    npm install @capgo/capacitor-updater
    npx cap sync
    

    Then in your main JS, this is required to let the updater know the update is valid

      import { CapacitorUpdater } from '@capgo/capacitor-updater'
      CapacitorUpdater.notifyAppReady()
    

    And lately after checking yourself the current version need update:

      const version = await CapacitorUpdater.download({
        url: 'https://github.com/Cap-go/demo-app/releases/download/0.0.4/dist.zip',
      })
      await CapacitorUpdater.set(version); // sets the new version, and reloads the app
    

    After many request of people didn’t want to do that themselves, I started Capgo a business to manage all the update process for you.

    All is open source and can be replicate on your own as well.

    Doing things for Capacitor is now my main activity, I produce open-source plugin as my main channel of Marketing, I’m solo founder and bootstrapped.

    Hope my tool will help you !

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search