flatpak / xdg-desktop-portal

Desktop integration portal
https://flatpak.github.io/xdg-desktop-portal/
GNU Lesser General Public License v2.1
605 stars 194 forks source link

Notification portal documentation is confusing #580

Open ilya-fedin opened 3 years ago

ilya-fedin commented 3 years ago

I wanted to try to implement notification portal API in an application, but I got a lot of questions and I can't get how to use it properly.

  1. I see icon parameter, but I see no image parameter. Does this mean I should just pass application icon and I can't (shouldn't) pass some image representing the content, like a user's avatar?
  2. I see no way to set custom sound for a notification.
  3. How can I set an icon for a notification button (like I used to with the FD.o standard)?
  4. How can I set notification category?
  5. How it gets what application shown the notification? I see no parameter for desktop file.
  6. How can I know whether HTML is supported by notification daemon or not?
  7. How can I know when the notification is closed in order to free all the data allocated for it?
  8. What's default-action-target and target in buttons for?

For me the API seems like a fatal regression from the FD.o API, there are no even basic things that present in the latter, even though notification APIs on other OSes have a way more rich notification APIs like quick reply, text columns, selection menus, mutiple image types, notification grouping and etc, etc.

ilya-fedin commented 3 years ago

Personally I don't use persistence features, but I can imagine one lacks them, too.

WhyNotHugo commented 3 years ago

Regarding the first item, it seems you can just use icon to pass a custom image:

For bytes icons, the string is "bytes", and the value is a bytestring containing the icon data in png, jpeg or svg form.

ilya-fedin commented 3 years ago

I can, but should I? How much is this intended? Maybe it's invented for icons sent as data rather than any image?