I think I must have been having a brain fart - data is in notification.request.content.data as documented!
So a notification received while the app is foregrounded now works fine
I’m now attempting to use Notifications.addNotificationResponseReceivedListener() in order to also handle the scenario where a user clicks a notification when the (Android) app is not running.
What happens is that the app is launched but the listener is not called. Is this likely to be down to the scenario described in Receiving Notifications - Expo Documentation and is there anything I can do to minimise the effect? I’m using Notifications.setNotificationChannelAsync() to set importance to Notifications.AndroidImportance.MAX in my App.js and testing with battery saver off.
In particular do the limitations referred to in Receiving Notifications - Expo Documentation refer to the delivery of the notification to the phone or to the app when a notification is clicked on? I’m getting the notification delivered to the phone but though clicking on it will open the app when closed it doesn’t go through my NotificationResponseReceivedListener().
OK, I assume this is either impossible or at least difficult so I’ve re-implemented my app so that it gets notification data directly from the backend in addition to the push notification messages. This seems to be the only way I can cope with notifications arriving whilst the app is not running.