runha
runha

Reputation: 113

Expo.Notifications.addListener() is not firing (iOS standalone App)

I am trying to use Expo.Notifictions.addListener in my component (on iOS standalone build), but it doesn't fire although notifications are successfully received.

addListener() is placed inside componentDidMount() function.

Expo.Notifications.addListener(this.handleNotification);

handleNotification = () => {
  this.setState({
    something: 3,
  });
};

Upvotes: 2

Views: 3839

Answers (1)

Benson Toh
Benson Toh

Reputation: 2128

You are not adding callback into ur addListener function.

componentDidMount(){
    Notifications.addListener(notification => {
      console.log(notification);  
    });
}

Upvotes: 2

Related Questions