Skip to content
This repository was archived by the owner on Jan 14, 2025. It is now read-only.

onNotification handler not being fired #740

Closed
ndcorc opened this issue May 15, 2018 · 9 comments
Closed

onNotification handler not being fired #740

ndcorc opened this issue May 15, 2018 · 9 comments
Labels

Comments

@ndcorc
Copy link

ndcorc commented May 15, 2018

I have remote push notifications setup correctly using a 3rd party service + APNS and my iOS device is both calling the onRegister callback correctly and receiving subsequent notification alerts but the onNotification handler is not being called at all. This is a problem because it prevents me from PushNotification.setApplicationIconBadgeNumber() in an appropriate manner. I'm pretty sure that the handler is not being called at all because, in Xcode, I am not even receiving the provided log output of onNotification in the example PushNotification.configure code (console.log( 'NOTIFICATION:', notification );). I am, however, receiving the log output of onRegister (console.log( 'TOKEN VALUE: ' + token );

@vanhungoz
Copy link

@ndc466 , did you resolve it? i also got the same issues. i have tried some way but it didn't work.

@ndcorc
Copy link
Author

ndcorc commented May 25, 2018

@vanhungoz No, this is still an open issue/possible bug.

@vanhungoz
Copy link

@ndc466 i realize that it doesn't happen with equal and greater ios 10.3

@HoogsterInc
Copy link

I have this problem on Android when the app is closed or in the background. onNotification is not called

@MarkRamsden
Copy link

@ndc466 , did you resolve it? i also got the same issues. i have tried some way but it didn't work.

did you ever get to the bottom of this ? Having same issue with ios11 kind of halted my development now

@mrtomhoward
Copy link

mrtomhoward commented Oct 21, 2018

@HoogsterInc I spent several hours dealing with this issue on Android the other day, and the thing that got it working was to ensure the message payload object had only a data key and nothing else.

All the time I was having troubles, my message payload object had other keys (eg "notification") in addition to data. When that was the case, the message looked different in the Android notifications drawer (large icon was missing), and it didn't trigger onNotification when I tapped it.

When I removed all keys other than data, the message looked the same in the notifications drawer as it did when the app was in the foreground, and it triggered onNotification when I tapped it.

I also had to take care to ensure Firebase was installed correctly, but simply following the instructions in the readme was enough to get that right.

@experionarjun
Copy link
Contributor

@HoogsterInc I spent several hours dealing with this issue on Android the other day, and the thing that got it working was to ensure the message payload object had only a data key and nothing else.

All the time I was having troubles, my message payload object had other keys (eg "notification") in addition to data. When that was the case, the message looked different in the Android notifications drawer (large icon was missing), and it didn't trigger onNotification when I tapped it.

When I removed all keys other than data, the message looked the same in the notifications drawer as it did when the app was in the foreground, and it triggered onNotification when I tapped it.

I also had to take care to ensure Firebase was installed correctly, but simply following the instructions in the readme was enough to get that right.

Could you paste a sample of your payload?

@VicEsquivel
Copy link

@ndc466 is this still an issue? Or did you find a way to solve this?

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 30 days if no further activity occurs. Thank you for your contributions.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

7 participants