GitHunt
AF

afnsldd/ntfy-for-delphi

A friendly library to push instant notifications using ntfy.sh servers in Delphi

Ntfy was made by Philipp C. Heckel. Consider leaving a star in his project. As Philipp C. Heckel stated, this service will stay free, so any kind of support to afford costs help with cloud hosting will be warmly received. You can also self-host ntfy server. Visit docs.ntfy.sh to get started with documentation.

๐Ÿ”” Ntfy for Delphi

Ntfy for Delphi it's a friendly library to work with ntfy.sh servers in Delphi. It allows you publishing messages and subscribing to topics to receive instant notifications.

โš™๏ธ Manual Installation

You need to add src folder to your library path or search path.

โš™๏ธ Boss Installation

  boss install github.com/hazzelnuts/ntfy-for-delphi

โšก๏ธ Quickstart

Push a notification on a specific topic. Topics are the same as channels and the name you choose will become a public url, so remember to make difficult to guess it.

uses
  Notify;

begin
  Ntfy.Notification(
    New.Notification
      .Topic('your-very-secret-topic')
      .Title('โšพ Go to the game')
      .MessageContent('Tomorrow at 10:00hs ') 
  );

  Ntfy.Publish;
end;

๐Ÿ’ฌ Subscribe to a topic

You can subscribe to a topic through several ways. For instance, the Web App, Android, CLI or you can use this library as follows:

uses
  Notify;

begin
  Ntfy.Subscribe('your-very-secret-topic', 
    procedure (AEvent: INotifyEvent)
    begin
      WriteLn('You received a message: ' +  AEvent.MessageContent)
    end);
end;

There is a VCL Sample demonstration showing you how to use Delphi Ntfy subscription mechanism into your project.

โš™๏ธ Supported Version & Platforms


It hasn't been tested in some Delphi versions yet. You can help finding out informing with a PR update to this README file. In the PR, inform the selected badged.

โ›” Limitations

Support to notifications that contains broadcast actions has not been implemented. Likewise, some advanced specific resources has not yet been implemented as well.

Action Support
view โœ”
broadcast โŒ
http โœ”
Subscription Type Support
json โœ”
raw โŒ
sse โŒ
websocket โŒ

๐Ÿ”— Dependencies

Ntfy for Delphi uses a few libraries in the messages subscription and publishing mechanism. There is no need to install. The respective credit adviced.

๐ŸŒฑ Consider Contributing

Ntfy for Delphi it's an open source project under the MIT license. Feel free to use or contribute!

โš  Observations

For the moment this library uses OpenSSL and is necessary to have it in the executable's folder. Plannings for implementing future versions which supports NetHttp are under development.