[GH-ISSUE #472] Ntfy Notification in c# #359

Closed
opened 2026-05-07 00:23:28 +02:00 by BreizhHardware · 6 comments

Originally created by @bravery-only on GitHub (Nov 7, 2022).
Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/472

Is there a sample to receive notifications in C#?

Originally created by @bravery-only on GitHub (Nov 7, 2022). Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/472 Is there a sample to receive notifications in C#?
BreizhHardware 2026-05-07 00:23:28 +02:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@binwiederhier commented on GitHub (Nov 8, 2022):

Courtesy of one of my colleagues:

HttpClient client = new HttpClient();
using (var result = await client.GetStreamAsync("https://ntfy.sh/disk-alerts/json"))
{
  using (var reader = new StreamReader(result))
  {
     while(!reader.EndOfStream)
     {
       System.Console.WriteLine(reader.ReadLine());
     }
   }
}
<!-- gh-comment-id:1306579490 --> @binwiederhier commented on GitHub (Nov 8, 2022): Courtesy of one of my colleagues: ``` cpp HttpClient client = new HttpClient(); using (var result = await client.GetStreamAsync("https://ntfy.sh/disk-alerts/json")) { using (var reader = new StreamReader(result)) { while(!reader.EndOfStream) { System.Console.WriteLine(reader.ReadLine()); } } } ```
Author
Owner

@binwiederhier commented on GitHub (Nov 8, 2022):

Let me know if it works so we can add it to the docs.

<!-- gh-comment-id:1306579735 --> @binwiederhier commented on GitHub (Nov 8, 2022): Let me know if it works so we can add it to the docs.
Author
Owner

@bravery-only commented on GitHub (Nov 8, 2022):

What code should we type for windows form? And where should we put the address of ntfy topic?

<!-- gh-comment-id:1306607653 --> @bravery-only commented on GitHub (Nov 8, 2022): What code should we type for windows form? And where should we put the address of ntfy topic?
Author
Owner

@bravery-only commented on GitHub (Nov 8, 2022):

Screenshot_2

<!-- gh-comment-id:1306611874 --> @bravery-only commented on GitHub (Nov 8, 2022): ![Screenshot_2](https://user-images.githubusercontent.com/42680639/200474326-f30d41ad-1199-4550-b192-8f44b676a08e.jpg)
Author
Owner

@binwiederhier commented on GitHub (Nov 8, 2022):

This is not the right place to learn C#. I asked my coworkers as a courtesy, but that's about it. I hope you understand.

<!-- gh-comment-id:1306615241 --> @binwiederhier commented on GitHub (Nov 8, 2022): This is not the right place to learn C#. I asked my coworkers as a courtesy, but that's about it. I hope you understand.
Author
Owner

@bravery-only commented on GitHub (Nov 8, 2022):

I mean, how can I receive notifications in C#?

<!-- gh-comment-id:1306618789 --> @bravery-only commented on GitHub (Nov 8, 2022): I mean, how can I receive notifications in C#?
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ntfy#359
No description provided.