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.

onNotification isn't gets called on receiving local notification.

See original GitHub issue

onNotification is not even gets called on the example app on receiving notification.

While triggering instant local notification or scheduled notification, onNotification isn’t gets called on receiving. It gets called after user perform an action on the received push notification. At the readme, it is stated that onNotification gets invoked as soon as a notification is received and when user performs an action. I have tested it for Android. But it is not happening. I checked both on emulator as well as real device.

Environment info

react-native info output: System: OS: macOS 10.15.3 CPU: (8) x64 Intel® Core™ i7-4770HQ CPU @ 2.20GHz Memory: 797.71 MB / 16.00 GB Shell: 3.2.57 - /bin/bash Binaries: Node: 12.13.1 - ~/.nvm/versions/node/v12.13.1/bin/node Yarn: 1.22.0 - /usr/local/bin/yarn npm: 6.12.1 - ~/.nvm/versions/node/v12.13.1/bin/npm Watchman: 4.9.0 - /usr/local/bin/watchman Managers: CocoaPods: 1.8.4 - /usr/local/bin/pod SDKs: iOS SDK: Platforms: iOS 13.2, DriverKit 19.0, macOS 10.15, tvOS 13.2, watchOS 6.1 Android SDK: API Levels: 23, 28, 29 Build Tools: 28.0.3, 29.0.2 System Images: android-28 | Intel x86 Atom_64, android-28 | Google APIs Intel x86 Atom_64, android-29 | Google APIs Intel x86 Atom Android NDK: Not Found IDEs: Android Studio: 3.5 AI-191.8026.42.35.5900203 Xcode: 11.3.1/11C505 - /usr/bin/xcodebuild Languages: Java: 1.8.0_222 - /usr/bin/javac 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.2 => 0.62.2 npmGlobalPackages: react-native: Not Found

Library version: 3.3.1

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:21

github_iconTop GitHub Comments

3reactions
UxmanKaxmicommented, Aug 23, 2020

This would be a great addition! I’m using scheduled local notifications and would love to be able to have my foreground-state app be aware of when a notification was delivered. Unless there is some other way to listen for this event?

I still haven’t found a way and I still have a use case for this exact purpose. I think we need this functionality.

1reaction
infinitelinecommented, Aug 7, 2020

This would be a great addition! I’m using scheduled local notifications and would love to be able to have my foreground-state app be aware of when a notification was delivered. Unless there is some other way to listen for this event?

Read more comments on GitHub >

github_iconTop Results From Across the Web

firebase - Reactnative IOS pushotification/PushNotificationIOS ...
I used reactnative PushNotification/PushNotificationIOS modules , My issue is when notification received on foreground to my device IOS ,the ...
Read more >
How to use the react-native-push-notification.configure ... - Snyk
log( 'TOKEN:', token ) }, // (required) Called when a remote or local notification is opened or received onNotification: (notification) => { console.log(...
Read more >
Local notification delivered in background - Apple Developer
In macOS, apps do not require local notifications to badge their icon, ... will make your app's notifications something people look forward to...
Read more >
react-native-push-notification - npm
Handling Notifications. When any notification is opened or received the callback onNotification is called passing an object with the ...
Read more >
Notifications Not Shown - Mobile Push
Common reasons why Mobile Push notifications are not showing on your device. ... limit all background activity (push notifications) from being received.
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