public async void UnregisterFromAzurePushNotification() { var channel = await PushNotificationChannelManager.CreatePushNotificationChannelForApplicationAsync(); var hub = new NotificationHub(PushNotificationCredentials.AzureNotificationHubName, PushNotificationCredentials.AzureListenConnectionString); await hub.UnregisterNativeAsync(); }
public void UnregisterFromAzurePushNotification() { var channel = HttpNotificationChannel.Find("MyPushChannel"); if (channel == null) { channel = new HttpNotificationChannel("MyPushChannel"); channel.Open(); channel.BindToShellToast(); } channel.ChannelUriUpdated += async (o, args) => { var hub = new NotificationHub(PushNotificationCredentials.AzureNotificationHubName, PushNotificationCredentials.AzureListenConnectionString); await hub.UnregisterNativeAsync(); await hub.UnregisterAllAsync(args.ChannelUri.ToString()); }; }
public async void UnregisterNativeAsync(string notificationHubPath, string connectionString) { var hub = new Microsoft.WindowsAzure.Messaging.NotificationHub(notificationHubPath, connectionString); await hub.UnregisterNativeAsync(); }
private async void btnUnregister_Click(object sender, RoutedEventArgs e) { NotificationHub hub = new NotificationHub(NOTIFICATION_HUB_NAME, CONNECTION_STRING); await hub.UnregisterNativeAsync(); ShowPushChannel(); }