Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Not calling OnNotificationOpened event when app in terminated -Android

See original GitHub issue

When app in terminated (Killed from task-bar), And sending notification to app. When I tap on notification, OnNotificationOpened event not getting called. App navigating to MainPage

CrossFirebasePushNotification.Current.OnNotificationOpened += (s, p) =>
	var data = p.Data;
	if (p.Data.ContainsKey("color"))
	Device.BeginInvokeOnMainThread(() =>
		Xamarin.Forms.Application.Current.MainPage.Navigation.PushModalAsync(new Page1()
			BackgroundColor = Color.FromHex($"{p.Data["color"]}")

For more information visit this

Bug Information

Version Number of Plugin:2.3.5 Device Tested On: Moto c plus Simulator Tested On: Version of VS: 15.8 Version of Xamarin: 3.4 XF Versions of other things you are using:

Steps to reproduce the Behavior

Use code above & send notification when app in foreground

Expected Behavior

App should navigate to Targated screen when tapping on notification

Actual Behavior

When tapping on notification app going to MainPage

Code snippet


Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:11 (1 by maintainers)

github_iconTop GitHub Comments

arvindrajachourasiyacommented, Dec 12, 2018

@Mikilll94 - Thank you for your detailed information. As you said above you are able to open specific view when app terminated. Can you please give me sample repository to just compare where I am making mistake.

rdelrosariocommented, Jan 18, 2019

How is the payload being sent?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Specific view not opening on notification tap when app is ...
Basically, background means the app is still running in the background. You can call the state terminated when the app is killed from...
Read more >
Push Notifications - Interact with notifications - Flutter
Interact with push notifications through various events. ... Terminated state: Your app is no longer running, even in the background.
Read more >
FCM notification not received when app is terminated
I'd like to ask a question regarding Firebase Cloud Messaging. So recently, I've implemented FCM notifications into my app, created the API ...
Read more >
Implementing Push Notifications in Flutter
In this blog post, we will delve into the realm of app push notifications in Flutter, aiming to demystify the process of working...
Read more >
Android xamarin表单中的通知点击事件 - IT宝库 WebAug 3, 2022 · Android ... Not calling OnNotificationOpened event when app in terminated -Android .
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found