[expo-notifications] notification.request.content.data is null in push notifications setup
Problem
Minimal reproducible example https://github.com/brandon-kyle-bailey/expo-notifications-bug What platform(s) does this occur on? Android, iOS, Web Did you reproduce this issue in a development build? Yes Summary Following documentation to set up push notifications and utilizing https://expo.dev/notifications to send push notifications with a data object in the message, the data object is null. Environment expo-env-info 1.2.0 environment info: System: OS: macOS 14.2.1 Shell: 5.9 - /bin/zsh Binaries: Node: 18.13.0 - ~/.nvm/versions/node/v18.13.0/bin/node Yarn: 1.22.19 - ~/.nvm/versions/node/v18.13.0/bin/yarn npm: 9.2.0 - ~/.nvm/versions/node/v18.13.0/bin/npm IDEs: Xcode: /undefined - /usr/bin/xcodebuild npmPackages: expo: ~50.0.11 => 50.0.11 react: 18.2.0 => 18.2.0 react-native: 0.73.4 => 0.73.4 npmGlobalPackages: eas-cli: 7.1.2 Expo Workflow: managed Expo Doctor Diagnostics โ Check Expo config for common issues โ Check package.json for common issues โ Check native tooling versions โ Check dependencies for packages that should not be installed directly โ Check for common project setup issues โ Check npm/ yarn versions โ Check for issues with metro config โ Check Expo config (app.json/ app.config.js) schema โ Check for legacy global CLI installed locally โ Check that packages match versions required by installed Expo SDK โ Check that native modules do not use incompatible support p
Unverified for your environment
Select your OS to check compatibility.
1 Fix
Solution: [expo-notifications] notification.request.content.data is null in push notifications setup
@brandon-kyle-bailey I also am facing this issue. In fact I have noticed a few oddities around notifications recently: 1. The actual JSON data determines if notification is even received or not. - `{"foo": "bar"}` _notification is received_ - `{"foo": "bar", "myObj": {"testKey": "testVal"}}` _notification is NOT received_ - `{"foo": 123}` _notification is NOT received_ 2. Notifications that ar
Trust Score
3 verifications
- 1
@brandon-kyle-bailey I also am facing this issue. In fact I have noticed a few o
@brandon-kyle-bailey I also am facing this issue. In fact I have noticed a few oddities around notifications recently:
- 2
The actual JSON data determines if notification is even received or not.
1. The actual JSON data determines if notification is even received or not.
- 3
`{"foo": "bar"}` _notification is received_
- `{"foo": "bar", "myObj": {"testKey": "testVal"}}` _notification is NOT received_ - `{"foo": 123}` _notification is NOT received_
- 4
Notifications that are "received" still have prop data set to `null` - but I did
2. Notifications that are "received" still have prop data set to `null` - but I did notice that the JSON data can be found inside of `notification.request.trigger.remoteMessage.data`. It appears to be flattened amongst other key-values though and is not ideal.
Validation
Resolved in expo/expo GitHub issue #27503. Community reactions: 2 upvotes.
Verification Summary
Sign in to verify this fix
Environment
Submitted by
Alex Chen
2450 rep