Skip to content

Using the capacitor updater with self-hosted capgo

GitHub

This tutorial will show how to use capacitor updater in a dev environment with self hosted capgo

  1. Cloned capgo

To use the capacitor updater with self-hosted capgo edit the capacitor.config.ts from your app directory and set it like this:

const config: CapacitorConfig = {
appId: 'com.demo.app',
appName: 'demoApp',
webDir: 'dist',
bundledWebRuntime: false,
plugins: {
CapacitorUpdater : {
statsUrl: "https://localhost:54321/functions/v1/stats",
channelUrl: "https://localhost:54321/functions/v1/channel_self",
updateUrl: "https://localhost:54321/functions/v1/updates"
},
},
};

This will enable you to use local capgo in development. However, by default, this is not enough.

By default iOS, Android, and Electron expect you to use HTTPS, you need to use a tool like Ngrock or localcan to proxy your API in https.

There is a way in Android to enable plaintext communication. This can be achieved by modifying AndroidManifest.xml and adding android:usesCleartextTraffic="true" in the application tag A full example of this change can be seen here

There also could be a problem that prevents the android app from connecting. If you do not see any requests being send to edge functions run

Terminal window
adb reverse tcp:54321 tcp:54321

Keep going from Using the capacitor updater with self-hosted capgo

Section titled “Keep going from Using the capacitor updater with self-hosted capgo”

If you are using Using the capacitor updater with self-hosted capgo to plan migration and enterprise operations, connect it with Using @capgo/capacitor-updater for the native capability in Using @capgo/capacitor-updater, Capgo Enterprise for the product workflow in Capgo Enterprise, Ionic Enterprise Plugin Alternatives for the product workflow in Ionic Enterprise Plugin Alternatives, Capgo Alternatives for the product workflow in Capgo Alternatives, and Capgo Consulting for the product workflow in Capgo Consulting.