server
server copied to clipboard
Allow the apps to send messages to specific clients
Right now apps broadcast messages to all subscribed clients, it would be nice if the apps could send messages just some of the clients, something like this
/message?token=<app_token>&client=<client_id>
Broadcast messages would still be available when the client_id is missing
Hey, thanks for your issue!
Do you have a specific use case for this?
We have a similar issue with a different solution https://github.com/gotify/android/issues/61 in there the client chooses to what applications it subscribes.
I thought this could be useful in a couple of use case like
- There are multiple clients that react to the notifications, something like tasker may be listening and trigger some actions with specific messages
- Some messages may not be relevant to all the clients, if I tablet is running out of battery it may send a message to the phone informing about it, right now it would broadcast the message and the tablet itself would receive the notification.
I also think gotify/android#61 can work together with this in the way you may want to silence the notifications even if they are target directly to your device
This was one of the first requested features when I brought this up to my team. It would be nice to at minimum set target clients for notifications, or put clients into groups.
As a use case example, we get alerts for things when they break. If we could define "groups of clients interested in windows-related notifications, and groups of clients interested in linux-related notifications" it would go a long way.
Yes this would be a nice feature. especialy for the stream websocket. subscribe to one application or send message to a client. Then one server can be used for mulitple apps.
When are you gonna add this feature?
I currently have other projects that I work on. Still, someone from the community can implement this feature if it is really needed :D.
Before someone takes this issue, it would be helpful to discuss the changes needed for this to work.. F.ex. if a client can see messages that were sent with another client id and only won't receive a push notification for it.
I came to this issue thinking "Why can't I configure which apps get to send to which users?"
It seems the model at the mo is
many apps >--< send many messages >--< many users
I'm just using gotify personally, so that's fine, but I'd like to start using it for other purposes. Like I'd like to be able to add clients who will only get certain categories of message (and must not see others), which seems to be what this issue is about, although there are quite different ideas.
-
this comment suggested that the client chooses which apps, from all of the apps available.
-
Another suggestion thread, if I've understood, is that the app has to know which users to send to. It feels like we need a clearer layer of abstraction than this.
Seems a more standard architecture that apps' responsibility is just to generate notifications with sutiable metadata, then the server can use that metadata, including the source app and server configuration to arrange delivery to appropriate clients.
e.g.
App: notification (tags/categories/source app)
Server: (configured by admin user)
- Clients given roles (or groups)
- Roles given one or more ACLs like:
- Allow all categories from all apps
- Allow category "sky is falling" from all aps
- Allow category all categories from mundane monitoring app
- Allow category "public" from "system status monitor app"
Clients:
- Get the notifications they're given, but can optionally mute some based on user prefs (I imagine this would be client-side).
Apologies if I've not understood anything or misrepresented the suggestions above!
@artfulrobot Yes, and I can certainly see that there is the need for this. The main issue why me (and I guess other collaborators) is hesitant on working on this is that it changed the data flow model significantly. Apps used to work solely independent of the client layer and they only care about producing messages, not knowing how many clients are there. Plugins like the gotify-broadcast I wrote can be used to get around this by providing the "category" layer through external plugins (in a rather dirty way tho).
I do agree with you that if we do this feature we are going to do it in the 2nd way you brought up (the "category" way). However, incorporating this idea into the main server just looked like too much disruption to the principle of keeping APIs simple by default (need a way to manage and sync configurations on categories to clients).
Hey, thanks for your issue!
Do you have a specific use case for this?
We have a similar issue with a different solution gotify/android#61 in there the client chooses to what applications it subscribes.
yeah each application has clients, so clients can subscribe only to the apps which they have a token for
Any updates on this? The request is now open since 2019 and a feature like that would be extremely helpful.