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 btnUUID_Click(object sender, RoutedEventArgs e) { // 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? ); System.Diagnostics.Debug.WriteLine("UUID - > " + pubnub.UUID()); }
private void btnTime_Click(object sender, RoutedEventArgs e) { // 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; System.Diagnostics.Debug.WriteLine("Server Time : " + result[0]); }; pubnub.Time(respCallback); }