[GH-ISSUE #23] Android, Feature Request: allow subscribing to multiple topics #21

Closed
opened 2026-05-07 00:18:46 +02:00 by BreizhHardware · 3 comments

Originally created by @aslmx on GitHub (Nov 25, 2021).
Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/23

The Web and curl allow for subscribing to multiple topics, like this:

Subscribing to multiple topics (topic1,topic2,...)

It's possible to subscribe to multiple topics in one HTTP call by providing a comma-separated list of topics in the URL. This allows you to reduce the number of connections you have to maintain: 

That does not work in the app currently, but would make "following" multiple topics easier.

Originally created by @aslmx on GitHub (Nov 25, 2021). Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/23 The Web and curl allow for subscribing to multiple topics, like this: ``` Subscribing to multiple topics (topic1,topic2,...) It's possible to subscribe to multiple topics in one HTTP call by providing a comma-separated list of topics in the URL. This allows you to reduce the number of connections you have to maintain: ``` That does not work in the app currently, but would make "following" multiple topics easier.
Author
Owner

@binwiederhier commented on GitHub (Nov 26, 2021):

So you can obviously subscribe to multiple topics in the app by clicking the + button. So are you talking about

A. Subscribing to multiple topics in the same add dialog box? So that you'd enter a comma separated list and you'd only see one entry in the main view?

B. Or just a more convenient way to add multiple topics at once?

I think it would help if you described your preferred screen flow and text boxes. Sorry I'm just not quite grasping what's missing.

<!-- gh-comment-id:979532019 --> @binwiederhier commented on GitHub (Nov 26, 2021): So you can obviously subscribe to multiple topics in the app by clicking the + button. So are you talking about A. Subscribing to multiple topics in the same add dialog box? So that you'd enter a comma separated list and you'd only see one entry in the main view? B. Or just a more convenient way to add multiple topics at once? I think it would help if you described your preferred screen flow and text boxes. Sorry I'm just not quite grasping what's missing.
Author
Owner

@aslmx commented on GitHub (Nov 26, 2021):

Yeah, valid question - sorry, could have given more details!

Actually i thought about usecase A, having multiple topic subscriptions under one entry that can be added at once (and of course later be changed).

I'm not sure how you handle the long running http connection.

I'm not competent to check the source of the app and evaluate it myself, hence asking: would there a be a difference of listening to two topics in one http request (so letting the server decide to send you posts two either of the topic) or querying multiple topcis with it's own separate subscription?

If there is no difference, you might as well just allow adding two topics by comma separation and after the user clicked "Add" separate it into two individual subscriptions.

If it doesn't make any performance difference then I think it is up to you to decide.

Could as well add more UI complexity by asking the user. But i thought the simplest solution is to just copy what you support via WebUi and cURL, which is usecase A.

<!-- gh-comment-id:979785143 --> @aslmx commented on GitHub (Nov 26, 2021): Yeah, valid question - sorry, could have given more details! Actually i thought about usecase A, having multiple topic subscriptions under one entry that can be added at once (and of course later be changed). I'm not sure how you handle the long running http connection. I'm not competent to check the source of the app and evaluate it myself, hence asking: would there a be a difference of listening to two topics in one http request (so letting the server decide to send you posts two either of the topic) or querying multiple topcis with it's own separate subscription? If there is no difference, you might as well just allow adding two topics by comma separation and after the user clicked "Add" separate it into two individual subscriptions. If it doesn't make any performance difference then I think it is up to you to decide. Could as well add more UI complexity by asking the user. But i thought the simplest solution is to just copy what you support via WebUi and cURL, which is usecase A.
Author
Owner

@binwiederhier commented on GitHub (Nov 26, 2021):

I'm not sure how you handle the long running http connection. I'm not competent to check the source of the app and evaluate it myself, hence asking: would there a be a difference of listening to two topics in one http request (so letting the server decide to send you posts two either of the topic) or querying multiple topcis with it's own separate subscription?

I made the comma-separated multi-topic subscription especially for the Android app. The app only keeps one connection per host to avoid using double the battery.

Example: If you subscribe to topic1, it'll listen to https://ntfy.sh/topic1/json. If you then add topic2, it'll break the first connection and restart it as https://ntfy.sh/topic1,topic2/json. There is a little bit of UI-trickery to avoid showing that we're reconnecting, but that's what's happening.

If there is no difference, you might as well just allow adding two topics by comma separation and after the user clicked "Add" separate it into two individual subscriptions. If it doesn't make any performance difference then I think it is up to you to decide.

I can absolutely do that, though the "Subscribe to topic" dialog is already too crowded, so I fear another sentence a la "You may enter a comma-separated list to subscribe to multiple topics" is gonna be a little much. I'll experiment a bit. Though I am leaning towards not changing it.

If you're mainly worried about the annoyance of having to re-enter your home-server IP/address, I just added an automatic auto-fill to avoid that (see https://github.com/binwiederhier/ntfy/issues/13). In this screenshot, the server address is auto-filled, because it's the server that you've already used before. If there's more than one, there's a drop-down too now (this is not released yet):

image

<!-- gh-comment-id:980255545 --> @binwiederhier commented on GitHub (Nov 26, 2021): > I'm not sure how you handle the long running http connection. I'm not competent to check the source of the app and evaluate it myself, hence asking: would there a be a difference of listening to two topics in one http request (so letting the server decide to send you posts two either of the topic) or querying multiple topcis with it's own separate subscription? I made the comma-separated multi-topic subscription especially for the Android app. The app **only keeps one connection per host** to avoid using double the battery. Example: If you subscribe to `topic1`, it'll listen to `https://ntfy.sh/topic1/json`. If you then add `topic2`, it'll break the first connection and restart it as `https://ntfy.sh/topic1,topic2/json`. There is a little bit of UI-trickery to avoid showing that we're reconnecting, but that's what's happening. > If there is no difference, you might as well just allow adding two topics by comma separation and after the user clicked "Add" separate it into two individual subscriptions. If it doesn't make any performance difference then I think it is up to you to decide. I can absolutely do that, though the "Subscribe to topic" dialog is already too crowded, so I fear another sentence a la "You may enter a comma-separated list to subscribe to multiple topics" is gonna be a little much. I'll experiment a bit. Though I am leaning towards not changing it. If you're mainly worried about the annoyance of having to re-enter your home-server IP/address, I just added an automatic auto-fill to avoid that (see https://github.com/binwiederhier/ntfy/issues/13). In this screenshot, the server address is auto-filled, because it's the server that you've already used before. If there's more than one, there's a drop-down too now (this is not released yet): ![image](https://user-images.githubusercontent.com/664597/143618955-8426dff9-3af4-4edc-a809-d804cd1e41ec.png)
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ntfy#21
No description provided.