You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: website/docs/for-ios/how-to/advanced-configuration.md
+17-3Lines changed: 17 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,10 +12,24 @@ Portals instances can be further configured by providing a Capacitor Configurati
12
12
13
13
## Capacitor Config File
14
14
15
-
Providing a [Capacitor Configuration](https://capacitorjs.com/docs/config)json file with your web assets will configure Capacitor with the provided settings.
16
-
17
-
Provide a `capacitor.config.json` in the Portal start directory (where the web assets are located).
15
+
The easiest approach for configuring a Portal is to let the web application include a [Capacitor Configuration](https://capacitorjs.com/docs/config)
16
+
in the form of a `capacitor.config.json` in the root of its build folder. Portals will provide the Capacitor runtime with the configuration and
17
+
no intervention is needed on the part of the native team.
18
18
19
19
:::note
20
20
Each Portal may have its own config file.
21
21
:::
22
+
23
+
## Programmatic Capacitor Configuration
24
+
25
+
To programmatically configure Capacitor, use the `configuring` method on `Portal` to override any default Capacitor configuration:
26
+
27
+
```swift
28
+
let portal =Portal(name: "foo")
29
+
.configuring(\.loggingBehavior, .none)
30
+
.configuring(\.allowLinkPreviews, true)
31
+
.configuring(\.isWebDebuggable, false)
32
+
```
33
+
34
+
In the event the same value is configured both programmatically and via `capacitor.config.json`, the programmatic configuration takes precedence.
0 commit comments