Push Notifications to specific users without using backend webservice RRS feed

  • Question

  • Hi

    I have done sending push notification to specific user(in my case I am registering individual user to username tag) using the tutorial given here

    https://azure.microsoft.com/en-us/documentation/articles/notification-hubs-aspnet-backend-windows-dotnet-notify-users/ .

    Can we achieve the same thing without using a webapp that is hosted?

    Like in the phone we can register a user like

    var channel = await PushNotificationChannelManager.CreatePushNotificationChannelForApplicationAsync();
    var hub = new NotificationHub(AzureHubName,AzureAccessSignature);
    var result = await hub.RegisterNativeAsync(channel.Uri,username);

    And while sending a notification to particular user we can do like this from desktop side

    NotificationHubClient hub = NotificationHubClient.CreateClientFromConnectionString(
    var toast = @"<toast><visual><binding template=""ToastText01""><text id=""1"">" +
                            "From " + "console" + ": " + "hi" + "</text></binding></visual></toast>";
    var outcome = await hub.SendWindowsNativeNotificationAsync(toast, username);

    In both the ways i.e hosting a webapp and sending it through above code, same can be achieved.

    So in which cases we need to use what or what is the advantages of each or why we need to host a web app to handle PN as provided in the above link? Please suggest.

    • Edited by nucleons Tuesday, July 21, 2015 9:33 AM
    Tuesday, July 21, 2015 9:18 AM