Skip to content

Instantly share code, notes, and snippets.

@YuriyZaletskyy
Created November 23, 2020 19:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save YuriyZaletskyy/2b813ec12d8a46e46f971c3a65a7871d to your computer and use it in GitHub Desktop.
Save YuriyZaletskyy/2b813ec12d8a46e46f971c3a65a7871d to your computer and use it in GitHub Desktop.
var myHub = connection.CreateHubProxy("PushNotificationsHub");
connection.Start().ContinueWith(task =>
{
try
{
if (task.IsFaulted)
{
MessageBox.Show("There was an error during open of the connection: " +
task.Exception.GetBaseException());
}
else
{
myHub.Invoke<string>("Subscribe", "TestNotification").Wait();
}
}
catch (Exception ex)
{
MessageBox.Show("Error: " + ex.Message.ToString());
}
}).Wait();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment