Member-only story
ReferenceError: Can’t find variable Notification and how to solve it
I’ve been working with Firebase Cloud Messaging for the last couple of months and it has been a pure pleasure! I always enjoy using Firebase, since I find it so user-friendly combined with great documentation.
But something went completely wrong.
Since I’ve been during all the development on my MacBook and even made the messaging look great on phone using inspect mode, it was ready for launching.
After it went out on the staging URL, I tested it on an android tablet. It looked just the way it should.
But then I took my iPhone… And got a blank page.
Why? What? But how? What is happening?
First in Safari, then I opened with Chrome - still blank.
Since this was running just fine in inspect mode on the laptop, I was really curious about what went wrong. So I connected with USB and opened Safari console from iPhone. And saw this error message.
ReferenceError: Can't find variable: Notification
Of course, I went straight to Google. How could this be, when it works on every other device I’ve tested on.
It didn’t take long before I found this documentation, telling me that iOS Safari is not supported using…