"popInitialNotification" always return "undefined"
See original GitHub issueBug
popInitialNotification method always return ‘undefined’ for local notification. I have tried in both scenarios while the app in background and while the app is closed . Tried both localNotificationSchedule, localNotification methods.
Environment info
react-native info
output:
System:
OS: macOS 11.2
CPU: (8) x64 Apple M1
Memory: 86.55 MB / 8.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 14.16.1 - /usr/local/bin/node
Yarn: 1.22.10 - /usr/local/bin/yarn
npm: 6.14.12 - /usr/local/bin/npm
Watchman: 4.9.0 - /opt/homebrew/bin/watchman
Managers:
CocoaPods: 1.10.1 - /usr/local/bin/pod
SDKs:
iOS SDK: Not Found
Android SDK: Not Found
IDEs:
Android Studio: Not Found
Xcode: /undefined - /usr/bin/xcodebuild
Languages:
Java: Not Found
Python: 2.7.16 - /usr/bin/python
npmPackages:
@react-native-community/cli: Not Found
react: 16.11.0 => 16.11.0
react-native: 0.62 => 0.62.3
react-native-macos: Not Found
npmGlobalPackages:
*react-native*: Not Found
Library version: x.x.x
Steps To Reproduce
- Initiate a local notification
- Local notification received while app is close
- Tap on the local notification received
- PushNotification.popInitialNotification event triggered but returned with ‘undefined’. …
Describe what you expected to happen:
1.PushNotification.popInitialNotification event should return with local notification details which user clicked. 2.
Reproducible sample code
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:6
Top Results From Across the Web
Push Notification In React Native - Stack Overflow
Now it is working fine in android but in ios this is always false. ... popInitialNotification: true, requestPermissions: true, }) return ...
Read more >PushNotificationIOS · React Native
Apps unregistered through this method can always re-register. ... static popInitialNotification() ... Subsequent invocations will return null.
Read more >Step by Step guide for Implementing Push Notifications in iOS ...
If you are looking out for implementing a push notification on IOS using Google firebase messaging, you landed in the right place. Prerequisite:....
Read more >data that is returned from useQuery is undefined? : r/reactnative
My backend server got a request from client and returned data. But data in client is empty. What am I missing here? Please...
Read more >Receiving push notification from Firebase in React Native
popInitialNotification : true, requestPermissions: true }) }, []) return null } ... Always motivate to find new things in react native.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@Dallas62 I’ve searched through lot of history and still struggling to handle, on iOS, notifications from a killed state.
I’ve seen a couple random things saying to disabled remote debugging and to build the product in release mode, strange that those would interfere with notifications but I did that.
Given my understanding of
popInitialNotification
, I thought things would just work out of the box. That is,onNotification
would be called from a killed state. That isn’t happening.So, I see
popInitialNotification
to false and added my own handler inside the top-most component with auseEffect(() => { PN.popInitialNotification(handler) }, []
. That also doesn’t work.I’ve tried some other things and started messing around with PNIOS.getInitialNotification with no luck. I don’t want to use an iOS only handler anyway though.
From the history of this problem, where would you advise that I look to get notification handling from killed state working on iOS/Android?
It’s working only from killed state, but yes for all kind of notifications