Skip to content

hazzelnuts/ntfy-for-delphi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ntfy was made by Philipp C. Heckel. Consider leaving a star on 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. 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. Support for NetHTTP is on work.

🚀 Basic ntfy server

For purposes of demonstration, I created a small demo showing you how to setup your own server using railway, which is only one of many alternatives to you self-host ntfy server. Click on the link bellow.

https://youtu.be/auJICXtxoNA

Screen Shot 2023-03-24 at 17 56 41