Receiving Remote Notifications

I’ve been trying to implement expo-notifications in my application, I’m sending the notifications from my backend using the expo-server-sdk-node.

I’m receiving the notification on my phone, but when I try to get the data out of it using either Notifications.addNotificationResponseReceivedListener or Notifications.addNotificationResponseReceivedListener nothing happens, none of them trigger no matter the case (foreground, background or when interacting with the notification itself.

But if I’m doing scheduled notifications using Notifications.scheduleNotificationAsync from within the app, then the listeners work fine.

how to make the listeners work for remote notifications as well.

SDK Version: 39.0.0
Platforms (Android/iOS)

Hey @tommalieh,

Can you share a Snack that shows how you are handling this so that I can test it on our end? Hard to know what could be going on here without seeing code.

Cheers,
Adam

Hello @adamjnav,

Thanks for your initiative of trying to help, i was able to fix the issue yesterday.

The fix was to add the useNextNotificationsApi in my app.json file.

On a note though, it should be mentioned in the push notifications guide as I was following it, but I had to dig in another section to find useNextNotificationsApi was required.

I want to add to others that may get here, the new API changed the data format returned by Notifications.getExpoPushTokenAsync, also the notification object itself changed as well.

I spent a lot of time trying to figure why notifications weren’t arriving before a saw the token was wrong in the backend.

1 Like

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