{"id":20918033,"url":"https://github.com/nuclearace/socket.io-client-swift","last_synced_at":"2025-04-05T14:08:21.815Z","repository":{"id":23678050,"uuid":"27049479","full_name":"nuclearace/Socket.IO-Client-Swift","owner":"nuclearace","description":"socket.io-client for Swift","archived":false,"fork":false,"pushed_at":"2022-07-12T18:56:02.000Z","size":2574,"stargazers_count":360,"open_issues_count":53,"forks_count":53,"subscribers_count":19,"default_branch":"master","last_synced_at":"2025-03-29T13:09:46.608Z","etag":null,"topics":["nodejs","socketio","socketio-client","swift"],"latest_commit_sha":null,"homepage":null,"language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nuclearace.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-11-23T21:58:05.000Z","updated_at":"2025-01-05T23:34:03.000Z","dependencies_parsed_at":"2022-08-22T03:50:30.786Z","dependency_job_id":null,"html_url":"https://github.com/nuclearace/Socket.IO-Client-Swift","commit_stats":null,"previous_names":[],"tags_count":159,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nuclearace%2FSocket.IO-Client-Swift","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nuclearace%2FSocket.IO-Client-Swift/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nuclearace%2FSocket.IO-Client-Swift/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nuclearace%2FSocket.IO-Client-Swift/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nuclearace","download_url":"https://codeload.github.com/nuclearace/Socket.IO-Client-Swift/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247345854,"owners_count":20924102,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["nodejs","socketio","socketio-client","swift"],"created_at":"2024-11-18T16:36:58.138Z","updated_at":"2025-04-05T14:08:21.791Z","avatar_url":"https://github.com/nuclearace.png","language":"Swift","readme":"[![Build Status](https://travis-ci.org/socketio/socket.io-client-swift.svg?branch=master)](https://travis-ci.org/socketio/socket.io-client-swift)\n\n# Socket.IO-Client-Swift\nSocket.IO-client for iOS/OS X.\n\n## Example\n```swift\nimport SocketIO\n\nlet manager = SocketManager(socketURL: URL(string: \"http://localhost:8080\")!, config: [.log(true), .compress])\nlet socket = manager.defaultSocket\n\nsocket.on(clientEvent: .connect) {data, ack in\n    print(\"socket connected\")\n}\n\nsocket.on(\"currentAmount\") {data, ack in\n    guard let cur = data[0] as? Double else { return }\n    \n    socket.emitWithAck(\"canUpdate\", cur).timingOut(after: 0) {data in\n        if data.first as? String ?? \"passed\" == SocketAckValue.noAck {\n            // Handle ack timeout \n        }\n\n        socket.emit(\"update\", [\"amount\": cur + 2.50])\n    }\n\n    ack.with(\"Got your currentAmount\", \"dude\")\n}\n\nsocket.connect()\n```\n\n## Features\n- Supports socket.io 2.0+/3.0+.\n- Supports Binary\n- Supports Polling and WebSockets\n- Supports TLS/SSL\n\n## FAQS\nCheckout the [FAQs](https://nuclearace.github.io/Socket.IO-Client-Swift/faq.html) for commonly asked questions.\n\n\nCheckout the [12to13](https://nuclearace.github.io/Socket.IO-Client-Swift/12to13.html) guide for migrating to v13+ from v12 below.\n\nCheckout the [15to16](https://nuclearace.github.io/Socket.IO-Client-Swift/15to16.html) guide for migrating to v16+ from v15.\n\n## Installation\nRequires Swift 4/5 and Xcode 10.x\n\n### Swift Package Manager\nAdd the project as a dependency to your Package.swift:\n```swift\n// swift-tools-version:4.2\n\nimport PackageDescription\n\nlet package = Package(\n    name: \"socket.io-test\",\n    products: [\n        .executable(name: \"socket.io-test\", targets: [\"YourTargetName\"])\n    ],\n    dependencies: [\n        .package(url: \"https://github.com/socketio/socket.io-client-swift\", .upToNextMinor(from: \"15.0.0\"))\n    ],\n    targets: [\n        .target(name: \"YourTargetName\", dependencies: [\"SocketIO\"], path: \"./Path/To/Your/Sources\")\n    ]\n)\n```\n\nThen import `import SocketIO`.\n\n### Carthage\nAdd this line to your `Cartfile`:\n```\ngithub \"socketio/socket.io-client-swift\" ~\u003e 15.2.0\n```\n\nRun `carthage update --platform ios,macosx`.\n\nAdd the `Starscream` and `SocketIO` frameworks to your projects and follow the usual Carthage process.\n\n### CocoaPods 1.0.0 or later\nCreate `Podfile` and add `pod 'Socket.IO-Client-Swift'`:\n\n```ruby\nuse_frameworks!\n\ntarget 'YourApp' do\n    pod 'Socket.IO-Client-Swift', '~\u003e 15.2.0'\nend\n```\n\nInstall pods:\n\n```\n$ pod install\n```\n\nImport the module:\n\nSwift:\n```swift\nimport SocketIO\n```\n\nObjective-C:\n\n```Objective-C\n@import SocketIO;\n```\n\n\n# [Docs](https://nuclearace.github.io/Socket.IO-Client-Swift/index.html)\n\n- [Client](https://nuclearace.github.io/Socket.IO-Client-Swift/Classes/SocketIOClient.html)\n- [Manager](https://nuclearace.github.io/Socket.IO-Client-Swift/Classes/SocketManager.html)\n- [Engine](https://nuclearace.github.io/Socket.IO-Client-Swift/Classes/SocketEngine.html)\n- [Options](https://nuclearace.github.io/Socket.IO-Client-Swift/Enums/SocketIOClientOption.html)\n\n## Detailed Example\nA more detailed example can be found [here](https://github.com/nuclearace/socket.io-client-swift-example)\n\nAn example using the Swift Package Manager can be found [here](https://github.com/nuclearace/socket.io-client-swift-spm-example)\n\n## License\nMIT\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnuclearace%2Fsocket.io-client-swift","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnuclearace%2Fsocket.io-client-swift","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnuclearace%2Fsocket.io-client-swift/lists"}