Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

onPushNotificationReceived not getting called when Android App is in Background/Terminated State #247

Open
himu243 opened this issue Dec 30, 2021 · 1 comment

Comments

@himu243
Copy link

himu243 commented Dec 30, 2021

Describe the bug

When Android App is in Foreground State, onPushNotificationReceived listener is getting invoked having the notification data. When in Background or Terminated State, Notification does get received but onPushNotificationReceived listener is not getting invoked neither automatically nor when I tap on the notification. I'm sending the push from Azure Portal.

{
"notification":{
"title":"Notification Hub Test Notification",
"body":"This is a sample notification delivered by Azure Notification Hubs."
},
"data":{
"property1":"value1",
"property2":53
},
"priority": "high"
}

I'm following Tutorial: Send push notifications to Android devices using Firebase SDK version 1.0.0-preview1 (Current SDK) tutorial.
https://docs.microsoft.com/en-us/azure/notification-hubs/android-sdk

Is there something else which i need to do apart from the mentioned steps in the above link?

Exception or Stack Trace
Add the exception log and stack trace if available

To Reproduce
Steps to reproduce the behavior:

Code Snippet
Add the code snippet that causes the issue.

Expected behavior
It is expected onPushNotificationReceived is triggered in Background/Terminated State of Android app when it receive notification.

Screenshots

NotificationListner

AndroidManifest

MainActivity

Setup (please complete the following information):

  • OS: Android 11
@aziztitu
Copy link
Contributor

@himu243 What version of the SDK are you using?

Also, you mentioned: "When in Background or Terminated State, Notification does get received but onPushNotificationReceived listener is not getting invoked neither automatically nor when I tap on the notification",

If the onPushNotificationReceived is never getting invoked, how are you confirming that the Notification does get received?

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

No branches or pull requests

2 participants