Getting error when sending push notifications

When i send push notification with expo, the target device receive the notification without problem but a red screen appear and display the following error :

undefined is not an object (evaluating 'subscription.listener.apply')

yet, when i press dismiss the notification message is received.

i don’t know what is causing this error.

I set notification handling according to expo docs :

componentDidMount(){
      this._notificationSubscription = Notifications.addListener(this._handleNotification);
    }


_handleNotification = (notification) => {
     // handle notification payload
 }; 

componentWillUnmount(){
      this._notificationSubscription && this._notificationSubscription.remove()

    }

Will this red screen be displayed when my app will go in production ?

Any suggestion to fix it ?

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.