localnotificationsplugin icon indicating copy to clipboard operation
localnotificationsplugin copied to clipboard

Android: fixed issue where activity was being recreated for local not…

Open DottorPagliaccius opened this issue 8 years ago • 10 comments

…ifications

added a way to specify an optional Intent Filter Action property to avoid starting with MainLauncher Activity added notification Id parameter to activity Extras

Just recreated PR from https://github.com/edsnider/Xamarin.Plugins/pull/35

DottorPagliaccius avatar Mar 16 '17 16:03 DottorPagliaccius

Do you have steps that reproduce the problem that this is solving?

edsnider avatar Mar 17 '17 14:03 edsnider

As said here https://github.com/edsnider/Xamarin.Plugins/issues/28

I run the app, launch scheduled local notification, click on the notification icon: then the app close and recreate self, then crashes.

Tried on various Android device (Lollipop or Marshmallow).

DottorPagliaccius avatar Mar 17 '17 15:03 DottorPagliaccius

Ok, does this happen in Xamarin.Forms or traditional Xamarin.Android, or both? I can't reproduce the issue with the sample application, but maybe it's too simple of an app.

edsnider avatar Mar 17 '17 18:03 edsnider

I've only tried with Forms.

DottorPagliaccius avatar Mar 18 '17 20:03 DottorPagliaccius

Hello.

Maybe I have the same issue. My XF apps crashes every time the user taps on the notification. This happens on many different devices including XS debugger with different API levels.

Are you planning to merge this pull request?

mrutter avatar Apr 27 '17 14:04 mrutter

@edsnider, @jamesmontemagno do you plan to merge these requests and deploy an updated Nuget package?

Thank you very much. -m

mrutter avatar May 16 '17 11:05 mrutter

I haven't been able to reproduce the bug this PR is attempting to address, can you point me to a repo or some sample code that is seeing the error?

edsnider avatar May 16 '17 20:05 edsnider

Hi @edsnider. Thank you for your answer. Yes of course, I will update this thread soon with the log of the exception. I also will try to reproduce the same behavior in a simple app (not easy but I will try).

I will be back soon with some more information.

mrutter avatar May 16 '17 20:05 mrutter

I had the same problem. I used the code from this commit: https://github.com/edsnider/LocalNotificationsPlugin/pull/4/commits/f6c700df38c79be6c6982d3fe57bcb06bf8415d7 And the behavior after the transition from the notification was expected.

Please update the NuGet package.

GeorgyRezchikov avatar May 08 '18 10:05 GeorgyRezchikov

@edsnider I believe the sample in this repo demonstrates the original behavior (not the crash), however I wasn't able to get it to build to confirm. So, here is a repo that contains the sample, but updated to the latest Xamarin Forms and plugin versions, along with LaunchMode = SingleTop on the activity:

https://github.com/GalaxiaGuy/localnotificationssample

When you tap on the notifications triggered by the app, the activity is recreated, instead of the existing activity being reused.

GalaxiaGuy avatar Aug 06 '18 15:08 GalaxiaGuy