Cap-go / capacitor-updater

Live update for capacitor apps
https://capgo.app
Mozilla Public License 2.0
471 stars 103 forks source link

feat: dynamic download URL configuration #318

Closed mduft closed 3 months ago

mduft commented 4 months ago

Feature Request

Before our app actually starts, we present the user a screen to select from multiple possible servers. We'd like to download updates from the selected server URL afterwards.

Description

Probably need to provide a way to set the download URL outside of the capacitor config in case it is defined at runtime later.

Platform(s)

All.

Preferred Solution

Extend the TypeScript plugin API to have a updateConfig method or thelike... (?)

Alternatives

I'm open to suggestions :D

Additional Context

I would prefer to not implement all the communication between frontend and backend on our own - capacitor-updater does have a lot of logic already, thus I'd love to re-use what is there with regards to communication (i.e. the endpoints described in the documentation to check for updates and download updates).

Even if for one installation of our application the URL does not necessarily change all the time (mostly it doesn't, but it must be possible to), we're using this application for many customers that have dedicated installations of the server on premises, meaning that at least per customer (which all get the same build of the android application) we need to be able to set the download URL - thus capacitor configuration is not an option as that's build time.

atremel commented 3 months ago

+1

riderx commented 3 months ago

Released here: https://www.npmjs.com/package/@capgo/capacitor-updater/v/5.4.1 you need to add allowModifyUrl in your capacitor.config plugin setting (I made that requirement for security reasons) And then you can call : setUpdateUrl

Please don't hesitate to support the project if you use it on your own : https://github.com/sponsors/riderx

atremel commented 3 months ago

You are amazing, thank you @riderx !!!