Notifications.addListener not firing

I am also having the same issue. I am currently still working in development, using Expo XDE. Notifications are working correctly on iOS device when the app is not open and foreground. When the app is open and foreground, the listener passed to Notifications.addListener() never fires, so I am unable to manually handle the notification per https://docs.expo.io/versions/latest/guides/push-notifications#3-handle-receiving-andor-selecting-the-notification.

  handleNotification = (notification) => {
    console.log('notification recieved!', notification);
    this.setState({ notification });
  }

  registerForPushNotificationsAsync = async () => {
    // code to register token

    this.notificationSubscription = Notifications.addListener(this.handleNotification);
  }

Searching the forums a bit, looks like this post is describing the same problem: Expo push notification handler not sending data - #2 by dikaiosune.
Any help would be appreciate.

1 Like