{"id":4719,"url":"https://github.com/kirkness/react-native-swift-socketio","last_synced_at":"2025-08-04T02:31:27.201Z","repository":{"id":32048632,"uuid":"35620209","full_name":"kirkness/react-native-swift-socketio","owner":"kirkness","description":"A react native wrapper for socket.io-client-swift","archived":false,"fork":false,"pushed_at":"2018-04-04T11:23:05.000Z","size":77,"stargazers_count":109,"open_issues_count":12,"forks_count":14,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-07-07T11:19:49.440Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kirkness.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-05-14T15:46:33.000Z","updated_at":"2023-11-14T03:30:02.000Z","dependencies_parsed_at":"2022-09-11T13:31:40.121Z","dependency_job_id":null,"html_url":"https://github.com/kirkness/react-native-swift-socketio","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kirkness/react-native-swift-socketio","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kirkness%2Freact-native-swift-socketio","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kirkness%2Freact-native-swift-socketio/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kirkness%2Freact-native-swift-socketio/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kirkness%2Freact-native-swift-socketio/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kirkness","download_url":"https://codeload.github.com/kirkness/react-native-swift-socketio/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kirkness%2Freact-native-swift-socketio/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268639931,"owners_count":24282678,"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","status":"online","status_checked_at":"2025-08-04T02:00:09.867Z","response_time":79,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-01-05T20:17:21.240Z","updated_at":"2025-08-04T02:31:26.914Z","avatar_url":"https://github.com/kirkness.png","language":"Swift","funding_links":[],"categories":["Components"],"sub_categories":["Backend"],"readme":"🚨this library is not maintained anymore!\n\n# A React Native wrapper for the Socket.io Swift Library\n\nThe wrapped 'Socket.IO-Client-Swift' can be [found here](https://github.com/socketio/socket.io-client-swift).\n\n### Example\nI've also added a super simple example app to /examples, copy and paste to your index.ios.js.\n``` js\n/**\n * Pass in an optional config obj, this can include most of the\n * standard props supported by the swift library\n */\nvar socketConfig = { path: '/socket' };\nvar socket = new SocketIO('localhost:3000', socketConfig);\n\n// Connect!\nsocket.connect();\n\n// An event to be fired on connection to socket\nsocket.on('connect', () =\u003e {\n    console.log('Wahey -\u003e connected!');\n});\n\n// Event called when 'someEvent' it emitted by server\nsocket.on('someEvent', (data) =\u003e {\n    console.log('Some event was called, check out this data: ', data);\n});\n\n// Called when anything is emitted by the server\nsocket.onAny((event) =\u003e {\n    console.log(`${event.name} was called with data: `, event.items);\n});\n\n// Manually join namespace\nsocket.joinNamespace()\n\n// Leave namespace, back to '/'\nsocket.leaveNamespace()\n\n// Emit an event to server\nsocket.emit('helloWorld', {some: 'data'});\n\n// Optional boolean param 'fast' - defaults to false\nsocket.close(true);\n\n// Reconnect to a closed socket\nsocket.reconect();\n```\n\n### Constructor\n\nRequires:\n`host` - example: 'localhost:3000'\n\nOptional:\n`config` - JSON object comprising any of the options listed below.\n\n\n### Config\n\n- `connectParams: Any Object` - Any data to be sent with the connection.\n- `reconnects: Boolean` Default is `true`\n- `reconnectAttempts: Int` Default is `-1` (infinite tries)\n- `reconnectWait: Number` Default is `10`\n- `forcePolling: Boolean` Default is `false`. `true` forces the client to use xhr-polling.\n- `forceWebsockets: Boolean` Default is `false`. `true` forces the client to use WebSockets.\n- `nsp: String` Default is `\"/\"`. Connects to a namespace.\n- `log: Bool` If `true` socket will log debug messages. Default is false.\n- `path: String` - If the server uses a custom path. ex: `\"/swift\"`. Default is `\"\"`\n\n#### Not supported yet but easy enough to implement.\n\n- ~~`cookies: [NSHTTPCookie]?` An array of NSHTTPCookies. Passed during the handshake. Default is nil.~~\n- ~~`sessionDelegate: NSURLSessionDelegate` Sets an NSURLSessionDelegate for the underlying engine. Useful if you need to handle self-signed certs. Default is nil.~~\n\n### Methods\n\n- `connect` - Connect to socket\n- `on` - Add event handler to socket\n    - `@param` - String - event name\n    - `@param` - Function - callback\n- `onAny` - Add event handler to any event\n    - `@param` - Function - callback\n- `emit` - Emit an event to server\n    - `@param` - String - Event name\n    - `@param` - Anything - Data to be sent\n- `close` - Close the connection\n    - `@param` - Boolean - should close fast?\n- `reconnect` - Reconnect to a closed connection\n- `joinNamespace` - Manually join namespace\n- `leaveNamespace` - Leave namespace, back to '/'\n\n### Known issues\n\n- Would rather this in an xcode framework but run into non-modular header issue.\n\n### Install\n\n- Run in your project:\n```sh\n$ npm install react-native-swift-socketio\n```\n\n- Open up your project in xcode and right click the package.\n- Click **Add files to 'Your project name'**\n- Navigate to **/node_modules/react-native-swift-socketio/RNSwiftSocketIO**\n- Click 'Add'\n- Click your project in the navigator on the left and go to **build settings**\n- Search for **Objective-C Bridging Header**\n- Double click on the empty column\n- Enter **node_modules/react-native-swift-socketio/RNSwiftSocketIO/SocketBridge.h**\n\n... That should do it! Please let me know of any issues ...\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkirkness%2Freact-native-swift-socketio","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkirkness%2Freact-native-swift-socketio","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkirkness%2Freact-native-swift-socketio/lists"}