Initial commit

This commit is contained in:
eskimo
2024-10-03 01:03:39 -04:00
commit 6a108e8f23
108 changed files with 2680 additions and 0 deletions

View File

@@ -0,0 +1,8 @@
import Foundation
@objc public class Sockets: NSObject {
@objc public func echo(_ value: String) -> String {
print(value)
return value
}
}

View File

@@ -0,0 +1,23 @@
import Foundation
import Capacitor
/**
* Please read the Capacitor iOS Plugin Development Guide
* here: https://capacitorjs.com/docs/plugins/ios
*/
@objc(SocketsPlugin)
public class SocketsPlugin: CAPPlugin, CAPBridgedPlugin {
public let identifier = "SocketsPlugin"
public let jsName = "Sockets"
public let pluginMethods: [CAPPluginMethod] = [
CAPPluginMethod(name: "echo", returnType: CAPPluginReturnPromise)
]
private let implementation = Sockets()
@objc func echo(_ call: CAPPluginCall) {
let value = call.getString("value") ?? ""
call.resolve([
"value": implementation.echo(value)
])
}
}