binwiederhier / ntfy

Send push notifications to your phone or desktop using PUT/POST
https://ntfy.sh
Apache License 2.0
18.17k stars 711 forks source link

iOS not pushing notifications. Ntfy needs to be refreshed to view them. #880

Closed g0d1k closed 10 months ago

g0d1k commented 1 year ago

:lady_beetle: Describe the bug

:computer: Components impacted

:bulb: Screenshots and/or logs

:crystal_ball: Additional context

naxels commented 1 year ago

I noticed something similar today: iOS itself would show the notification, however, opening the app (having it open previously + on the subscribed topic) would not show the notification even upon refresh of the list.

Closing the app & reopening it, would show the notification in the topic.

kevinlutzer commented 1 year ago

I am experiencing the same issue. I am running in a Kubernetes environment and here is my ConfigMap.

apiVersion: v1
kind: ConfigMap
metadata:
  name: ntfy
  namespace: ntfy
data:
  server.yml: |
    base-url: "https://myurl.com"
    upstream-base-url: "https://ntfy.sh"
    log-level: debug

I was able to refresh the subscription by pulling down on the view in IOS.

guisea commented 1 year ago

I too am unable to successfully receive push notifications to an iOS device.

Having tried this now on iPhone and iPad.

Was starting to feel crazy. I have company I see.

kaiwei commented 1 year ago

Count me in as another user facing the same issue.

guisea commented 1 year ago

@kaiwei I found notifications work perfectly fine if using the Progressive Web App instead of IOS native application.

Count me in as another user facing the same issue.

weirlive commented 1 year ago

same

Trystan34 commented 1 year ago

@ctschach's comment reported that a reinstall of the iOS app worked. Have any of you tried that?

guisea commented 1 year ago

I had tried re-installing a time or three on a couple devices to no avail.

However I have re-installed from App-Store again and it appears working now. On Mon, 9 Oct 2023 at 1:35 PM, Trystan @.***> wrote:

@ctschach's comment reported that a reinstall of the iOS app worked. Have any of you tried that? — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

Trystan34 commented 1 year ago

I am hosting the NTFY server using Docker.

My server listens on port 8080 (http) not SSL but due to the one of the useful features of CloudFlare, it provides a toggle for auto SSL encryption to the domain even though the actual NTFY server is listening on HTTP.

Originally I had my base-url set to the static ip of my Rasberry Pi but I did not receive the notifications, since changing it to my domain with https (even though I do not have HTTPS enabled in the ntfy server.yml) it works now.

image

My docker-compose file

version: "2.3"

services:
  ntfy:
    image: binwiederhier/ntfy
    container_name: ntfy
    command:
      - serve
    environment:
      - TZ=NZDT # optional: set desired timezone
    #user: 1000:1000 # optional: replace with your own user/group or uid/gid
    volumes:
      - /var/cache/ntfy/cache.db:/var/cache/ntfy
      - /etc/ntfy:/etc/ntfy
    ports:
      - "8080:80"
    restart: always

Since the Cloud Flare Tunnel points to my static ip of the Raspberry PI including port 8080, in the iOS app, I have the server set to just domain name excluding the port number.

g0d1k commented 1 year ago

I'm not sure if this applies to anyone else but I was using a domain I have to send notifications using the CLI, when I stopped using the domain and started using the server IP it works as it should. ie. 'curl -d "My Message" mydomain.com/mytopic' and when I send as 'curl -d "My Message" 192.168.1.1/mytopic' it works.

z3k0sec commented 12 months ago

I'm also not getting any notifications and have to manually refresh the app to get any notification messages. Hosting NTFY via Docker and exposing it via Cloudflare tunnel.

"base-url" is set to notify.example.com and the upstream server is the default one.

binwiederhier commented 10 months ago

This ticket seems to be an amalgamation of various problems, but very little information. The original bug report does not provide ANY information. I will hence close this issue an direct you to these potentially helpful instructions:

  1. The upstream-base-url must be configured to match exactly what you have configured as a default base URL in your iOS app. Otherwise messages will not arrive at all. See https://docs.ntfy.sh/config/#ios-instant-notifications
  2. If you have different results between 5G and WiFI, it's probably because the iOS app cannot reach your local ntfy server. It must be able to reach it instantly when a new message arrives.
  3. If you have intermittent delivery issues, you are likely being rate-limited by ntfy.sh. Please check your logs and enable debugging/tracing.
  4. Please read the known issues to see if anything applies to your situation.

In general, troubleshooting like this is best done via Discord/Matrix.

jingc1413 commented 5 months ago

I have the same problem. Reinstalling the app and restarting the phone don't work. I have to refresh the app manually. I can see new messages. eg: curl -d "hello" ntfy.sh/xxxxxxx

alexanderdoe commented 5 months ago

Unfortunately I have the same problem, I have checked everything several times. There is no notification and the messages are only loaded when you reload it in the app

aliefe04 commented 3 months ago

The problem still exists

zstreeter commented 3 months ago

Yeah, I have to refresh the app to see the notification. Seems like everything is setup correctly, since I can see the notification on refresh but not ideal

vudam991 commented 2 months ago

I don't know if this is a fix for it but I finally got it to worked. originally I have two spaces after removing the comma for the line

upstream-base-url: "https://ntfy.sh" after I remove those two spaces, and restart ntfy it worked and even faster than Android.

upstream-base-url: "https://ntfy.sh"

Screenshot 2024-07-31 at 12 17 50 AM

ste7enm commented 1 month ago

In case, like me, you find this on Google trying to troubleshoot your self-hosted Ntfy docker container and it not generating notifications in iOS, this part ended up doing the trick for me from @binwiederhier's linked known issues resource:

Self-hosted only: No upstream-base-url set, or base-url mismatch: To make self-hosted servers work with the iOS app, I had to do some horrible things (see iOS instant notifications for details). Be sure that in your selfhosted server:

  • Set upstream-base-url: "https://ntfy.sh" (not your own hostname!)
  • Ensure that the URL you set in base-url matches exactly what you set the Default Server in iOS to

My problem was the mismatch between what I set the base-url to in the docker compose versus what I was using in the iOS app to connect – for me, it worked when I made them identical. So, when I previously had the base-url field set to, say, https://192.168.0.1 and in the iOS app had it configured to http://192.168.0.1:1337, updating the base-url field to http://192.168.0.1:1337 in my docker container fixed the issue immediately and I began to receive notifications in iOS.

wunter8 commented 1 month ago

Glad you got it working! Yes, they need to match exactly. Here are the directions I share with people on Discord

These are the things you need to do to get iOS push notifications to work:

  1. open a browser to the web app of your ntfy instance and copy the URL (including "http://" or "https://", your domain or IP address, and any ports, and excluding any trailing slashes)
  2. put the URL you copied in the ntfy base-url config in server.yml or NTFY_BASE_URL in env variables
  3. put the URL you copied in the default server URL setting in the iOS ntfy app
  4. set upstream-base-url in server.yml or NTFY_UPSTREAM_BASE_URL in env variables to "https://ntfy.sh"