All Projects → sjrmanning → Birdsong

sjrmanning / Birdsong

Licence: mit
🐦🎼 Swift WebSockets client for Phoenix Channels.

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Birdsong

Mentat
scalable group chat with tags and pretty good privacy.
Stars: ✭ 89 (-28.23%)
Mutual labels:  phoenix
Coinbasepro Python
The unofficial Python client for the Coinbase Pro API
Stars: ✭ 1,386 (+1017.74%)
Mutual labels:  websocket-client
Phoenix Liveview Counter Tutorial
🤯 beginners tutorial building a real time counter in Phoenix 1.5.5 + LiveView 0.14.7 ⚡️
Stars: ✭ 115 (-7.26%)
Mutual labels:  phoenix
Formulator
A form library for Phoenix
Stars: ✭ 89 (-28.23%)
Mutual labels:  phoenix
Bigdata Notes
大数据入门指南 ⭐
Stars: ✭ 10,991 (+8763.71%)
Mutual labels:  phoenix
React Stomp
React websocket component for STOMP protocol over SockJs
Stars: ✭ 110 (-11.29%)
Mutual labels:  websocket-client
Sketchpad
Sketchpad is fully customisable collaborative whiteboard plugin written in pure JavaScript.
Stars: ✭ 85 (-31.45%)
Mutual labels:  websocket-client
Moba
A turn-based browser RPG built with Phoenix LiveView
Stars: ✭ 120 (-3.23%)
Mutual labels:  phoenix
Python Bittrex Websocket
Python websocket for Bittrex (non async).
Stars: ✭ 104 (-16.13%)
Mutual labels:  websocket-client
Premailex
Preflight for your HTML emails - inline styling and plain text.
Stars: ✭ 114 (-8.06%)
Mutual labels:  phoenix
Backend
EmCasa Backend
Stars: ✭ 94 (-24.19%)
Mutual labels:  phoenix
Phoenixsharp
C# Phoenix Channels client. Unity Compatible.
Stars: ✭ 96 (-22.58%)
Mutual labels:  phoenix
Ja resource
A behaviour to reduce boilerplate code in your JSON-API compliant Phoenix controllers without sacrificing flexibility.
Stars: ✭ 111 (-10.48%)
Mutual labels:  phoenix
Memento
Collect saved items from different sources around the web
Stars: ✭ 89 (-28.23%)
Mutual labels:  phoenix
Phoenix live dashboard
Realtime dashboard with metrics, request logging, plus storage, OS and VM insights
Stars: ✭ 1,657 (+1236.29%)
Mutual labels:  phoenix
Arduinowebsockets
arduinoWebSockets
Stars: ✭ 1,265 (+920.16%)
Mutual labels:  websocket-client
Elixir Companies
A list of companies currently using Elixir in production.
Stars: ✭ 1,475 (+1089.52%)
Mutual labels:  phoenix
Xsound
Web Audio API Library for Synthesizer, Effects, Visualization, Multi-Track Recording, Audio Streaming, Visual Audio Sprite ...
Stars: ✭ 123 (-0.81%)
Mutual labels:  websocket-client
Php Wss
Web-socket server/client with multi-process and parse templates support on server and send/receive options on client
Stars: ✭ 117 (-5.65%)
Mutual labels:  websocket-client
Yummy Phoenix Graphql
Cooking recipe sharing app built with Phoenix, React, GraphQL and Kubernetes
Stars: ✭ 112 (-9.68%)
Mutual labels:  phoenix

Birdsong: Phoenix Channels WebSockets client for iOS & OS X

Birdsong

An iOS & OS X WebSockets client for use with Phoenix Channels. Supports Phoenix Presence!

As of version 0.3.0, Birdsong requires Swift 3.0+. Please use version 0.2.2 if you need Swift 2.2 support.

Version 0.6 onwards supports Swift 4 using Starscream 3.0.

Usage

import Birdsong



// In your view controller / client
let socket = Socket(url: NSURL(string: "http://localhost:4000/socket/websocket")!, params: ["key": "secret"])



socket.onConnect = {
    let channel = self.socket.channel("rooms:some-topic", payload: ["user": "spartacus"])
    channel.on("new:msg", callback: { message in
        print("New message: \(message)")
    })

    channel.join()?.receive("ok", callback: { payload in
        print("Successfully joined: \(channel.topic)")
    })

    channel.send("new:msg", payload: ["body": "Hello!"])
        .receive("ok", callback: { response in
            print("Sent a message!")
        })
        .receive("error", callback: { reason in
            print("Message didn't send: \(reason)")
        })

    // Presence support.
    channel.presence.onStateChange = { newState in
        // newState = dict where key = unique ID, value = array of metas.
        print("New presence state: \(newState)")
    }

    channel.presence.onJoin = { id, meta in
        print("Join: user with id \(id) with meta entry: \(meta)")
    }

    channel.presence.onLeave = { id, meta in
        print("Leave: user with id \(id) with meta entry: \(meta)")
    }
}

socket.connect()

Example

To 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. 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.

Installation

Available on CocoaPods:

platform :ios, '9.0'
use_frameworks!

pod 'Birdsong', '~> 0.6'

If you need Swift 2.2 compatibility, please use version 0.2.2.

Author

Simon Manning — [email protected]

License

Birdsong is available under the MIT license. See the LICENSE file for more info.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].