Menu

1 / 2

Our push notifications arrived silent, empty, and wrong about the time. Three bugs, one night.

DEV Community: firebase·Matthew Douglas·8 days ago
#w30Xaq5N
#devtofirebase#devto#dev#weather#notification
Long article (826 words) — no AI summary yet.
Reading 0:00
15s threshold

We shipped push notifications for StarBrook News — our free, no-paywall news app — in Build #24 of the new native Android app. The server side was already live: a subscribe endpoint, a weather-alerts sender, a token table. The first real test was a freeze warning for Oklahoma City, fired at 2:55 in the morning. The send reported success. The phone stayed silent.

Here is what was actually wrong. Three separate bugs, found one at a time, because each fix revealed the next one.

Bug 1: the permission prompt never fired

The app only asks for notification permission when you turn a toggle on. The toggles were already on — carried over from the previous build — so the prompt never appeared, and the phone had no permission to show anything. The send still reported alerts_sent: 1, errors: [], because from the server's side everything worked. The failure was invisible to every log we had.

The fix was a phone tap, not code: flip Weather alerts off and back on, which fires the prompt, tap Allow.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.