mirror of
https://github.com/binwiederhier/ntfy.git
synced 2026-05-09 16:35:53 +02:00
[GH-ISSUE #1203] iOS PWA problems #848
Labels
No labels
ai-generated
android-app
android-app
android-app
🪲 bug
build
build
dependencies
docs
enhancement
enhancement
🔥 HOT
in-progress 🏃
ios
prio:low
prio:low
pull-request
question
🔒 security
server
server
unified-push
web-app
website
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/ntfy#848
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @gw8484 on GitHub (Oct 22, 2024).
Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/1203
🐞 Describe the bug
When opening iOS PWA after getting push notification it often does not:
The iOS PWA should update immediately when opened after new push notification is received and it should reset the badge count on the iOS PWA home screen icon.
BTW, the same web app works as expected in a Chrome browser on a Linux desktop.
💻 Components impacted
iOS 17.6.1
ntfy v2.11.0 self hosted Docker instance on Ubuntu 22.04
💡 Screenshots and/or logs
Here is a snippet of the server log when the PWA opens but DOES NOT update where the subscription topic (/appm1) does not appear to be requested (Note, the public IP addresses have been changed):
2024/10/21 23:42:10 DEBUG HTTP request started (http_method=GET, http_path=/st_1DxBLrCgXJYXZ/ws?auth=QmVhcmVyIHRrX245NnE1OHk2anVieWx1MHFzdWZzaHlrcnoyNmR1, tag=http, user_id=u_11sCmqbbhZ, user_name=user1, visitor_auth_limiter_limit=0.016666666666666666, visitor_auth_limiter_tokens=30, visitor_id=ip:77.77.77.77, visitor_ip=77.77.77.77, visitor_messages=2, visitor_messages_limit=17280, visitor_messages_remaining=17278, visitor_request_limiter_limit=0.2, visitor_request_limiter_tokens=60, visitor_seen=2024-10-21T23:42:10.041Z)
2024/10/21 23:42:10 DEBUG Access to topic st_1DxBLrCgXJYXZ not authorized (error=unauthorized, http_method=GET, http_path=/st_1DxBLrCgXJYXZ/ws?auth=QmVhcmVyIHRrX245NnE1OHk2anVieWx1MHFzdWZzaHlrcnoyNmR1, tag=http, topic=st_1DxBLrCgXJYXZ, topic_last_access=2024-10-21T23:29:00.992Z, topic_subscribers=0, user_id=u_11sCmqbbhZ, user_name=user1, visitor_auth_limiter_limit=0.016666666666666666, visitor_auth_limiter_tokens=30, visitor_id=ip:77.77.77.77, visitor_ip=77.77.77.77, visitor_messages=2, visitor_messages_limit=17280, visitor_messages_remaining=17278, visitor_request_limiter_limit=0.2, visitor_request_limiter_tokens=59.0000454276, visitor_seen=2024-10-21T23:42:10.041Z)
2024/10/21 23:42:10 DEBUG WebSocket error (this error is okay, it happens a lot): forbidden (error=forbidden, error_code=40301, http_method=GET, http_path=/st_1DxBLrCgXJYXZ/ws?auth=QmVhcmVyIHRrX245NnE1OHk2anVieWx1MHFzdWZzaHlrcnoyNmR1, http_status=403, tag=websocket, topic=st_1DxBLrCgXJYXZ, topic_last_access=2024-10-21T23:29:00.992Z, topic_subscribers=0, user_id=u_11sCmqbbhZ, user_name=user1, visitor_auth_limiter_limit=0.016666666666666666, visitor_auth_limiter_tokens=30, visitor_id=ip:77.77.77.77, visitor_ip=77.77.77.77, visitor_messages=2, visitor_messages_limit=17280, visitor_messages_remaining=17278, visitor_request_limiter_limit=0.2, visitor_request_limiter_tokens=59.0000614642, visitor_seen=2024-10-21T23:42:10.041Z)
2024/10/21 23:42:10 DEBUG HTTP request finished (http_method=GET, http_path=/st_1DxBLrCgXJYXZ/ws?auth=QmVhcmVyIHRrX245NnE1OHk2anVieWx1MHFzdWZzaHlrcnoyNmR1, tag=http, time_taken_ms=0, user_id=u_11sCmqbbhZ, user_name=user1, visitor_auth_limiter_limit=0.016666666666666666, visitor_auth_limiter_tokens=30, visitor_id=ip:77.77.77.77, visitor_ip=77.77.77.77, visitor_messages=2, visitor_messages_limit=17280, visitor_messages_remaining=17278, visitor_request_limiter_limit=0.2, visitor_request_limiter_tokens=59.000066507, visitor_seen=2024-10-21T23:42:10.041Z)
Here is a snippet of the server log when the PWA open and DOES update everything where the subscription topic (/appm1) is requested:
2024/10/21 23:54:29 DEBUG HTTP stream connection opened (http_method=GET, http_path=/appm1/json?poll=1&since=nhWgHwucvDop, tag=subscribe, user_id=u_11sCmqbbhZ, user_name=user1, visitor_auth_limiter_limit=0.016666666666666666, visitor_auth_limiter_tokens=30, visitor_id=ip:77.77.77.77, visitor_ip=77.77.77.77, visitor_messages=2, visitor_messages_limit=17280, visitor_messages_remaining=17278, visitor_request_limiter_limit=0.2, visitor_request_limiter_tokens=56.3817183308, visitor_seen=2024-10-21T23:54:29.42Z)
2024/10/21 23:54:29 DEBUG Access to topic st_1DxBLrCgXJYXZ not authorized (error=unauthorized, http_method=GET, http_path=/st_1DxBLrCgXJYXZ/json?poll=1, tag=http, topic=st_1DxBLrCgXJYXZ, topic_last_access=2024-10-21T23:29:00.992Z, topic_subscribers=0, user_id=u_11sCmqbbhZ, user_name=user1, visitor_auth_limiter_limit=0.016666666666666666, visitor_auth_limiter_tokens=30, visitor_id=ip:77.77.77.77, visitor_ip=77.77.77.77, visitor_messages=2, visitor_messages_limit=17280, visitor_messages_remaining=17278, visitor_request_limiter_limit=0.2, visitor_request_limiter_tokens=56.3817238494, visitor_seen=2024-10-21T23:54:29.42Z)
2024/10/21 23:54:29 DEBUG Connection closed with HTTP 403 (ntfy error 40301) (error=forbidden, error_code=40301, http_method=GET, http_path=/st_1DxBLrCgXJYXZ/json?poll=1, http_status=403, tag=http, topic=st_1DxBLrCgXJYXZ, topic_last_access=2024-10-21T23:29:00.992Z, topic_subscribers=0, user_id=u_11sCmqbbhZ, user_name=user1, visitor_auth_limiter_limit=0.016666666666666666, visitor_auth_limiter_tokens=30, visitor_id=ip:77.77.77.77, visitor_ip=77.77.77.77, visitor_messages=2, visitor_messages_limit=17280, visitor_messages_remaining=17278, visitor_request_limiter_limit=0.2, visitor_request_limiter_tokens=56.381962958799996, visitor_seen=2024-10-21T23:54:29.42Z)
2024/10/21 23:54:29 DEBUG HTTP request finished (http_method=GET, http_path=/st_1DxBLrCgXJYXZ/json?poll=1, tag=http, time_taken_ms=2, user_id=u_11sCmqbbhZ, user_name=user1, visitor_auth_limiter_limit=0.016666666666666666, visitor_auth_limiter_tokens=30, visitor_id=ip:77.77.77.77, visitor_ip=77.77.77.77, visitor_messages=2, visitor_messages_limit=17280, visitor_messages_remaining=17278, visitor_request_limiter_limit=0.2, visitor_request_limiter_tokens=56.3819924882, visitor_seen=2024-10-21T23:54:29.42Z)
2024/10/21 23:54:29 DEBUG HTTP stream connection closed (http_method=GET, http_path=/appm1/json?poll=1&since=nhWgHwucvDop, tag=subscribe, user_id=u_11sCmqbbhZ, user_name=user1, visitor_auth_limiter_limit=0.016666666666666666, visitor_auth_limiter_tokens=30, visitor_id=ip:77.77.77.77, visitor_ip=77.77.77.77, visitor_messages=2, visitor_messages_limit=17280, visitor_messages_remaining=17278, visitor_request_limiter_limit=0.2, visitor_request_limiter_tokens=56.3820618692, visitor_seen=2024-10-21T23:54:29.42Z)
🔮 Additional context
It seems the PWA is not always aware of the new push notifications so not requesting update for the relevant topics.
How does the PWA determine when to request updates for each subscribed topic?
Is there a way for users to force a full reload in the PWA launched from the home screen?
FYI, it does appear that sometimes after a while (>5 minutes) the PWA would eventually request update for the subscribed topic and display the new notification messages.
@gw8484 commented on GitHub (Oct 23, 2024):
After some additional testing, it seems that notification also stops working after a while.
Not sure if this has been reported for ntfy but it appears there are some known issues with PWA on iOS (https://github.com/firebase/firebase-js-sdk/issues/8010). The main issue is seemingly random reset of web push registrations. So, I am guessing it could be causing weird problems in ntfy including the ones reported earlier.
Unfortunately, it looks like PWA is not quite ready for prime time on iOS. It's really too bad. I was hoping PWA could be a viable alternative to the native app on iOS. The great work on ntfy is much appreciated in any case.
@wunter8 commented on GitHub (Oct 23, 2024):
Thanks for looking into it some more. I haven't heard of others having issues with the PWA on iOS, but we'll keep this in mind
@michaellammers commented on GitHub (Jan 27, 2026):
Here the badge icon also doesn’t appear on my iPhone 12 with iOS 26.2 and ntfy 1.3.
Would be great to have that functionality in case I missed the push message itself.