No action run when click on notification

Hello, I’m trying implement this demo my self https://github.com/sameesiddiqui/expo-notifications-example
I clone it and run, everything works fine. But when i create new project, add handle function like this
27400202_1875541372478326_1258521365_n
When new noti receive, handle _handleNotification() function called, but when i click on notification, there is no action called. I dont know if i missing something. Please help, Thank you so much!

Please help huhu :((((((((((((

Hey @huylv177, I’m sorry you’re having this problem.

I’ve pulled up the notifications documentation located here: https://docs.expo.io/versions/latest/guides/push-notifications.html

  componentWillMount() {
    registerForPushNotificationsAsync();

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

  _handleNotification = (notification) => {
    this.setState({notification: notification});
  };

In your example screenshot, I don’t see registerForPushNotificationsAsync() so maybe you need to include it? Let me know if that doesn’t work for you.

The content in the function you mentioned is request permission FOR IOS, and the platform im working is Android =.=
Anyway, i added that function to my componentWillMount and still same problem. Im going to out of idea

OMG i found the reason @jimmylee, just add the “data”:“whatever” to post body, and then we can handle action user click on notification. This should be a bug you must note :stuck_out_tongue:

2 Likes

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