private void btnHistory_Click(object sender, RoutedEventArgs e) { //Channel name string channel = "hello_world"; // Initialize pubnub state Pubnub pubnub = new Pubnub( "demo", // PUBLISH_KEY "demo", // SUBSCRIBE_KEY "demo", // SECRET_KEY "", // CIPHER_KEY (Cipher key is Optional) false // SSL_ON? ); Pubnub.ResponseCallback respCallback = delegate(object response) { List<object> result = (List<object>)response; if (result != null && result.Count() > 0) { for (int i = 0; i < result.Count(); i++) { System.Diagnostics.Debug.WriteLine(result[i]); } } }; Dictionary<string, object> args = new Dictionary<string, object>(); args.Add("channel", channel); args.Add("limit", 3.ToString()); args.Add("callback", respCallback); pubnub.History(args); }
private void btnHistory_Click(object sender, RoutedEventArgs e) { //Channel name string channel = "hello_world"; // Initialize pubnub state Pubnub pubnub = new Pubnub( "demo", // PUBLISH_KEY "demo", // SUBSCRIBE_KEY "demo", // SECRET_KEY "", // CIPHER_KEY (Cipher key is Optional) false // SSL_ON? ); Pubnub.ResponseCallback respCallback = delegate(object response) { List <object> result = (List <object>)response; if (result != null && result.Count() > 0) { for (int i = 0; i < result.Count(); i++) { System.Diagnostics.Debug.WriteLine(result[i]); } } }; Dictionary <string, object> args = new Dictionary <string, object>(); args.Add("channel", channel); args.Add("limit", 3.ToString()); args.Add("callback", respCallback); pubnub.History(args); }
static public void test_history() { Pubnub.ResponseCallback histCallback = delegate(object response) { List <object> result = (List <object>)response; Debug.WriteLine("[History data]"); foreach (object data in result) { Debug.WriteLine(data); } }; // Initialize pubnub state Pubnub objPubnub = new Pubnub( "demo", // PUBLISH_KEY "demo", // SUBSCRIBE_KEY "demo", // SECRET_KEY "", // CIPHER_KEY (Cipher key is Optional) false // SSL_ON? ); //define channel string channel = "hello-world"; // History Dictionary <string, object> argsHist = new Dictionary <string, object>(); argsHist.Add("channel", channel); argsHist.Add("limit", 3.ToString()); argsHist.Add("callback", histCallback); objPubnub.History(argsHist); }
private void btnHistory_Click(object sender, RoutedEventArgs e) { Pubnub.ResponseCallback respCallback = delegate(object response) { List <object> result = (List <object>)response; if (result != null && result.Count() > 0) { for (int i = 0; i < result.Count(); i++) { System.Diagnostics.Debug.WriteLine(result[i]); } } }; Dictionary <string, object> args = new Dictionary <string, object>(); args.Add("channel", channel); args.Add("limit", 3.ToString()); args.Add("callback", respCallback); pubnub.History(args); }