ERROR Error: Uncaught (in promise): PushNotifications does not have web implementation

ERROR Error: Uncaught (in promise): PushNotifications does not have web implementation.

How to catch this exception for web implementation, or to proceed with Push Notification for web.

If anyone can help me with it, it will be very helpful. :slight_smile:

Code that I have implemented:

    PushNotifications.addListener('registrationError', (error: any) => {
      console.log('Error on registration: ' + JSON.stringify(error));
    });

    PushNotifications.addListener(
      'pushNotificationReceived',
      (notification: PushNotification) => {
        console.log('Push received: ' + JSON.stringify(notification.data));
        this.openToast(notification.data);
      }
    );

    PushNotifications.addListener(
      'pushNotificationActionPerformed',
      (notification: PushNotificationActionPerformed) => {
        console.log(
          'Push action performed: ' +
            JSON.stringify(notification.notification.data)
        );
        this.navigate.navigateForward([
          'profile',
          notification.notification.data.identification,
        ]);
      }
    );

If anyone can please help on this. How can I approach for web implementation, or at least how to catch this exception. Please really help needed much!!

I have found the solution for this, which I thought to share so that it can help somebody.
you can try:

Capacitor.isPluginAvailable('PushNotifications')

and proceed with your code accordingly, someone helped me in stackoverflow with actual answer, and here is the link

1 Like