File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
PowerSyncKotlin/src/appleMain/kotlin/com/powersync Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change 2
2
3
3
package com.powersync
4
4
5
+ import com.powersync.sync.ConnectionMethod
6
+
5
7
/* *
6
8
* Helper class designed to bridge SKIEE methods and allow them to throw
7
9
* `PowerSyncException`. This is necessary because these exceptions cannot
@@ -13,3 +15,16 @@ package com.powersync
13
15
*/
14
16
@Throws(PowerSyncException ::class )
15
17
public fun throwPowerSyncException (exception : PowerSyncException ): Unit = throw exception
18
+
19
+ /* *
20
+ * Creates a [ConnectionMethod] from a simple boolean, because creating the actual instance with
21
+ * the default constructor is not possible from Swift due to an optional argument with an internal
22
+ * default value.
23
+ */
24
+ @OptIn(ExperimentalPowerSyncAPI ::class )
25
+ public fun createConnectionMethod (webSocket : Boolean ): ConnectionMethod =
26
+ if (webSocket) {
27
+ ConnectionMethod .WebSocket ()
28
+ } else {
29
+ ConnectionMethod .Http
30
+ }
You can’t perform that action at this time.
0 commit comments