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 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.
You need to add src
folder to your library path or search path.
boss install github.com/hazzelnuts/ntfy-for-delphi
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;
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.
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.
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 | ❌ |
Ntfy for Delphi uses a few libraries in the messages subscription and publishing mechanism. There is no need to install. The respective credit adviced.
- NxHorizon by Dalija Prasnikar.
- Indy10 by IndySockets.
- JsonToDelphiClass by Petar Georgiev.
- NetHTTP (On development 🛠)
Ntfy for Delphi it's an open source project under the MIT license. Feel free to use or contribute!
For the moment this library uses OpenSSL and is necessary to have it in the executable's folder. Support for NetHTTP is on work.