Zum Inhalt springen

Using the capacitor updater with self-hosted capgo

Dieser Inhalt ist in Ihrer Sprache noch nicht verfügbar.

What this tutorial will cover?

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

Requirements

  1. Cloned capgo

Getting started

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 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 enable plaintext communication. This can be achived 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
OSZAR »