Skip to main content

Web Push - Troubleshooting

In this page you'll learn what are the most common mistakes when implementing the Notificare library for the Web.

Enabling debug logging

There are times when the default logging level is not sufficient to diagnose problems. You can enable debug logging by setting a more granular log level.

import { setLogLevel } from 'notificare-web/core';

setLogLevel('debug');

Managing application state

Important application data, such as current device information and push state, is stored in local storage. It's essential to avoid manually removing these properties, as doing so can have unintended side effects, essentially resetting your application to a partially fresh state. Instead, we recommended using the appropriate functions that align with your specific use-case, such as disableRemoteNotifications() or unlaunch().

Misplaced App Keys

When implementing Notificare, the library configuration file (which is the file deposited on your TransferBox) must contain the applicationKey and the applicationSecret properties. In Web Push or Safari Push there is no separation between development and production environment. Please read more about the configuration file here.

Website Push in Safari

A common error when sending push notifications for Safari is by uploading an icon with alpha channels (transparency) which will silently be accepted but will eventually generate errors rendering impossible to deliver messages. Make sure you always upload an icon with no transparency. Once you've accepted notifications in Safari and you decide to change that icon you'll need to unsubscribe to notifications and subscribe again to see that new uploaded icon. Please bear this in mind when changing the icon in production web apps.