localnotificationsplugin icon indicating copy to clipboard operation
localnotificationsplugin copied to clipboard

Notification Action

Open Krystille opened this issue 7 years ago • 9 comments

Can I add some action to execute when the user clicks the notification or is there a way to do this? In your sample, it only relaunch the application. I want to open a page when clicking the notification.

Krystille avatar Apr 05 '17 06:04 Krystille

+1 I was looking for a event in application's level to handle a notification touched event.

rdrscan avatar Apr 07 '17 20:04 rdrscan

+1 I'm also looking for this feature

gpledran avatar Apr 14 '17 08:04 gpledran

Hello guys!

I'm proposing a simple modification to handle this situation:

https://github.com/rdrscan/LocalNotificationsPlugin/commit/4401f58a5a15d1fe5e19c7e6235cf5e45bddc668 I also made a pull request: https://github.com/edsnider/LocalNotificationsPlugin/pull/8

rdrscan avatar Apr 18 '17 17:04 rdrscan

+1 Any info?

KubusPuchatek avatar Apr 26 '17 18:04 KubusPuchatek

+1 Though also include iOS as well please.

justintemplar avatar Jul 16 '17 06:07 justintemplar

+1 UWP support would be good too. Looked at the code and it seems a new implementation just for UWP (currently it is supported via https://github.com/edsnider/LocalNotificationsPlugin/blob/master/src/Plugin.LocalNotifications.WinRT) would be needed using maybe https://www.nuget.org/packages/Microsoft.Toolkit.Uwp.Notifications/ so that you can then set the ToastContent.Launch property to the desired id/query string. This can then be handled in OnActivated within the UWP app code.

SandipAhluwalia avatar Aug 04 '17 14:08 SandipAhluwalia

+1 Is there any news about this feature? It would be awesome to have it. By the way does someone knows how to redirect to detail page to show Notification Details, can't find a solution and see in the Xamarin forums a lot of people with the same issue. Thanks in advance! This plugin is awesome, just add this functionality please!

santiagobiart avatar Jun 05 '18 23:06 santiagobiart

I think that a click event on a local notification is essential. It's safe to assume that everybody needs to execute an action when they click on the notification. It would be complete and awesome!

stesvis avatar Dec 15 '18 20:12 stesvis

In iOS just do this:

` public override void ReceivedLocalNotification(UIApplication application, UILocalNotification notification) { string NotificationKey = "LocalNotificationKey";

		var c = notification.UserInfo[NotificationKey];

		foreach (var x in notification.UserInfo.Keys)
		{
			var t = notification.UserInfo[x];
			var d = t.Description;
		}

  


		// show an alert

// UIAlertController okayAlertController = UIAlertController.Create(notification.AlertAction, notification.AlertBody, UIAlertControllerStyle.Alert); // okayAlertController.AddAction(UIAlertAction.Create("OK", UIAlertActionStyle.Default, null)); // // Window.RootViewController.PresentViewController(okayAlertController, true, null); // // // reset our badge // UIApplication.SharedApplication.ApplicationIconBadgeNumber = 0; }`

ianvink avatar Jan 23 '19 17:01 ianvink