[GH-ISSUE #975] iOS not pushing notifications. Iphone12 Version 15.3.1 #683

Open
opened 2026-05-07 00:26:33 +02:00 by BreizhHardware · 8 comments

Originally created by @haonanor on GitHub (Dec 8, 2023).
Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/975

Question

My server.yml configuration:
base-url: "https://push.mydomain.com" listen-http: "localhost:6680" upstream-base-url: "https://ntfy.sh"

My Nginx configuration:
`
server {
listen 80;
server_name push.mydomain.com;

location / {
# Redirect HTTP to HTTPS, but only for GET topic addresses, since we want
# it to work with curl without the annoying https:// prefix
set $redirect_https "";
if ($request_method = GET) {
set $redirect_https "yes";
}
if ($request_uri ~* "^/([-_a-z0-9]{0,64}$|docs/|static/)") {
set $redirect_https "${redirect_https}yes";
}
if ($redirect_https = "yesyes") {
return 302 https://$http_host$request_uri$is_args$query_string;
}

proxy_pass http://localhost:6680;
proxy_http_version 1.1;

proxy_buffering off;
proxy_request_buffering off;
proxy_redirect off;

proxy_set_header Host $http_host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

proxy_connect_timeout 3m;
proxy_send_timeout 3m;
proxy_read_timeout 3m;

client_max_body_size 0; # Stream request body to backend

}
}
server
{
listen 443 ssl http2;
server_name push.mydomain.com;

#SSL-START SSL相关配置,请勿删除或修改下一行带注释的404规则
#error_page 404/404.html;
#HTTP_TO_HTTPS_START
if ($server_port !~ 443){
    rewrite ^(/.*)$ https://$host$1 permanent;
}
#HTTP_TO_HTTPS_END
ssl_certificate    /www/server/fullchain.pem;
ssl_certificate_key    /www/server/privkey.pem;
ssl_protocols TLSv1.1 TLSv1.2 TLSv1.3;
ssl_ciphers EECDH+CHACHA20:EECDH+CHACHA20-draft:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5;
ssl_prefer_server_ciphers on;
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 10m;
add_header Strict-Transport-Security "max-age=31536000";
error_page 497  https://$host$request_uri;

#SSL-END

#ERROR-PAGE-START  错误页配置,可以注释、删除或修改
#error_page 404 /404.html;
#error_page 502 /502.html;
#ERROR-PAGE-END
location / {
proxy_pass http://localhost:6680;
proxy_http_version 1.1;

proxy_buffering off;
proxy_request_buffering off;
proxy_redirect off;

proxy_set_header Host $http_host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

proxy_connect_timeout 3m;
proxy_send_timeout 3m;
proxy_read_timeout 3m;

client_max_body_size 0; # Stream request body to backend

}
}
`
However, I cannot receive instant push in IOS, and can only see the push data after pull-down refresh in the app

Toil answer

Originally created by @haonanor on GitHub (Dec 8, 2023). Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/975 <!-- Before you submit, consider asking on Discord/Matrix instead. You'll usually get an answer sooner, and there are more people there to help! - Discord: https://discord.gg/cT7ECsZj9w - Matrix: https://matrix.to/#/#ntfy:matrix.org / https://matrix.to/#/#ntfy-space:matrix.org --> :question: **Question** <!-- Go ahead and ask your question here :) --> My server.yml configuration: ` base-url: "https://push.mydomain.com" listen-http: "localhost:6680" upstream-base-url: "https://ntfy.sh" ` My Nginx configuration: ` server { listen 80; server_name push.mydomain.com; location / { # Redirect HTTP to HTTPS, but only for GET topic addresses, since we want # it to work with curl without the annoying https:// prefix set $redirect_https ""; if ($request_method = GET) { set $redirect_https "yes"; } if ($request_uri ~* "^/([-_a-z0-9]{0,64}$|docs/|static/)") { set $redirect_https "${redirect_https}yes"; } if ($redirect_https = "yesyes") { return 302 https://$http_host$request_uri$is_args$query_string; } proxy_pass http://localhost:6680; proxy_http_version 1.1; proxy_buffering off; proxy_request_buffering off; proxy_redirect off; proxy_set_header Host $http_host; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_connect_timeout 3m; proxy_send_timeout 3m; proxy_read_timeout 3m; client_max_body_size 0; # Stream request body to backend } } server { listen 443 ssl http2; server_name push.mydomain.com; #SSL-START SSL相关配置,请勿删除或修改下一行带注释的404规则 #error_page 404/404.html; #HTTP_TO_HTTPS_START if ($server_port !~ 443){ rewrite ^(/.*)$ https://$host$1 permanent; } #HTTP_TO_HTTPS_END ssl_certificate /www/server/fullchain.pem; ssl_certificate_key /www/server/privkey.pem; ssl_protocols TLSv1.1 TLSv1.2 TLSv1.3; ssl_ciphers EECDH+CHACHA20:EECDH+CHACHA20-draft:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5; ssl_prefer_server_ciphers on; ssl_session_cache shared:SSL:10m; ssl_session_timeout 10m; add_header Strict-Transport-Security "max-age=31536000"; error_page 497 https://$host$request_uri; #SSL-END #ERROR-PAGE-START 错误页配置,可以注释、删除或修改 #error_page 404 /404.html; #error_page 502 /502.html; #ERROR-PAGE-END location / { proxy_pass http://localhost:6680; proxy_http_version 1.1; proxy_buffering off; proxy_request_buffering off; proxy_redirect off; proxy_set_header Host $http_host; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_connect_timeout 3m; proxy_send_timeout 3m; proxy_read_timeout 3m; client_max_body_size 0; # Stream request body to backend } } ` However, I cannot receive instant push in IOS, and can only see the push data after pull-down refresh in the app Toil answer
Author
Owner

@nclark commented on GitHub (Dec 22, 2023):

Not sure if this will help but I believe given the description here that the firebase subscription only happens when you subscribe in the app. I made the same change as you on my server then removed and added all of my subscriptions back in the iOS app and things started working 👌

<!-- gh-comment-id:1867946540 --> @nclark commented on GitHub (Dec 22, 2023): Not sure if this will help but I believe given the description [here](https://docs.ntfy.sh/config/#ios-instant-notifications) that the firebase subscription only happens when you subscribe in the app. I made the same change as you on my server then removed and added all of my subscriptions back in the iOS app and things started working 👌
Author
Owner

@brandonleon commented on GitHub (Apr 12, 2024):

I'm running into the same thing. I reinstalled the app numerous times, restarted the phone between installs. Furthermore, I get notifications on the phone if the app is opened but never an actual push notification.

I've even tried generating the sha256sum hash of the topic URL and subscribing to that directly on ntfy.sh, but I don't see any traffic on that topic.

<!-- gh-comment-id:2052245898 --> @brandonleon commented on GitHub (Apr 12, 2024): I'm running into the same thing. I reinstalled the app numerous times, restarted the phone between installs. Furthermore, I get notifications on the phone if the app is opened but never an actual push notification. I've even tried generating the sha256sum hash of the topic URL and subscribing to that directly on ntfy.sh, but I don't see any traffic on that topic.
Author
Owner

@ghost commented on GitHub (Apr 16, 2024):

I have been facing the same issue, I tried switching my base-url to internal IP address, external IP, reverse proxied hostname
I was using nginx, then tried switching to a port forwarded hostname, even tried ngrok, but the outcome didn't change
I also tried using http and https for both the Default Server on my phone and the base-url
None of them works, I always have to manually go into the app, open the topic and pull down to refresh
That's the only way I'm able to see the new messages

<!-- gh-comment-id:2059917990 --> @ghost commented on GitHub (Apr 16, 2024): I have been facing the same issue, I tried switching my [base-url](https://github.com/binwiederhier/ntfy/blob/main/server/server.yml#L14) to internal IP address, external IP, reverse proxied hostname I was using nginx, then tried switching to a port forwarded hostname, even tried ngrok, but the outcome didn't change I also tried using `http` and `https` for both the `Default Server` on my phone and the `base-url` None of them works, I always have to manually go into the app, open the topic and pull down to refresh That's the only way I'm able to see the new messages
Author
Owner

@brandonleon commented on GitHub (Apr 18, 2024):

Since making my previous comment it has started working. I have made no changes. @rustic-monkey my setup is identical to you with the exception of having upstream-base-url: "https://ntfy.sh" also configured.

<!-- gh-comment-id:2062783645 --> @brandonleon commented on GitHub (Apr 18, 2024): Since making my previous comment it has started working. I have made no changes. @rustic-monkey my setup is identical to you with the exception of having `upstream-base-url: "https://ntfy.sh"` also configured.
Author
Owner

@ghost commented on GitHub (Apr 18, 2024):

@brandonleon I'm glad you got it working, below are the only differences from template for server.yml

diff server.yml /etc/ntfy/server.yml 
14c14
< # base-url:
---
> base-url: <PRIVATE_IP_ADDRESS>
94,95c94,95
< # auth-file: <filename>
< # auth-default-access: "read-write"
---
> auth-file: /var/cache/ntfy/auth.db
> auth-default-access: "deny-all"
104c104
< # behind-proxy: false
---
> # behind-proxy: true
226c226
< #   upstream-base-url: "https://ntfy.sh"
---
> upstream-base-url: "https://ntfy.sh"

I tried all possible combinations for the base-url, nothing seems to fix the issue for me.

<!-- gh-comment-id:2062834510 --> @ghost commented on GitHub (Apr 18, 2024): @brandonleon I'm glad you got it working, below are the only differences from template for `server.yml` ```shell diff server.yml /etc/ntfy/server.yml 14c14 < # base-url: --- > base-url: <PRIVATE_IP_ADDRESS> 94,95c94,95 < # auth-file: <filename> < # auth-default-access: "read-write" --- > auth-file: /var/cache/ntfy/auth.db > auth-default-access: "deny-all" 104c104 < # behind-proxy: false --- > # behind-proxy: true 226c226 < # upstream-base-url: "https://ntfy.sh" --- > upstream-base-url: "https://ntfy.sh" ``` I tried all possible combinations for the `base-url`, nothing seems to fix the issue for me.
Author
Owner

@ghost commented on GitHub (Apr 18, 2024):

.... and this my docker run command

sudo docker run \
    --restart unless-stopped \
    -v /var/cache/ntfy:/var/cache/ntfy \
    -v /etc/ntfy:/etc/ntfy \
    -p 8090:80 \
    -itd \
    binwiederhier/ntfy \
    serve \
    --cache-file /var/cache/ntfy/cache.db
<!-- gh-comment-id:2062835331 --> @ghost commented on GitHub (Apr 18, 2024): .... and this my docker run command ```shell sudo docker run \ --restart unless-stopped \ -v /var/cache/ntfy:/var/cache/ntfy \ -v /etc/ntfy:/etc/ntfy \ -p 8090:80 \ -itd \ binwiederhier/ntfy \ serve \ --cache-file /var/cache/ntfy/cache.db ```
Author
Owner

@wunter8 commented on GitHub (Apr 18, 2024):

In general, to get iOS notifications to work, you need to:

  1. set base-url to your public domain (with "https://" and without a trailing slash)
  2. set the default server URL in the iOS app to your public domain (with "https://" and without a trailing slash)
  3. set upstream-base-url: "https://ntfy.sh" (make sure it doesn't have fancy quotation marks or anything. You can copy and paste it directly from here, but I know others have had issues copying from other locations)
<!-- gh-comment-id:2062848047 --> @wunter8 commented on GitHub (Apr 18, 2024): In general, to get iOS notifications to work, you need to: 1. set `base-url` to your public domain (with "https://" and without a trailing slash) 2. set the default server URL in the iOS app to your public domain (with "https://" and without a trailing slash) 3. set `upstream-base-url: "https://ntfy.sh"` (make sure it doesn't have fancy quotation marks or anything. You can copy and paste it directly from here, but I know others have had issues copying from other locations)
Author
Owner

@ghost commented on GitHub (Apr 18, 2024):

@wunter8 I can't believe that actually solved the problem, I believe I had a trailing slash / whenever I had my public domain in there. I redeployed my docker container with the exact same config without the trailing slash and it worked.
Thank you

<!-- gh-comment-id:2062864950 --> @ghost commented on GitHub (Apr 18, 2024): @wunter8 I can't believe that actually solved the problem, I believe I had a trailing slash `/` whenever I had my public domain in there. I redeployed my docker container with the exact same config without the trailing slash and it worked. Thank you
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#683
No description provided.