App crashing in Expo Go when receiving notification in foreground

  1. SDK Version: 48
  2. Platforms(Android/iOS/web/all): only tested in iOS

I’m receiving notifications correctly when the app is closed, but when it is in the foreground (or I click on a notification when it arrives while app is closed) the Expo Go app crashes with this message:

There was a problem loading the requested app.
Could not connect to the server.
exp://100.00.0.00:19001

As far as I understand, this block of code will handle the upcoming notifications when the app is in foreground:

Notifications.setNotificationHandler({
handleNotification: async () => ({
shouldShowAlert: true,
shouldPlaySound: false,
shouldSetBadge: false,
}),
});

However, as much as I try to modify it I can’t see any change and if I have the app open and a notification arrives, it will just crash with the previous message. Else, the notifications are arriving correctly (and following the logic being saved in the database etc.). What could possibly be the problem for this crash when app is in foreground? Anyone encountered anything similar before?

Point out that this also is happening when my app is open in Expo Go and I send a notification from the terminal curl to my device. It will immediately crash saying there was a problem loading the app.

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