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

Android: onNotification method wont fire when received remote notificatio #490

Closed
avdept opened this issue Jul 25, 2017 · 4 comments
Closed
Labels

Comments

@avdept
Copy link

avdept commented Jul 25, 2017

This is related to #373
When android receives remote notification, onNotification method wont fire until you explicitly click on notification. Any ideas how to get it fire, once notification was received ?

@rcarvalho
Copy link

So, on iOS, that's how it is supposed to work. You don't receive the notification until you actually click the notification itself. I think the thing you may be looking for is called a data notification where you pass in data and not alert into the notification you send from your server. I believe alert triggers a visual alert and the data is a silent alert. I could be wrong, but that is my understanding.

Are you actually receiving the notification on Android when you click the notification? I am not. I can only get it to work on iOS.

@fredbt
Copy link

fredbt commented Aug 1, 2017

My scenario is the following (testing only on Android for now):

  • the server pushes a notification through GCM.

  • if the app is in the foreground, it receives the notification, and onNotification is called twice:
    --- when the notification arrives
    --- upon click
    Means: all good here!

  • However, if the app is in the background, onNotification is not called. And it's not called even when I click the notification!

Is this expected to happen?

@omarcarreon
Copy link

Hi, I had the same problem. Check and try using my fix #495 (comment)

@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

4 participants