Create Pull Request
| Date | Scan | Status | Result |
|---|---|---|---|
| 2026-01-14 00:00 | #250 | in_progress |
Clean
|
| 2026-01-13 00:00 | #246 | completed |
Clean
|
| 2026-01-11 00:00 | #240 | completed |
Clean
|
| 2026-01-10 00:00 | #237 | completed |
Clean
|
| 2026-01-09 00:34 | #234 | completed |
Clean
|
| 2026-01-08 00:53 | #231 | completed |
Clean
|
| 2026-01-06 18:15 | #225 | cancelled |
Clean
|
| 2025-08-17 00:01 | #83 | cancelled |
Clean
|
| 2025-07-13 21:37 | #48 | completed |
Clean
|
| 2025-07-12 23:44 | #41 | cancelled |
Biased
|
private async void InitNotificationsAsync()
{
var channel = await PushNotificationChannelManager.CreatePushNotificationChannelForApplicationAsync();
var hub = new NotificationHub("[HubName]", "[DefaultListenSharedAccessSignature]");
var result = await hub.RegisterNativeAsync(channel.Uri);
// Displays the registration ID so you know it was successful
if (result.RegistrationId != null)
{
var dialog = new MessageDialog("Registration successful: " + result.RegistrationId);
dialog.Commands.Add(new UICommand("OK"));
await dialog.ShowAsync();
}
}
static async Task ReceiveMessageAndSendNotificationAsync(string connectionString)
{
// Initialize the Notification Hub
string hubConnectionString = ConfigurationManager.AppSettings.Get
("Microsoft.NotificationHub.ConnectionString");
hub = NotificationHubClient.CreateClientFromConnectionString
(hubConnectionString, "enterprisepushservicehub");
ServiceBusClient Client = new ServiceBusClient(connectionString);
ServiceBusReceiver receiver = Client.CreateReceiver(topicName, subscriptionName);
// Continuously process messages received from the subscription
while (true)
{
ServiceBusReceivedMessage message = await receiver.ReceiveMessageAsync();
var toastMessage = @"<toast><visual><binding template=""ToastText01""><text id=""1"">{messagepayload}</text></binding></visual></toast>";
if (message != null)
{
try
{
Console.WriteLine(message.MessageId);
Console.WriteLine(message.SequenceNumber);
string messageBody = message.Body.ToString();
Console.WriteLine("Body: " + messageBody + "\n");
toastMessage = toastMessage.Replace("{messagepayload}", messageBody);
SendNotificationAsync(toastMessage);
// Remove message from subscription
await receiver.CompleteMessageAsync(message);
}
catch (Exception)
{
// Indicate a problem, unlock message in subscription
await receiver.AbandonMessageAsync(message);
}
}
}
}
static async void SendNotificationAsync(string message)
{
await hub.SendWindowsNativeNotificationAsync(message);
}