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

[BUG] OnPushNotificationReceived not hit at all #59

Open
Edwin-Chadio opened this issue Apr 11, 2021 · 1 comment
Open

[BUG] OnPushNotificationReceived not hit at all #59

Edwin-Chadio opened this issue Apr 11, 2021 · 1 comment

Comments

@Edwin-Chadio
Copy link

Edwin-Chadio commented Apr 11, 2021

Describe the bug
OnPushNotificationReceived not hit at all when push notification arrives. Only OnMessageReceived in the FirebaseMessagingService when app is in foreground. OnMessageReceived also not hit when app is in background.

Code Snippet

         NotificationHub.Start(this.Application, AzureNotificationHubConstants.NotificationHubName, 
          AzureNotificationHubConstants.ListenConnectionString);
          NotificationHub.SetListener(new AzureListener());

public class AzureListener : Java.Lang.Object, INotificationListener
  {
      public void OnPushNotificationReceived(Context context, INotificationMessage message)
      {
          Console.WriteLine($"Message received with title {message.Title} and body {message.Body}");
      }
  }

Expected behavior
OnPushNotificationReceived should hit when push notification is delivered

Setup (please complete the following information):

  • OS: Android 11
  • IDE : Visual Studio 2019
  • Version of the Library used: Xamarin.Firebase.Messaging 121.0.1, Xamarin.Azure.NotificationHubs.Android 1.1.4.1, Xamarin.GooglePlayServices.Base 117.6.0, Xamarin.Android.Support.Design 28.0.0.3
@Edwin-Chadio Edwin-Chadio changed the title [BUG] [BUG] OnPushNotificationReceived not hit at all Apr 11, 2021
@Phenek
Copy link
Contributor

Phenek commented Jan 6, 2022

Actually it will hit when the user click on the notification only.

But I am ok with you when we click on the notification and the app is totaly close/kill.
The App start and should raise a NotificationReceived event like in iOS.

But it does not work like iOS and the NotificationReceived event is not raised on click

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