From 4401f58a5a15d1fe5e19c7e6235cf5e45bddc668 Mon Sep 17 00:00:00 2001 From: roberto Date: Tue, 18 Apr 2017 14:50:09 -0300 Subject: [PATCH] Add extra key called "NotificationId" and its value to create the possibility to override the method "OnNewIntent" and check this key and value. --- .../LocalNotificationsImplementation.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Plugin.LocalNotifications.Android/LocalNotificationsImplementation.cs b/src/Plugin.LocalNotifications.Android/LocalNotificationsImplementation.cs index fd7ba26..8877d88 100644 --- a/src/Plugin.LocalNotifications.Android/LocalNotificationsImplementation.cs +++ b/src/Plugin.LocalNotifications.Android/LocalNotificationsImplementation.cs @@ -18,6 +18,11 @@ public class LocalNotificationsImplementation : ILocalNotifications /// public static int NotificationIconId { get; set; } + /// + /// The key used to Intent's Extra. + /// + public const string LocalNotificationIntentKey = "NotificationId"; + /// /// Show a local notification /// @@ -42,6 +47,7 @@ public void Show(string title, string body, int id = 0) var resultIntent = GetLauncherActivity(); resultIntent.SetFlags(ActivityFlags.NewTask | ActivityFlags.ClearTask); + resultIntent.PutExtra(LocalNotificationIntentKey, id); var stackBuilder = Android.Support.V4.App.TaskStackBuilder.Create(Application.Context); stackBuilder.AddNextIntent(resultIntent); var resultPendingIntent =