private void Authenticate()
        {
            if (authProvider == null)
            {
                throw new Exception("You must provide api credentials to subscribing to private streams");
            }

            var p = authProvider.AddAuthenticationToHeaders("/realtime", HttpMethod.Get, new Dictionary <string, object>(), true, PostParameters.InBody, ArrayParametersSerialization.Array);
            var t = JsonConvert.SerializeObject(new { @event = "quoine:auth_request", data = new{ path = "/realtime", headers = new Dictionary <string, string>()
                                                                                                  {
                                                                                                      { "X-Quoine-Auth", p["X-Quoine-Auth"] }
                                                                                                  } } });

            Console.WriteLine(t);
            _pusherClient.Bind("quoine:auth_success", onSuccessAuth);
            _pusherClient.Bind("quoine:auth_failure", onNotSuccessAuth);
            _pusherClient.SendMessage(t);
        }
Ejemplo n.º 2
0
        private void InitializePusher()
        {
            Pusher.host     = "ws.staging.pusherapp.com";
            Pusher.ws_port  = 4502;
            Pusher.wss_port = 4503;
            string rootUri = Application.Current.Host.Source.Scheme + "://" + Application.Current.Host.Source.Host;
            string authUri = rootUri + "/pusher/auth/";

            Pusher.channel_auth_endpoint = authUri;

            Pusher.OnLog += new PusherLogHandler(Pusher_OnLog);
            _pusher       = new Pusher("YOUR_APP_KEY");

            _pusher.Bind("open", Opened);
        }
Ejemplo n.º 3
0
 public void SubscribeListed(Action <dynamic> callback)
 {
     pusher.Subscribe("inventory_changes");
     pusher.Bind("listed", callback);
 }