To run the example project, clone the repo, and run pod install
from the Example directory first.
- iOS 11
- Swift 5
- Xcode 12
SocketKitIO is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'SocketKitIO'
or
pod 'SocketKitIO', '~> 1.0'
## Integration In Project
```IntegrationInProject
import SocketIOClient
let socketIOManager = SocketIOManager(isLog: true)
func setupIncoming() {
//Initial setup
socketIOManager.params(key: "SOCKET_AUTH_KEY", value: "SOCKET_AUTH_TOKEN")
.with(url: AppConstant.HTTP.API.SOCKET_IO)
socketIOManager.prepareConnection()
//Socket response setup
//Response One
socketIOManager.socketOn(name: "SOCKET_KEY_ONE") {name, data, ack in
print("Socket key name: \(name), socket data: \(data)")
}
socketIOManager.socketOn(name: "SOCKET_KEY_TWO") {name, data, ack in
print("Socket key name: \(name), socket data: \(data)")
}
//...
/*
//As many as you have need
*/
}
let emitData = [
"key": "value",
"key": "value",
"key": "value",
"key": "value"
//....
]
socketIOManager.emit(name: "SOCKET_KEY_ONE", params: emitData)
Md. Rashed - Uz - Zaman (Rz Rasel)
SocketKitIO is available under the MIT license. See the LICENSE file for more info.