{"id":21816580,"url":"https://github.com/5monkeys/socker-ios","last_synced_at":"2025-07-08T18:33:31.808Z","repository":{"id":56910622,"uuid":"43390921","full_name":"5monkeys/socker-ios","owner":"5monkeys","description":"An iOS socker client for handling multiple channels on a single websocket connection","archived":false,"fork":false,"pushed_at":"2015-12-16T16:23:56.000Z","size":0,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-06-30T14:18:59.346Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/5monkeys.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2015-09-29T19:57:28.000Z","updated_at":"2020-01-02T04:30:40.000Z","dependencies_parsed_at":"2022-08-20T20:20:33.799Z","dependency_job_id":null,"html_url":"https://github.com/5monkeys/socker-ios","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/5monkeys/socker-ios","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/5monkeys%2Fsocker-ios","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/5monkeys%2Fsocker-ios/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/5monkeys%2Fsocker-ios/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/5monkeys%2Fsocker-ios/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/5monkeys","download_url":"https://codeload.github.com/5monkeys/socker-ios/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/5monkeys%2Fsocker-ios/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264324191,"owners_count":23590819,"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":[],"created_at":"2024-11-27T15:35:20.189Z","updated_at":"2025-07-08T18:33:31.771Z","avatar_url":"https://github.com/5monkeys.png","language":"Objective-C","funding_links":[],"categories":[],"sub_categories":[],"readme":"Socker iOS client\n============\n[![Build Status](https://travis-ci.org/5monkeys/socker-ios.svg)](https://travis-ci.org/5monkeys/socker-ios)\n\nAn iOS client for communicating with a [socker](https://github.com/5monkeys/socker) websocket server which supports subscribing on multiple channels on a single connection. It is based on the very good [SocketRocket](https://github.com/square/SocketRocket) library.\n\n## Installation\nAdd the following to your `Podfile` and run `pod install`\n```bash\npod 'FMSocker'\n```\n\n## Usage\n\nImport the library:\n\n```objective-c\n#import \u003cFMSocker/FMSocker.h\u003e\n```\n\nInitiate the client with a url to your socker server:\n```objective-c\nFMSockerClient *sockerClient = [[FMSockerClient alloc] initWithURL:[NSURL URLWithString:@\"wss://example.com\"]];\n\n// Connect to the server\n[sockerClient connect];\n```\n\nSubscribe on channels:\n```objective-c\n// Subscribe on foo channel\n[sockerClient subscribeOnChannel:@\"foo\"\n                       onMessage:^(FMSockerMessage *message, NSError *error){\n                           if (!error) {\n                               NSLog(@\"Got message on channel %@ with payload %@\", message.name, message.data);\n                           } else {\n                               NSLog(@\"Failed to parse message %@\", [error localizedDescription]);\n                           }\n                       }];\n// Subscribe on bar channel\n[sockerClient subscribeOnChannel:@\"bar\"\n                       onMessage:^(FMSockerMessage *message, NSError *error){\n                           if (!error) {\n                               NSLog(@\"Got message on channel %@ with payload %@\", message.name, message.data);\n                           } else {\n                               NSLog(@\"Failed to parse message %@\", [error localizedDescription]);\n                           }\n                       }];\n```\n\nSend messages:\n```objective-c\n// Create a socker message\nFMSockerMessage *message = [[FMSockerMessage alloc] initWithName:@\"testchannel\" andData:@[ @\"foo\", @\"bar\" ]];\n\n// Initiate the client with a url to your socker server\nFMSockerClient *sockerClient = [[FMSockerClient alloc] initWithURL:[NSURL URLWithString:@\"wss://example.com\"]];\n\n// Connect to the server\n[sockerClient connect];\n\n// Send the message\nNSError *error;\n[sockerClient sendSockerMessage:message error:\u0026error];\n\n```\n\nUnsubscribe channels:\n```objective-c\n// Unsubscribe channel named foo\n[sockerClient unsubscribeChannel:@\"foo\"];\n```\n\nUnsubscribe all channels:\n```objective-c\n[sockerClient unsubscribeAll];\n```\n\nDisconnect websocket:\n```objective-c\n[sockerClient disconnect];\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F5monkeys%2Fsocker-ios","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F5monkeys%2Fsocker-ios","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F5monkeys%2Fsocker-ios/lists"}