Using the capacitor updater with self-hosted capgo
What this Tutoriel will cover?
Section titled “What this Tutoriel will cover?”This Tutoriel will show how to use capacitor updater in a dev environment with self hosted capgo
Requirements
Section titled “Requirements”Commencer
Section titled “Commencer”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 Activer you to use local capgo in Développement. However, by default, this is not enough.
By default both iOS and Android 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 Activer plaintext communication.
This can be achieved by modifying AndroidManifest.xml and adding android:usesCleartextTraffic="true" in the application tag
A full Exemple of this change can be seen here
There also could be a problem that prevents the Android Application from connecting. If you do not see any requests being send to edge functions run
adb reverse tcp:54321 tcp:54321