home-assistant / iOS

:iphone: Home Assistant for Apple platforms
https://companion.home-assistant.io
Other
1.59k stars 311 forks source link

IOS Notification not working with iOS 15 #1917

Open reesion opened 2 years ago

reesion commented 2 years ago

iOS device model, version and app version

Model Name: iPhone XS Software Version: 15.1 App version: 2021.11.1 (2021.266)

Home Assistant Core Version core-2021.11.3

Describe the bug iOS push notification stopped working To Reproduce Tried sending notification via Services using notify. but did not receive any notification

Expected behavior iPhone to receive notification when triggered.

reesion commented 2 years ago

Further testing indicates that it only works on local connection when local push is enabled and SSID is specified.

achurak commented 2 years ago

Having the same issue. Notifications stopped working for the most part with some rare occasional exceptions. Here's the error I'm getting on the server:

Error sending notification to https://mobile-apps.home-assistant.io/api/sendPushNotification: ContentTypeError(RequestInfo(url=URL('https://mobile-apps.home-assistant.io/api/sendPushNotification'), method='POST', headers=<CIMultiDictProxy('Host': 'mobile-apps.home-assistant.io', 'User-Agent': 'HomeAssistant/2021.11.5 aiohttp/3.7.4.post0 Python/3.9', 'Accept': '*/*', 'Accept-Encoding': 'gzip, deflate', 'Content-Length': '444', 'Content-Type': 'application/json')>, real_url=URL('https://mobile-apps.home-assistant.io/api/sendPushNotification')), (), message='Attempt to decode JSON with unexpected mimetype: text/html; charset=utf-8', headers=<CIMultiDictProxy('Connection': 'keep-alive', 'Content-Length': '1624', 'Content-Type': 'text/html; charset=UTF-8', 'Referrer-Policy': 'no-referrer', 'X-Fh-No-Setcookie-Unroll': 'true', 'Accept-Ranges': 'bytes', 'Date': 'Wed, 01 Dec 2021 21:56:23 GMT', 'X-Served-By': 'cache-pwk4921-PWK', 'X-Cache': 'MISS', 'X-Cache-Hits': '0', 'X-Timer': 'S1638395784.650252,VS0,VE31', 'Vary': 'x-fh-requested-host, accept-encoding')>)

Just tried enabling local push in the app and was able to receive a test notification.

zacwest commented 2 years ago

If you navigate to https://mobile-apps.home-assistant.io/api/sendPushNotification in your browser, do you see an error message like {"errorMessage":"You did not send a token!"}? Is it possible you've at a DNS level blocked access to Firebase or something like that?

achurak commented 2 years ago

If you navigate to https://mobile-apps.home-assistant.io/api/sendPushNotification in your browser, do you see an error message like {"errorMessage":"You did not send a token!"}? Is it possible you've at a DNS level blocked access to Firebase or something like that?

It is exactly what I see: {"errorMessage":"You did not send a token!"}. What does it mean?

zacwest commented 2 years ago

That's what's expected, but the error log you're seeing is a non-JSON response of some sort, which makes me wonder what it's connecting to. It's possible it's a Firebase error page, but I don't know exactly what could be going wrong there. Can you share what notify call you are issuing?

achurak commented 2 years ago

That's what's expected, but the error log you're seeing is a non-JSON response of some sort, which makes me wonder what it's connecting to. It's possible it's a Firebase error page, but I don't know exactly what could be going wrong there. Can you share what notify call you are issuing?

So I've tried to curl the same link from the hass container and received 403 Forbidden:

<p><b>403.</b> <ins>That’s an error.</ins>
  <p>Your client does not have permission to get URL <code>/sendPushNotification/api/sendPushNotification</code> from this server.  <ins>That’s all we know.</ins>

Doesn't look like it's the app's problem. Wondering if it has something to do with my containers going out through VPN tunnels?

achurak commented 2 years ago

Alright, I've just excluded hass container's IP from the VPN redirection for HTTPS traffic and was able to receive the same "token" message, so in my case it looks like Firebase blocked my VPN provider's IP addresses. Thanks for your help!

thomasdg commented 2 years ago

I don't want to hijack this thread, but for me it is only a problem when I try to add an attachment to the notifications; not sure if both are related. Camera images or stills added and nothing gets through. The configuration itself didn't change; it used to work in the past. When I remove the attachment, I get the notification without problems. Nothing in the logs that help me - it just mentions a notification sent.

Ehlz77 commented 2 years ago

same issue here. Notifications stopped working as supposed. Iphone XS and Nabu Casa subscriber.

henning-meinhardt commented 2 years ago

same problem here when trying to clear a notification as described in https://companion.home-assistant.io/docs/notifications/notifications-basic#clearing

meme1337 commented 2 years ago

Notifications not working here as well.

iOS 15.4.

They seems to work on local push (can’t test that now because I’m outside the country), but otherwise the counter get decreased, and nothing appears.

bgoncal commented 7 months ago

Is this still an issue with latest versions of app and core? Feel free to reopen if needed