Successfully built push notification system but they’re treated as spam

Overcoming Challenges with Push Notifications in a Next.js Web App

Creating an effective and user-friendly push notification system in your web application can significantly enhance user engagement. However, developers often encounter obstacles such as notifications being flagged as spam or not displaying as intended. Here’s a professional overview of a recent experience building a push notification infrastructure within a Next.js-based social media platform, along with solutions and tips.

Implementing Push Notifications Without WebSockets in Next.js

Since Next.js primarily supports server-side rendering and static site generation, integrating WebSockets directly can be tricky. In this setup, the developer opted for the Ably Push Notification service, a robust real-time messaging platform that simplifies push notifications across web and mobile devices.

Progress and Challenges

After successfully integrating and testing the push notification system, the majority of functionalities performed as expected. Users received notifications, and basic alerting was in place. However, an issue persisted: notifications were being flagged as spam or low-priority, and in some cases, failed to display correctly.

Understanding the Spam Flagging Issue

Despite configuring various notification parametersโ€”such as icon, badge, time-to-live (TTL), tag, collapse key, renotify, and silent optionsโ€”the notifications still appeared as spam. This often relates to how browsers and operating systems interpret and filter push notifications based on factors like frequency, content, and metadata.

Goals for Effective Notifications

The primary objectives for the notification system were:

  • Device Wake-up: Notifications should wake the device or alert the user effectively.
  • Visibility: Notifications must appear prominently in the notification bar.
  • Branding: The app’s logo should be displayed instead of the default browser icon.
  • Message Threading: Notifications with the same tag or collapse key should be grouped, preventing clutter and redundancy.
  • Interactive Actions: Ability to include actionable buttons such as “Like” or “Reply” within notifications.

Best Practices and Recommendations

  1. Proper Icon Usage: Ensure your notification icon is properly sized (usually 192×192 pixels) and hosted over HTTPS to avoid filtering as spam.

  2. Define a Clear Tag and Collapse Key: Use unique but consistent tags or collapse keys to group related notifications. This prevents multiple notifications from cluttering the notification tray.

  3. Use Appropriate Priority Settings: Set the notification importance to high in the service worker to wake the device and alert the user effectively.

  4. Branding Your Notifications: Use your app’s logo as the


Leave a Reply

Your email address will not be published. Required fields are marked *