Pusher.NET implementation using SocketRocket for Xamarin.iOS.
We use Xamarin.iOS for developing Mural.ly iOS App, we use Pusher on our Architecture and we needed to connect on the iOS App. We took the great transport agnostic implementation from Pusher.NET and the C# bindings of SocketRocket and put together a library.
SocketRocket is a WebSocket Implementation for iOS created by the Square Team.
var factory = new Pusher.Connections.SocketRocket.WebsocketConnectionFactory();
this.pusher = new Pusher.Pusher(factory, "you-pusher-api-key", new Options
{
Authenticator = // any IAuthenticator if private channels needed
});
await this.pusher.ConnectAsync();
this.channel = (Channel)await pusher.SubscribeToChannelAsync("your-channel-name");
this.channel.EventEmitted += async (sender, e) =>
{
if (e.EventName == "pusher_internal:subscription_succeeded")
{
Console.WriteLine(e.Data) // Get the event data
}
};
This is work in progress created by @leChantux, @juliracca, @johnnyhalife