{"id":19589277,"url":"https://github.com/sjrmanning/birdsong","last_synced_at":"2025-09-17T09:42:41.429Z","repository":{"id":56903708,"uuid":"62319222","full_name":"sjrmanning/Birdsong","owner":"sjrmanning","description":":bird::musical_score: Swift WebSockets client for Phoenix Channels.","archived":false,"fork":false,"pushed_at":"2019-10-06T21:14:35.000Z","size":121,"stargazers_count":126,"open_issues_count":8,"forks_count":37,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-08-13T03:34:20.510Z","etag":null,"topics":["birdsong","phoenix","swift","websocket-client"],"latest_commit_sha":null,"homepage":"","language":"Swift","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/sjrmanning.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":"2016-06-30T14:54:39.000Z","updated_at":"2025-06-30T19:45:59.000Z","dependencies_parsed_at":"2022-08-21T02:50:14.184Z","dependency_job_id":null,"html_url":"https://github.com/sjrmanning/Birdsong","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/sjrmanning/Birdsong","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sjrmanning%2FBirdsong","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sjrmanning%2FBirdsong/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sjrmanning%2FBirdsong/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sjrmanning%2FBirdsong/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sjrmanning","download_url":"https://codeload.github.com/sjrmanning/Birdsong/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sjrmanning%2FBirdsong/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275571702,"owners_count":25489088,"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-09-17T02:00:09.119Z","response_time":84,"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":["birdsong","phoenix","swift","websocket-client"],"created_at":"2024-11-11T08:17:52.065Z","updated_at":"2025-09-17T09:42:41.381Z","avatar_url":"https://github.com/sjrmanning.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n    \u003cimg src=\"https://raw.githubusercontent.com/sjrmanning/Birdsong/assets/birdsong.png\" width=\"483px\" alt=\"Birdsong: Phoenix Channels WebSockets client for iOS \u0026 OS X\"\u003e\n\u003c/p\u003e\n\n# Birdsong\n\nAn iOS \u0026 OS X WebSockets client for use with [Phoenix](http://www.phoenixframework.org) [Channels](http://www.phoenixframework.org/docs/channels). Supports [Phoenix Presence](https://hexdocs.pm/phoenix/1.2.0/Phoenix.Presence.html)!\n\nAs of version 0.3.0, Birdsong requires Swift 3.0+. Please use version 0.2.2 if you need Swift 2.2 support.\n\nVersion 0.6 onwards supports Swift 4 using Starscream 3.0.\n\n\n## Usage\n\n```swift\nimport Birdsong\n\n…\n\n// In your view controller / client\nlet socket = Socket(url: NSURL(string: \"http://localhost:4000/socket/websocket\")!, params: [\"key\": \"secret\"])\n\n…\n\nsocket.onConnect = {\n    let channel = self.socket.channel(\"rooms:some-topic\", payload: [\"user\": \"spartacus\"])\n    channel.on(\"new:msg\", callback: { message in\n        print(\"New message: \\(message)\")\n    })\n\n    channel.join()?.receive(\"ok\", callback: { payload in\n        print(\"Successfully joined: \\(channel.topic)\")\n    })\n\n    channel.send(\"new:msg\", payload: [\"body\": \"Hello!\"])\n        .receive(\"ok\", callback: { response in\n            print(\"Sent a message!\")\n        })\n        .receive(\"error\", callback: { reason in\n            print(\"Message didn't send: \\(reason)\")\n        })\n\n    // Presence support.\n    channel.presence.onStateChange = { newState in\n        // newState = dict where key = unique ID, value = array of metas.\n        print(\"New presence state: \\(newState)\")\n    }\n\n    channel.presence.onJoin = { id, meta in\n        print(\"Join: user with id \\(id) with meta entry: \\(meta)\")\n    }\n\n    channel.presence.onLeave = { id, meta in\n        print(\"Leave: user with id \\(id) with meta entry: \\(meta)\")\n    }\n}\n\nsocket.connect()\n```\n\n## Example\n\nTo run the example project, clone the repo, and run `pod install` from the Example directory first, then use the Birdsong.xcworkspace Xcode workspace. The example is configured to work directly with the [Phoenix Chat Example](https://github.com/chrismccord/phoenix_chat_example). It simply connects to `localhost:4000`, joins the `rooms:lobby` channel, and logs each received message. The “Send message” button will send a message to the channel with an incrementing count.\n\n## Installation\n\nAvailable on CocoaPods:\n\n```ruby\nplatform :ios, '9.0'\nuse_frameworks!\n\npod 'Birdsong', '~\u003e 0.6'\n```\n\nIf you need Swift 2.2 compatibility, please use version `0.2.2`.\n\n## Author\n\nSimon Manning — [sjrmanning@github](https://github.com/sjrmanning)\n\n## License\n\nBirdsong is available under the MIT license. See the LICENSE file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsjrmanning%2Fbirdsong","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsjrmanning%2Fbirdsong","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsjrmanning%2Fbirdsong/lists"}