why do not relays could offer that service? A client might tell them means to push notify them as well as the criteria.
Discussion
> Why do not relays could offer that service?
It is because current relay softwares like strfry, nostream, nostr-rs-relay and other relay softwares didn't have those features yet. It need some standard (NIPs) at first before relay developers make those custom features.
Therefore clients developers make workaround by monitoring relay with additional app outside their Nostr clients. Relay operators usually just run relay software without modifying any relay softwares code (not all relay operators are developers and they didn't have obligations to) 😅
So in short they could, but do not, because nobody cares/thinks about it?
Which clients do monitor relays?
Yes, they could but they don't have any obligation to do so since it is not "standard features" defined by any NIPs. Start with NIPs and convince (make issue, pull request, or bounties) relay developers (many implementation) to do that is the way. Since it is hard thus client developer(s) choose to monitor relay data on their own as solution by running custom software in server to support their client software.
AFAIK, Amethyst do that https://github.com/vitorpamplona/amethyst/blob/main/app/src/play/java/com/vitorpamplona/amethyst/service/notifications/PushNotificationUtils.kt . Other client like ZBD might do that. Not sure with other clients.
The code you mentioned does not monitor a relay, instead requests a firebase push notification token.
I think you can easily look in RegisterAccountd.kt so i don't mention that 😄
Look at lines 81, Vitor post Firebase token to his server to make push notification feature works. push.amethyst.social handle any notifications for Amethyst
so I guess push.amethyst.social will then montitor relays and send push notifications, not the client app Amethyst!
But why I do net get any at all, apart from notofications for zaps?
Yes, it is not baked directly in client otherwise it might drain quite a lot battery. Running additional app in server is more reasonable choice. I have already said that in previous reply "... client developer(s) choose to monitor relay data on their own as solution by running custom software in server to support their client software." push.amethyst.social use firebase token to send push notifications and will wake up/run Amethyst to show notifications.
Amethyst only show Zap (9735), DM (4) and Gift-wrapped DM (1059) notifications if i'm not mistaken.
Server code for notifications:
https://github.com/vitorpamplona/amethyst-push-notif-server/blob/main/index.mjs