Generate notification in the Windows Sidebar for specific user?

Asked

Viewed 138 times

1

I am using Redis Pubsub to create a Chat Desktop and would like to generate a notification in the Windows sidebar to a user when they receive a message. Searching the internet soon found the following code here (http://portal.tdevrocks.com.br/2015/12/01/tutorial-notificacoes-no-windows-10-com-delphi-10-seattle/)

var
  Notificacao : TNotification;
begin
    Notificacao := NotificationCenter1.CreateNotification;
    try
      Notificacao.Name      := 'Nome Notificacao';
      Notificacao.Title     := 'Título da Notificação';
      Notificacao.AlertBody := 'Corpo da Notificação';
      NotificationCenter1.PresentNotification(Notificacao);
    finally
      Notificacao.Free;
    end;
end;

It works, generates a notification, but the problem is that the notification also appears to the user who sent the message. Is it possible to notify only the user who received it? If yes they can give me a direction of how to do it?

  • Can you identify who the notification is for? If something like addressee and sender? If it has do an if to validate for whom it should display

  • 1

    I can identify sending and receiving user, I will try some things here. Thank you.

  • 1

    @Gabriellocalhost Using the Redis Pubsub scheme, I did a validation where if the message recipient is my user and the message marker read is empty it notifies. I did some tests and it worked, thank you.

  • You’re welcome @Diego_f

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.