2

I am using Plugin.LocalNotification to create notification after file is downloaded. But my issue is I am not able to open that file by tapping notification. Instead it navigates to MainPage(Login Page in my case)

    public App()
    {
        InitializeComponent();
        NotificationCenter.Current.NotificationTapped += Current_NotificationTapped;           
    }

    private void Current_NotificationTapped(NotificationTappedEventArgs e)
    {
       // This event doesn't get fire.
    }

I show Notification using following code after creating pdf file.

        var notification = new NotificationRequest
        {
            Title = "Invoice",
            Description = message,                
            ReturningData = filepath, // Returning data when tapped on notification.
           // NotifyTime = DateTime.Now.AddSeconds(2) // Used for Scheduling local notification, if not specified notification will show immediately.111
        };
        NotificationCenter.Current.Show(notification);
        NotificationCenter.Current.NotificationTapped += Current_NotificationTapped; // tried calling tapped event here as well. but no success.

        private void Current_NotificationTapped(NotificationTappedEventArgs e)
        {           
        }

Someone has also reported bug regarding this issue on github.

Thanks

Ruhika
  • 67
  • 7
  • I am also facing same issue. – Gayatri Gokhale Apr 02 '21 at 05:26
  • 1) NotificationTapped this event is not fired when you tap on notification? Some times break point will not hit. You can check by adding debug log (Debug.WriteLine). 2) When you tap on notification i will open the current activity. So, it is expected behaviour. You need to handle opening pdf from the NotificationTapped event only. – Ranjit Apr 03 '21 at 12:24

0 Answers0