Allow use upstream-base-url config for Android app#82
Conversation
This mirrors the logic used for instant notifications in the iOS app: * When a user subscribes to a topic, the app will subscribe to Firebase using sha256(baseUrl + topic). * When a "poll_request" call is received from Firebase, the app will look up the sha256(baseUrl + topic) of all subscriptions in the database and see if the poll_request topic matches that. If it does, it will poll the original server using the stored baseUrl from the subscriptions database.
d1fc271 to
eee093f
Compare
|
@binwiederhier any interest in merging this? |
|
I like this a lot. Let me see if I can get this merged. Thanks for the contribution, and sorry it took sooooooo long to respond. |
|
I was playing with this for a bit, and while the delivery works just fine, the UI does not allow de-selecting instant delivery for topics from other servers. I also think we can't just unhide the I will play with it more (https://github.com/binwiederhier/ntfy-android/tree/android_poll_request). Also, I just realized you made "ConnectBot". I randomly clicked on your name and website. Very cool. Thank you for that!! |
| val constraints = Constraints.Builder() | ||
| .setRequiredNetworkType(NetworkType.CONNECTED) | ||
| .build() | ||
| val workName = "${PollWorker.WORK_NAME_ONCE_SINGE_PREFIX}_${baseUrl}_${topic}" |
There was a problem hiding this comment.
Typo? "SINGE" -> "SINGLE"?
There was a problem hiding this comment.
Yes, that could be changed in another commit. It was an existing spelling mistake.
So you're worried about self-hosted ntfy instances that either have no For the first case, it seems like a documentation issue. A descriptive piece of text could be added near the "[ ] Instant notification" checkbox saying that if the server does not have the "upstream server" configured, delivery might be delayed without that checked. It could link to the website for more explanation. However, I don't know how many support requests this will generate. Maybe just indicate it's always safe to keep "Instant delivery" enabled. Actually, I think there is an existing issue that if you set a different "Default server" you can't check the "Instant delivery" box without clicking on "Use another server" anyway. This may cause delivery latency to increase if your "Default server" doesn't match the
No problem. I've recently begun to modernize that app after a significant lack up updates in recent years as well. |
|
Heyo 👋 I've arrived here from binwiederhier/ntfy#1195 after noticing my system report Ntfy as responsible for >20% of my battery usage. It would be rather cool to see this move forward! |
|
This would be amazing and make ntfy usable for my usecase. Please make this happen! |
This mirrors the logic used for instant notifications in the iOS app:
When a user subscribes to a topic, the app will subscribe to Firebase using
sha256(baseUrl + topic).When a "poll_request" call is received from Firebase, the app will look up the
sha256(baseUrl + topic)of all subscriptions in the database and see if thepoll_requesttopic matches that. If it does, it will poll the original server using the stored baseUrl from the subscriptions database.This fixes binwiederhier/ntfy#358