i broke it :)

This commit is contained in:
eskimo
2024-10-03 14:42:36 -04:00
parent 3280dfaa58
commit 49989b0e58
9 changed files with 279 additions and 63 deletions

View File

@@ -19,19 +19,17 @@ public class SocketsPlugin: CAPPlugin, CAPBridgedPlugin {
@objc func create(_ call: CAPPluginCall) {
let id = call.getString("id") ?? UUID().uuidString
let host = call.getString("host") ?? ""
let port = call.getInt("port") ?? 0
let useTLS = call.getBool("useTLS") ?? false
let acceptInvalidCertificates = call.getBool("acceptInvalidCertificates") ?? false
let socket = implementation.create(id: id, host: host, port: port, useTLS: useTLS, acceptInvalidCertificates: acceptInvalidCertificates)
let socket = implementation.create(id: id)
call.resolve()
}
@objc func connect(_ call: CAPPluginCall) {
let id = call.getString("id") ?? ""
implementation.connect(id: id)
let host = call.getString("host") ?? ""
let port = call.getInt("port") ?? 0
let useTLS = call.getBool("useTLS") ?? false
let acceptInvalidCertificates = call.getBool("acceptInvalidCertificates") ?? false
implementation.connect(id: id, host: host, port: port, useTLS: useTLS, acceptInvalidCertificates: acceptInvalidCertificates)
call.resolve()
}