question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

expo-notifications data app closed empty after eject

See original GitHub issue

Summary

SDK Version: 41 Platforms ios/android Package “expo-notifications”: “~0.11.6”,

Hi,

Just ejected using SDK 41 and noticed that the startup push notification data params in App.tsx props is empty.

(when you receive a push notificaiton when app i closed and you have sent params).

props.exp.notification.data

Does the prop name change after eject? Expo cli eject bug?

Managed or bare workflow? If you have ios/ or android/ directories in your project, the answer is bare!

bare

What platform(s) does this occur on?

Android, iOS

SDK Version (managed workflow only)

41

Environment

Expo CLI 4.3.4 environment info: System: OS: Windows 10 10.0.18363 Binaries: Node: 14.16.1 - C:\Program Files\nodejs\node.EXE Yarn: 1.21.1 - C:\Program Files (x86)\Yarn\bin\yarn.CMD npm: 6.14.8 - C:\Program Files\nodejs\npm.CMD IDEs: Android Studio: Version 4.0.0.0 AI-193.6911.18.40.6626763 npmPackages: expo: ^41.0.0 => 41.0.1 react: 16.13.1 => 16.13.1 react-dom: 16.13.1 => 16.13.1 react-native: ~0.63.4 => 0.63.2 react-native-web: ~0.13.12 => 0.13.18 Expo Workflow: bare

Reproducible demo or steps to reproduce from a blank project

type AppProps = {
  exp?: {
    notification?: {
      data?: PushNotificationData
    }
  }
}

export default function App({ exp }: AppProps) {
return <AppLoading />
}

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
cruzachcommented, Jun 7, 2021

Yes, and you should upgrade to the most recent version of expo-notifications since there have been many fixes addressing getting the notification data when the app was killed

0reactions
reftcommented, Jun 7, 2021

Ahh interesting great thanks!

I’m currently using only addNotificationResponseReceivedListener for the response event… Should I replace addNotificationResponseReceivedListener with useLastNotificationResponse? I would like a response in foreground, background and killed, (all states).

Thanks again

Read more comments on GitHub >

github_iconTop Results From Across the Web

Notifications - Expo Documentation
Handle notifications when the app is in foreground,; Imperatively dismiss notifications from Notification Center/tray,; Create, update, delete Android ...
Read more >
Expo-notifications notification event don't work if app is not ...
This method sends me a notification mail when app is running but if the apps is not running, I can't capture this event...
Read more >
React Native Push Notifications - DEV Community ‍ ‍
In this tutorial, you will learn: How to display a local notification when the app is both in background and foreground.
Read more >
First-class push notifications for Expo apps | by Carles Capellas
So the time has come for your brilliant Expo app to start ... When it comes to push notifications the receiver's ID is...
Read more >
Expo.Notifications.addListener() is not firing (iOS standalone ...
Coding example for the question Expo.Notifications. ... How to handle data type fcm notifications when app is not running or closed state in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found