Is it possible to set a default origin of https://example.org
as opposed to the standard http://localhost
on an Android Capacitor app?
The origin is handled by the webview and depends on the url where the app is served, so you can’t change the origin directly, but you can change the url capacitor uses, which will change the origin. To change the url, configure hostname and androidSchene properties of server object in capacitor.config.json
"server": {
"hostname": "example.org",
"androidScheme": "https"
}
https://capacitor.ionicframework.com/docs/basics/configuring-your-app#common-configuration
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With