[GH-ISSUE #331] iOS instant notification while self-hosting doesn't seem to be working #257

Closed
opened 2026-05-07 00:22:22 +02:00 by BreizhHardware · 4 comments

Originally created by @Xaelias on GitHub (Jun 18, 2022).
Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/331

So a coworker of mine mentioned this app to me. And I'm trying it out but I don't seem to be able to get any push notification without manually polling my topics. Which makes is non-usable for what I need (I know it's not your fault :-D ).

Anywho, I run the server locally, it's not exposed to the outside world, I will be relying on local network / vpn for my phone to be able to talk to the server.

NTFY_UPSTREAM_BASE_URL is set to https://ntfy.sh (which shouldn't matter is my understanding since that's the default value).
But whenever I try to publish a notification my phone doesn't react until I go check manually.

I've tried the following (using max priority just in case):

  • subscribe to a topic on https://ntfy.sh → this works as expected, so my phone can receive notifications :-D
  • subscribe to a topic on self-hosted, with the default server as my self-hosted → nothing
  • subscribe to a topic on self-hosted, with the default server as https://ntfy.sh (just in case) → nothing

I do see in the logs the following:

2022/06/18 17:34:53 DEBUG 10.200.0.1/test/MuYJ5DfzCc3u Publishing poll request to https://ntfy.sh/...

so it's trying...

Any idea of what's (not) happening?
Thanks :-)

PS: Technically running in k8s if that matters

Originally created by @Xaelias on GitHub (Jun 18, 2022). Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/331 So a coworker of mine mentioned this app to me. And I'm trying it out but I don't seem to be able to get any push notification without manually polling my topics. Which makes is non-usable for what I need (I know it's not your fault :-D ). Anywho, I run the server locally, it's not exposed to the outside world, I will be relying on local network / vpn for my phone to be able to talk to the server. `NTFY_UPSTREAM_BASE_URL` is set to `https://ntfy.sh` (which shouldn't matter is my understanding since that's the default value). But whenever I try to publish a notification my phone doesn't react until I go check manually. I've tried the following (using max priority just in case): - subscribe to a topic on https://ntfy.sh → this works as expected, so my phone can receive notifications :-D - subscribe to a topic on self-hosted, with the default server as my self-hosted → nothing - subscribe to a topic on self-hosted, with the default server as https://ntfy.sh (just in case) → nothing I do see in the logs the following: ``` 2022/06/18 17:34:53 DEBUG 10.200.0.1/test/MuYJ5DfzCc3u Publishing poll request to https://ntfy.sh/... ``` so it's trying... Any idea of what's (not) happening? Thanks :-) PS: Technically running in k8s if that matters
BreizhHardware 2026-05-07 00:22:22 +02:00
Author
Owner

@binwiederhier commented on GitHub (Jun 18, 2022):

I'm sorry it's not working correctly. It's sad that we have to jump through so many hoops to get it working at all.

Anywho, I run the server locally, it's not exposed to the outside world, I will be relying on local network / vpn for my phone to be able to talk to the server.

This shouldn't be a problem as long as your phone can talk to the server.

NTFY_UPSTREAM_BASE_URL is set to https://ntfy.sh (which shouldn't matter is my understanding since that's the default value).

It is NOT the default value. By default, it doesn't forward poll requests at all.

But whenever I try to publish a notification my phone doesn't react until I go check manually.

Can you elaborate what this means? Do you get a notification (an actual iOS popup-notification), but only when you pick up the phone? Or do you not get an iOS notification at all, and you only see them in the ntfy app?

subscribe to a topic on https://ntfy.sh/ → this works as expected, so my phone can receive notifications :-D

This is good. That means that Firebase/APNS is working.

Publishing poll request

This is also good, that means you've got the upstream URL configured correctly.

Any idea of what's (not) happening?

The default server (base URL) in your app and for the topic you subscribe to has to match EXACTLY with the base-url configured in your ntfy server. So if you set base-url: http://myserver.lan in the server.yml, you must use that exact URL as default server in the iOS app. If you use base-url: http://192.168.1.2 and myserver.lan as default server, the poll-topic SHA256 won't match and messages will not get to your device. See https://ntfy.sh/docs/config/#ios-instant-notifications for details of what this means?

You can try to do this:

echo -n "http://myserver.lan/mytopic" | sha256sum

The result should match the 64 byte hex string you see in the log message you linked (Publishing poll request to https://ntfy.sh/...). If it doesn't, something ain't right.

Soooo, do they match exactly?

<!-- gh-comment-id:1159535482 --> @binwiederhier commented on GitHub (Jun 18, 2022): I'm sorry it's not working correctly. It's sad that we have to jump through so many hoops to get it working at all. > Anywho, I run the server locally, it's not exposed to the outside world, I will be relying on local network / vpn for my phone to be able to talk to the server. This shouldn't be a problem as long as your phone can talk to the server. > NTFY_UPSTREAM_BASE_URL is set to https://ntfy.sh (which shouldn't matter is my understanding since that's the default value). It is NOT the default value. By default, it doesn't forward poll requests at all. > But whenever I try to publish a notification my phone doesn't react until I go check manually. Can you elaborate what this means? Do you get a notification (an actual iOS popup-notification), but only when you pick up the phone? Or do you not get an iOS notification at all, and you only see them in the ntfy app? > subscribe to a topic on https://ntfy.sh/ → this works as expected, so my phone can receive notifications :-D This is good. That means that Firebase/APNS is working. > Publishing poll request This is also good, that means you've got the upstream URL configured correctly. > Any idea of what's (not) happening? The default server (base URL) in your app and for the topic you subscribe to has to match EXACTLY with the base-url configured in your ntfy server. So if you set `base-url: http://myserver.lan` in the server.yml, you must use that exact URL as default server in the iOS app. If you use `base-url: http://192.168.1.2` and `myserver.lan` as default server, the poll-topic SHA256 won't match and messages will not get to your device. See https://ntfy.sh/docs/config/#ios-instant-notifications for details of what this means? You can try to do this: ``` echo -n "http://myserver.lan/mytopic" | sha256sum ``` The result should match the 64 byte hex string you see in the log message you linked (`Publishing poll request to https://ntfy.sh/...`). If it doesn't, something ain't right. Soooo, do they match exactly?
Author
Owner

@Xaelias commented on GitHub (Jun 18, 2022):

Ugh I feel dumb now... They almost matched. Except base url didn't have the http:// prefix...
Now it works great. Thanks :-)

<!-- gh-comment-id:1159544058 --> @Xaelias commented on GitHub (Jun 18, 2022): Ugh I feel dumb now... They _almost_ matched. Except base url didn't have the `http://` prefix... Now it works great. Thanks :-)
Author
Owner

@binwiederhier commented on GitHub (Jun 18, 2022):

Don't feel dumb. This is still a bug. It's a UX bug. It has to be simpler. If you have any idea to make this simpler let me know!!

<!-- gh-comment-id:1159544792 --> @binwiederhier commented on GitHub (Jun 18, 2022): Don't feel dumb. This is still a bug. It's a UX bug. It has to be simpler. If you have any idea to make this simpler let me know!!
Author
Owner

@Xaelias commented on GitHub (Jun 18, 2022):

Don't feel dumb. This is still a bug. It's a UX bug. It has to be simpler. If you have any idea to make this simpler let me know!!

There is a reason I'm not doing any UI/UX work xD

I guess it kind depends how that value is handled in the serve vs. client. The easiest way is probably to hide this from the user and just prefix the endpoint with http:// in both the apps and the server if it's not explicitly provided. Or the opposite. Validate that the value starts with the protocol and error out (on both the client and server) if that's not true, to ensure the config uses http/https.

<!-- gh-comment-id:1159555489 --> @Xaelias commented on GitHub (Jun 18, 2022): > Don't feel dumb. This is still a bug. It's a UX bug. It has to be simpler. If you have any idea to make this simpler let me know!! There is a reason I'm not doing any UI/UX work xD I guess it kind depends how that value is handled in the serve vs. client. The easiest way is probably to hide this from the user and just prefix the endpoint with `http://` in both the apps and the server if it's not explicitly provided. Or the opposite. Validate that the value starts with the protocol and error out (on both the client and server) if that's not true, to ensure the config uses `http`/`https`.
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#257
No description provided.