Giter Club home page Giter Club logo

plugin.localnotification's Introduction

icon64

CI NuGet NuGet

Plugin.LocalNotification

The local notification plugin provides a way to show local notifications from Xamarin.Forms / .Net MAUI apps.

Setup

  • Plugin.LocalNotification Available on NuGet: https://www.nuget.org/packages/Plugin.LocalNotification
  • .Net MAUI

    • Install Version 10.0.0 above
    • Install into your project
  • Xamarin.Forms

    • Install Version 11.0.0 below
    • Install into your platform-specific projects (iOS/Android), and any .NET Standard 2.0/2.1 projects required for your app.

Platform Support

Feature Xamarin.iOS Xamarin.Android net7.0-ios net7.0-android net8.0-ios (>= 11) net8.0-android (>= 11)
Build SDK >= 10 >= API 31 >= 16 >= API 33 >= 16 >= API 34
Supported OS Version >= 10 >= API 19 >= 10 >= API 21 >= 11 >= API 21
Title
Description
Subtitle
Schedule
Repeat
Custom Sounds
Images
Notification Actions
Clear Delivered Notifications
Get Pending Notifications
Get Delivered Notifications
Location Notifications

Usage

Screen Record

Screen Record

Video

Xamarin.Forms

Local Push Notifications in Xamarin.Forms

.Net MAUI

Local Push Notifications in .Net MAUI

SourceLink Support

In Visual Studio, confirm that SourceLink is enabled. Also, Turn off "Just My Code" since, well, this isn't your code.

https://docs.microsoft.com/en-us/dotnet/standard/library-guidance/sourcelink

Limitations

Only support iOS and Android for the moment.

Contributing

Contributions are welcome. Feel free to file issues and pull requests on the repo and they'll be reviewed as time permits.

Thank you

plugin.localnotification's People

Contributors

arunprakashg avatar asubodh avatar c0ff33-b34n avatar dependabot-preview[bot] avatar dependabot[bot] avatar elvinthudugala avatar entitybox avatar epictek avatar freddyvdh avatar giampaologabba avatar gitbouf avatar griffinmeyer avatar gudninathan avatar kebechet avatar maitlandmarshall avatar masonyc avatar mphill avatar nickmartin1ee7 avatar pikausp avatar steffenberg avatar thudugala avatar vxvendetta001 avatar wcoder avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

plugin.localnotification's Issues

[Android] App crashed when notification comes after closing app.

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. schedule notification for later , one minute for example
  2. Build and run sample project
  3. Click notification send button
  4. Close application
  5. Wait for crash notification

Expected behavior
Notification comes like when application is opened

Smartphone (please complete the following information):

  • Device: s9
  • OS: Android
  • Version API 28
  • and diffrent simulators

Additional context
Logs:
Time Device Name Type PID Tag Message
02-03 10:08:44.557 my_device Debug 6758 Mono Assembly Plugin.LocalNotification[0x9987f0a0] added to domain RootDomain, ref_count=1
02-03 10:08:47.503 my_device Info 6001 Finsky [303] com.google.android.finsky.bo.an.run(6): Stats for Executor: Db-notification_cache com.google.android.finsky.bo.ao@5f49da3[Running, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 1]
02-03 10:08:47.023 my_device Debug 6758 Mono Assembly Ref addref Plugin.LocalNotification[0x9987f0a0] -> System.Xml[0x97b1ad00]: 2
02-03 10:08:46.906 my_device Debug 6758 Mono Assembly Ref addref Plugin.LocalNotification[0x9987f0a0] -> Xamarin.Forms.Core[0x97b1a040]: 2
02-03 10:08:46.906 my_device Debug 6758 Mono Assembly Ref addref Plugin.LocalNotification[0x9987f0a0] -> mscorlib[0x9a57dfa0]: 46
02-03 10:08:46.830 my_device Debug 6758 Mono Assembly Ref addref Plugin.LocalNotification[0x9987f0a0] -> Mono.Android[0x97b1a400]: 43
02-03 10:08:44.563 my_device Debug 6758 Mono Config attempting to parse: '/Users/builder/jenkins/workspace/xamarin-android-d15-9/xamarin-android/external/mono/sdks/out/android-x86-release/etc/mono/assemblies/Plugin.LocalNotification/Plugin.LocalNotification.config'.
02-03 10:08:44.563 my_device Debug 6758 Mono Config attempting to parse: '/storage/emulated/0/Android/data/com.GProjekt.XamarinTesterApp/files/.override/Plugin.LocalNotification.dll.config'.
02-03 10:08:44.563 my_device Debug 6758 Mono Assembly Loader loaded assembly from location: '/storage/emulated/0/Android/data/com.GProjekt.XamarinTesterApp/files/.override/Plugin.LocalNotification.dll'.
02-03 10:08:44.562 my_device Debug 6758 Mono AOT: image '/Users/builder/jenkins/workspace/xamarin-android-d15-9/xamarin-android/external/mono/sdks/out/android-x86-release/lib/mono/aot-cache/x86/Plugin.LocalNotification.dll.so' not found: dlopen failed: library "/data/app/com.GProjekt.XamarinTesterApp-i_qpebq4DyTZx_5dnrqw7Q==/lib/x86/libaot-Plugin.LocalNotification.dll.so" not found
02-03 10:08:44.558 my_device Debug 6758 Mono AOT: image '/storage/emulated/0/Android/data/com.GProjekt.XamarinTesterApp/files/.override/Plugin.LocalNotification.dll.so' not found: dlopen failed: library "/data/app/com.GProjekt.XamarinTesterApp-i_qpebq4DyTZx_5dnrqw7Q==/lib/x86/libaot-Plugin.LocalNotification.dll.so" not found

Time Device Name Type PID Tag Message
02-03 10:08:47.803 my_device Info 6758 MonoDroid System.InvalidOperationException: You MUST call Xamarin.Forms.Init(); prior to using it.
at Xamarin.Forms.Device.get_PlatformServices () [0x00007] in <2ababf5361fa4e5a93abe01acecb2686>:0
at Xamarin.Forms.Device.GetAssemblies () [0x00000] in <2ababf5361fa4e5a93abe01acecb2686>:0
at Xamarin.Forms.DependencyService.Initialize () [0x00008] in <2ababf5361fa4e5a93abe01acecb2686>:0
at Xamarin.Forms.DependencyService.Get[T] (Xamarin.Forms.DependencyFetchTarget fetchTarget) [0x00000] in <2ababf5361fa4e5a93abe01acecb2686>:0
at Plugin.LocalNotification.Platform.Droid.ScheduledNotificationJobService.OnStartJob (Android.App.Job.JobParameters jobParams) [0x00036] in <82eb727555a54d3e9c2630068744e9cd>:0
at Android.App.Job.JobService.n_OnStartJob_Landroid_app_job_JobParameters_ (System.IntPtr jnienv, System.IntPtr native__this, System.IntPtr native__params) [0x00011] in <957bbfdfda4341e2939c881206c1140a>:0
at (wrapper dynamic-method) System.Object.3(intptr,intptr,intptr)

Time Device Name Type PID Tag Message
02-03 10:08:47.924 my_device Error 6758 AndroidRuntime android.runtime.JavaProxyThrowable: System.InvalidOperationException: You MUST call Xamarin.Forms.Init(); prior to using it.
at Xamarin.Forms.Device.get_PlatformServices () [0x00007] in <2ababf5361fa4e5a93abe01acecb2686>:0
at Xamarin.Forms.Device.GetAssemblies () [0x00000] in <2ababf5361fa4e5a93abe01acecb2686>:0
at Xamarin.Forms.DependencyService.Initialize () [0x00008] in <2ababf5361fa4e5a93abe01acecb2686>:0
at Xamarin.Forms.DependencyService.Get[T] (Xamarin.Forms.DependencyFetchTarget fetchTarget) [0x00000] in <2ababf5361fa4e5a93abe01acecb2686>:0
at Plugin.LocalNotification.Platform.Droid.ScheduledNotificationJobService.OnStartJob (Android.App.Job.JobParameters jobParams) [0x00036] in <82eb727555a54d3e9c2630068744e9cd>:0
at Android.App.Job.JobService.n_OnStartJob_Landroid_app_job_JobParameters_ (System.IntPtr jnienv, System.IntPtr native__this, System.IntPtr native__params) [0x00011] in <957bbfdfda4341e2939c881206c1140a>:0
at (wrapper dynamic-method) System.Object.3(intptr,intptr,intptr)
at plugin.localNotification.ScheduledNotificationJobService.n_onStartJob(Native Method)
at plugin.localNotification.ScheduledNotificationJobService.onStartJob(ScheduledNotificationJobService.java:30)
at android.app.job.JobService$1.onStartJob(JobService.java:71)
at android.app.job.JobServiceEngine$JobHandler.handleMessage(JobServiceEngine.java:108)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6541)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)

Only the ReturningData from the last notification is received

Describe the bug
When you schedule multiple notifications, and they have all been triggered, you will only get the ReturningData from the last notification that was triggered.

To Reproduce
Steps to reproduce the behavior:

  1. Schedule one notification in 5 seconds with the Title and ReturningData = "1"
  2. Schedule another notification in 10 seconds with the Title and ReturningData = "2"
  3. Add a NotificationTapped handler that just prints the Data
  4. Run the App
  5. Wait for both notifications to appear
  6. Click on one notification and see that it says "2" in the console
  7. Click on the other notification, it will also say "2" in the console

Expected behavior
When I click on the first notification, I want to get the ReturningData that was scheduled with the first notification and when I click the second notification, I want the ReturningData for that.

Platform:

  • OS: Android
  • Version: Android 10.0 - API 29

Smartphone:

  • Device: Samsung SM-G973F
  • OS: Android 10.0
  • Version: API 29

Additional context
If you click on the first notification, before the second one appear, you get the correct data for it, and when you wait for the second one, it also has the correct data. The problem only occurs if you wait for both notifications to be shown.

Plugin.LocalNotification and System.ServiceModel can't be together in the same project

Describe the bug
Plugin.LocalNotification and System.ServiceModel can't be together in the same project

To Reproduce
Steps to reproduce the behavior:
When I include wcf service to my project , the dependence for: System.ServeceModel.Duplex + System.ServeceModel.Http + System.ServeceModel.NetTcp + System.ServeceModel.Security and 73 compile Error popup !!!
All of them are in App.Android project at Recource.Designer.cs file.
See error:
Severity Code Description Project File Line Suppression State
Error CS0102 The type 'Resource.Id' already contains a definition for 'main' LocalNotification.Sample.Android D:\Desktop\Sample\NuGet\Sample.Android\obj\Debug\90\designtime\Resource.designer.cs 6482 Active
Error CS0145 A const field requires a value to be provided LocalNotification.Sample.Android D:\Desktop\Sample\NuGet\Sample.Android\obj\Debug\90\designtime\Resource.designer.cs 6323 Active
Error CS1003 Syntax error, ',' expected LocalNotification.Sample.Android D:\Desktop\Sample\NuGet\Sample.Android\obj\Debug\90\designtime\Resource.designer.cs 6323 Active
Error CS1002 ; expected LocalNotification.Sample.Android D:\Desktop\Sample\NuGet\Sample.Android\obj\Debug\90\designtime\Resource.designer.cs 6323 Active
Error CS1519 Invalid token '=' in class, struct, or interface member declaration LocalNotification.Sample.Android D:\Desktop\Sample\NuGet\Sample.Android\obj\Debug\90\designtime\Resource.designer.cs 6323 Active
Error CS1519 Invalid token '=' in class, struct, or interface member declaration LocalNotification.Sample.Android D:\Desktop\Sample\NuGet\Sample.Android\obj\Debug\90\designtime\Resource.designer.cs 6323 Active
Error CS0145 A const field requires a value to be provided LocalNotification.Sample.Android D:\Desktop\Sample\NuGet\Sample.Android\obj\Debug\90\designtime\Resource.designer.cs 6326 Active
Error CS1003 Syntax error, ',' expected LocalNotification.Sample.Android D:\Desktop\Sample\NuGet\Sample.Android\obj\Debug\90\designtime\Resource.designer.cs 6326 Active
Error CS1002 ; expected LocalNotification.Sample.Android D:\Desktop\Sample\NuGet\Sample.Android\obj\Debug\90\designtime\Resource.designer.cs 6326 Active
Error CS1519 Invalid token '=' in class, struct, or interface member declaration LocalNotification.Sample.Android D:\Desktop\Sample\NuGet\Sample.Android\obj\Debug\90\designtime\Resource.designer.cs 6326 Active
Error CS1519 Invalid token '=' in class, struct, or interface member declaration LocalNotification.Sample.Android D:\Desktop\Sample\NuGet\Sample.Android\obj\Debug\90\designtime\Resource.designer.cs 6326 Active
Error CS0145 A const field requires a value to be provided LocalNotification.Sample.Android D:\Desktop\Sample\NuGet\Sample.Android\obj\Debug\90\designtime\Resource.designer.cs 6422 Active
Error CS1003 Syntax error, ',' expected LocalNotification.Sample.Android D:\Desktop\Sample\NuGet\Sample.Android\obj\Debug\90\designtime\Resource.designer.cs 6422 Active
Error CS1002 ; expected LocalNotification.Sample.Android D:\Desktop\Sample\NuGet\Sample.Android\obj\Debug\90\designtime\Resource.designer.cs 6422 Active
Error CS1519 Invalid token '=' in class, struct, or interface member declaration LocalNotification.Sample.Android D:\Desktop\Sample\NuGet\Sample.Android\obj\Debug\90\designtime\Resource.designer.cs 6422 Active
Error CS1519 Invalid token '=' in class, struct, or interface member declaration LocalNotification.Sample.Android D:\Desktop\Sample\NuGet\Sample.Android\obj\Debug\90\designtime\Resource.designer.cs 6422 Active
Error CS0145 A const field requires a value to be provided LocalNotification.Sample.Android D:\Desktop\Sample\NuGet\Sample.Android\obj\Debug\90\designtime\Resource.designer.cs 6425 Active
Error CS1003 Syntax error, ',' expected LocalNotification.Sample.Android D:\Desktop\Sample\NuGet\Sample.Android\obj\Debug\90\designtime\Resource.designer.cs 6425 Active
Error CS1002 ; expected LocalNotification.Sample.Android D:\Desktop\Sample\NuGet\Sample.Android\obj\Debug\90\designtime\Resource.designer.cs 6425 Active
Error CS1519 Invalid token '=' in class, struct, or interface member declaration LocalNotification.Sample.Android D:\Desktop\Sample\NuGet\Sample.Android\obj\Debug\90\designtime\Resource.designer.cs 6425 Active
Error CS1519 Invalid token '=' in class, struct, or interface member declaration LocalNotification.Sample.Android D:\Desktop\Sample\NuGet\Sample.Android\obj\Debug\90\designtime\Resource.designer.cs 6425 Active
Error CS0145 A const field requires a value to be provided LocalNotification.Sample.Android D:\Desktop\Sample\NuGet\Sample.Android\obj\Debug\90\designtime\Resource.designer.cs 6479 Active
Error CS1003 Syntax error, ',' expected LocalNotification.Sample.Android D:\Desktop\Sample\NuGet\Sample.Android\obj\Debug\90\designtime\Resource.designer.cs 6479 Active
Error CS1002 ; expected LocalNotification.Sample.Android D:\Desktop\Sample\NuGet\Sample.Android\obj\Debug\90\designtime\Resource.designer.cs 6479 Active
Error CS1519 Invalid token '=' in class, struct, or interface member declaration LocalNotification.Sample.Android D:\Desktop\Sample\NuGet\Sample.Android\obj\Debug\90\designtime\Resource.designer.cs 6479 Active
Error CS1519 Invalid token '=' in class, struct, or interface member declaration LocalNotification.Sample.Android D:\Desktop\Sample\NuGet\Sample.Android\obj\Debug\90\designtime\Resource.designer.cs 6479 Active
Error CS0145 A const field requires a value to be provided LocalNotification.Sample.Android D:\Desktop\Sample\NuGet\Sample.Android\obj\Debug\90\designtime\Resource.designer.cs 6482 Active
Error CS1003 Syntax error, ',' expected LocalNotification.Sample.Android D:\Desktop\Sample\NuGet\Sample.Android\obj\Debug\90\designtime\Resource.designer.cs 6482 Active
Error CS1002 ; expected LocalNotification.Sample.Android D:\Desktop\Sample\NuGet\Sample.Android\obj\Debug\90\designtime\Resource.designer.cs 6482 Active
Error CS1519 Invalid token '=' in class, struct, or interface member declaration LocalNotification.Sample.Android D:\Desktop\Sample\NuGet\Sample.Android\obj\Debug\90\designtime\Resource.designer.cs 6482 Active
Error CS1519 Invalid token '=' in class, struct, or interface member declaration LocalNotification.Sample.Android D:\Desktop\Sample\NuGet\Sample.Android\obj\Debug\90\designtime\Resource.designer.cs 6482 Active
Error CS0145 A const field requires a value to be provided LocalNotification.Sample.Android D:\Desktop\Sample\NuGet\Sample.Android\obj\Debug\90\designtime\Resource.designer.cs 6485 Active
Error CS1003 Syntax error, ',' expected LocalNotification.Sample.Android D:\Desktop\Sample\NuGet\Sample.Android\obj\Debug\90\designtime\Resource.designer.cs 6485 Active
Error CS1002 ; expected LocalNotification.Sample.Android D:\Desktop\Sample\NuGet\Sample.Android\obj\Debug\90\designtime\Resource.designer.cs 6485 Active
Error CS1519 Invalid token '=' in class, struct, or interface member declaration LocalNotification.Sample.Android D:\Desktop\Sample\NuGet\Sample.Android\obj\Debug\90\designtime\Resource.designer.cs 6485 Active
Error CS1519 Invalid token '=' in class, struct, or interface member declaration LocalNotification.Sample.Android D:\Desktop\Sample\NuGet\Sample.Android\obj\Debug\90\designtime\Resource.designer.cs 6485 Active
Error CS0145 A const field requires a value to be provided LocalNotification.Sample.Android D:\Desktop\Sample\NuGet\Sample.Android\obj\Debug\90\designtime\Resource.designer.cs 6488 Active
Error CS1003 Syntax error, ',' expected LocalNotification.Sample.Android D:\Desktop\Sample\NuGet\Sample.Android\obj\Debug\90\designtime\Resource.designer.cs 6488 Active
Error CS1002 ; expected LocalNotification.Sample.Android D:\Desktop\Sample\NuGet\Sample.Android\obj\Debug\90\designtime\Resource.designer.cs 6488 Active
Error CS1519 Invalid token '=' in class, struct, or interface member declaration LocalNotification.Sample.Android D:\Desktop\Sample\NuGet\Sample.Android\obj\Debug\90\designtime\Resource.designer.cs 6488 Active
Error CS1519 Invalid token '=' in class, struct, or interface member declaration LocalNotification.Sample.Android D:\Desktop\Sample\NuGet\Sample.Android\obj\Debug\90\designtime\Resource.designer.cs 6488 Active
Error CS0145 A const field requires a value to be provided LocalNotification.Sample.Android D:\Desktop\Sample\NuGet\Sample.Android\obj\Debug\90\designtime\Resource.designer.cs 6764 Active
Error CS1003 Syntax error, ',' expected LocalNotification.Sample.Android D:\Desktop\Sample\NuGet\Sample.Android\obj\Debug\90\designtime\Resource.designer.cs 6764 Active
Error CS1002 ; expected LocalNotification.Sample.Android D:\Desktop\Sample\NuGet\Sample.Android\obj\Debug\90\designtime\Resource.designer.cs 6764 Active
Error CS1519 Invalid token '=' in class, struct, or interface member declaration LocalNotification.Sample.Android D:\Desktop\Sample\NuGet\Sample.Android\obj\Debug\90\designtime\Resource.designer.cs 6764 Active
Error CS1519 Invalid token '=' in class, struct, or interface member declaration LocalNotification.Sample.Android D:\Desktop\Sample\NuGet\Sample.Android\obj\Debug\90\designtime\Resource.designer.cs 6764 Active
Error CS0145 A const field requires a value to be provided LocalNotification.Sample.Android D:\Desktop\Sample\NuGet\Sample.Android\obj\Debug\90\designtime\Resource.designer.cs 6767 Active
Error CS1003 Syntax error, ',' expected LocalNotification.Sample.Android D:\Desktop\Sample\NuGet\Sample.Android\obj\Debug\90\designtime\Resource.designer.cs 6767 Active
Error CS1002 ; expected LocalNotification.Sample.Android D:\Desktop\Sample\NuGet\Sample.Android\obj\Debug\90\designtime\Resource.designer.cs 6767 Active
Error CS1519 Invalid token '=' in class, struct, or interface member declaration LocalNotification.Sample.Android D:\Desktop\Sample\NuGet\Sample.Android\obj\Debug\90\designtime\Resource.designer.cs 6767 Active
Error CS1519 Invalid token '=' in class, struct, or interface member declaration LocalNotification.Sample.Android D:\Desktop\Sample\NuGet\Sample.Android\obj\Debug\90\designtime\Resource.designer.cs 6767 Active
Error CS0145 A const field requires a value to be provided LocalNotification.Sample.Android D:\Desktop\Sample\NuGet\Sample.Android\obj\Debug\90\designtime\Resource.designer.cs 6770 Active
Error CS1003 Syntax error, ',' expected LocalNotification.Sample.Android D:\Desktop\Sample\NuGet\Sample.Android\obj\Debug\90\designtime\Resource.designer.cs 6770 Active
Error CS1002 ; expected LocalNotification.Sample.Android D:\Desktop\Sample\NuGet\Sample.Android\obj\Debug\90\designtime\Resource.designer.cs 6770 Active
Error CS1519 Invalid token '=' in class, struct, or interface member declaration LocalNotification.Sample.Android D:\Desktop\Sample\NuGet\Sample.Android\obj\Debug\90\designtime\Resource.designer.cs 6770 Active
Error CS1519 Invalid token '=' in class, struct, or interface member declaration LocalNotification.Sample.Android D:\Desktop\Sample\NuGet\Sample.Android\obj\Debug\90\designtime\Resource.designer.cs 6770 Active
Error CS0102 The type 'Resource.Id' already contains a definition for 'bottomtab' LocalNotification.Sample.Android D:\Desktop\Sample\NuGet\Sample.Android\obj\Debug\90\designtime\Resource.designer.cs 6326 Active
Error CS0102 The type 'Resource.Id' already contains a definition for 'flyoutcontent' LocalNotification.Sample.Android D:\Desktop\Sample\NuGet\Sample.Android\obj\Debug\90\designtime\Resource.designer.cs 6425 Active
Error CS0102 The type 'Resource.Id' already contains a definition for 'main' LocalNotification.Sample.Android D:\Desktop\Sample\NuGet\Sample.Android\obj\Debug\90\designtime\Resource.designer.cs 6485 Active
Error CS0102 The type 'Resource.Id' already contains a definition for 'main' LocalNotification.Sample.Android D:\Desktop\Sample\NuGet\Sample.Android\obj\Debug\90\designtime\Resource.designer.cs 6488 Active
Error CS0102 The type 'Resource.Id' already contains a definition for 'shellcontent' LocalNotification.Sample.Android D:\Desktop\Sample\NuGet\Sample.Android\obj\Debug\90\designtime\Resource.designer.cs 6767 Active
Error CS0102 The type 'Resource.Id' already contains a definition for 'shellcontent' LocalNotification.Sample.Android D:\Desktop\Sample\NuGet\Sample.Android\obj\Debug\90\designtime\Resource.designer.cs 6770 Active
Error IDE1007 The name 'navarea' does not exist in the current context. LocalNotification.Sample.Android D:\Desktop\Sample\NuGet\Sample.Android\obj\Debug\90\designtime\Resource.designer.cs 6323 Active
Error IDE1007 The name 'tabbar' does not exist in the current context. LocalNotification.Sample.Android D:\Desktop\Sample\NuGet\Sample.Android\obj\Debug\90\designtime\Resource.designer.cs 6326 Active
Error IDE1007 The name 'appbar' does not exist in the current context. LocalNotification.Sample.Android D:\Desktop\Sample\NuGet\Sample.Android\obj\Debug\90\designtime\Resource.designer.cs 6422 Active
Error IDE1007 The name 'recycler' does not exist in the current context. LocalNotification.Sample.Android D:\Desktop\Sample\NuGet\Sample.Android\obj\Debug\90\designtime\Resource.designer.cs 6425 Active
Error IDE1007 The name 'appbar' does not exist in the current context. LocalNotification.Sample.Android D:\Desktop\Sample\NuGet\Sample.Android\obj\Debug\90\designtime\Resource.designer.cs 6479 Active
Error IDE1007 The name 'scrollview' does not exist in the current context. LocalNotification.Sample.Android D:\Desktop\Sample\NuGet\Sample.Android\obj\Debug\90\designtime\Resource.designer.cs 6482 Active
Error IDE1007 The name 'tablayout' does not exist in the current context. LocalNotification.Sample.Android D:\Desktop\Sample\NuGet\Sample.Android\obj\Debug\90\designtime\Resource.designer.cs 6485 Active
Error IDE1007 The name 'toolbar' does not exist in the current context. LocalNotification.Sample.Android D:\Desktop\Sample\NuGet\Sample.Android\obj\Debug\90\designtime\Resource.designer.cs 6488 Active
Error IDE1007 The name 'appbar' does not exist in the current context. LocalNotification.Sample.Android D:\Desktop\Sample\NuGet\Sample.Android\obj\Debug\90\designtime\Resource.designer.cs 6764 Active
Error IDE1007 The name 'scrollview' does not exist in the current context. LocalNotification.Sample.Android D:\Desktop\Sample\NuGet\Sample.Android\obj\Debug\90\designtime\Resource.designer.cs 6767 Active
Error IDE1007 The name 'toolbar' does not exist in the current context. LocalNotification.Sample.Android D:\Desktop\Sample\NuGet\Sample.Android\obj\Debug\90\designtime\Resource.designer.cs 6770 Active
Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Platform (please complete the following information):

  • OS: [e.g. iOS] windows 10
  • Version [e.g. 22] 2.0.7

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Version [e.g. 22]

Additional context

Add any other context about the problem here.
Here's the sample project , from this site, with the Compile errors
Sample.zip

Local Notification sent immediately not scheduled

Hi,

In the attached sample, Ia m using a PeriodicWorkRequest to be running every 30 minutes and inside the WorkRequest I am getting prayer times and then scheduling the time for the notifications.

I am showing the Times On MainPage,xaml just to refer to..

The problem that when I start the app then the push notification is sent immediately although it should be scheduled on the specific time which gives false alert about the prayer time

Also try to close the app several times and open several times you'll notice the push notification is being sent too

LocalNotifications.zip

No platform plugin found

I install this plugin to PCL and all project in Xamarin.form without error.
and in Iphone it works well.
But in android I get the following error message.

[Plugin.LocalNotification] No platform plugin found. Did you install the nuget package in your app project as well?"

What did I miss in installation.

Thanks.

[iOS] Badge not get cleared after reading the notification

Describe the bug
Badge on app is not cleared after reading the local notification

To Reproduce
Steps to reproduce the behavior:

  1. Send some local notification.
  2. Read it.
  3. Badge still hangs on app icon

Expected behavior
Badge should be cleared

Platform (please complete the following information):

  • OS: iOS
  • Version 10+

Can't install package from NuGet

When trying to install package from NuGet in VS 2019 16.4.3 I have this error:

Failed to add reference. The package 'Plugin.LocalNotification' tried to add a framework reference to 'System.Drawing.Common.dll' which was not found in the GAC. This is possibly a bug in the package. Please contact the package owners for assistance.
Reference unavailable.

No sound on android < 8.0

Describe the bug
No sound is played on devices with Android 7.0 or before

It doesn't work if request.Sound is null or empty. It works if request.Sound is set e.g. to "Default". The sound file must not exist.

Android 8 Icon Color issue

Sample

Also, I noticed that on Android Oreo, the icon doesn't get any color (not even the gray when no color is set). Any idea why? I've only been testing on Android 8 and 9.

Check this out:

Android 9 Pie:
screenshot-2019-11-06_11 52 56 913

Android 8 Oreo:
WhatsApp Image 2019-11-06 at 12 52 27

As I know, this color feature was added on API 21, right? Not sure though.. Also, the icon file is exactly the same on both.

This could be a thing on my physical device.. it's a Samsung A5 2017 with the brand modified Android system and things..

And, by the way, thanks for the plugin, it's pretty good. I've been testing and if everything runs smooth, I'll use it on production.

Originally posted by @agharium in #58 (comment)

["SDK Assemblies Only" linking] Setted Android icon not showing on future notifications + future notifications don't appear at all

Describe the bug
The setted icon is only used in notifications when app is running in debug mode or in release mode with linking option set to none.
In that last case, it uses the launcher icon instead of the icon set in the notification options. Also, this only happens when NotifyTime is set to future. I tested it with a past DateTime and it didn't appeared any notification. I believe this is expected behavior. Instant notifications works just fine.

To Reproduce
Steps to reproduce the behavior:

  1. Set a notification with an icon and also set a launcher icon on the android project and a future NotifyTime.
  2. Set linking option to "SDK Assemblies Only" in release mode.
  3. Run app in release mode.
  4. Future notifications shows up with the app launcher icon instead of the originally setted icon on code.

IconSample.zip

Expected behavior
Future notification shown with the selected notification icon of when it was setted on code.

Screenshots
screenshot-2020-01-27_22 37 58 446
☝️ Android 9: blank round icon because android expects a entirely white icon, and that's not the launcher icon case.

WhatsApp Image 2020-01-28 at 09 04 09
☝️ Android 8: actually shows launcher entirelly instead of setted icon on the notification.

Platform (please complete the following information):

  • OS: Android
  • Target version: 10

Smartphone (please complete the following information):

  • Device: Genymotion emulator and Samsung A5 2017
  • OS: Android
  • Version: 9 and 8 respectively

Additional context
I bet the other issue that I had (#63) is probably happening because of that and I see that #69 may have some similarity as well. The issue at #58 may also have some similarity with this "only works without any linking set" thing and such.

This also is the reason that another project of mine (my main one atm) is actually not showing notifications when NotifyTime is set. I just disabled linking and it's working flawlessly. It soon needs to go into production, so I just gotta deal with the big apk size. If you have any idea of what's going on, it would help a lot.

Thanks for the plugin, see you guys.

Cannot build demo application in release mode and proguard enabled

Describe the bug
Cannot build demo application in release mode and proguard enabled

To Reproduce
Steps to reproduce the behavior:

  1. Open Sample/Nuget/LocalNotification.Sample.sln in Visual Studio >= 2017
  2. Select Release mode
  3. In Android Properties select Android options and set Code shrinker to ProGuard (I used 6.1.1 but nothing really works)

Expected behavior
Project should compiled successfully

Screenshots
If applicable, add screenshots to help explain your problem.

Platform (please complete the following information):

  • OS: Windows 10
  • 10.0.17763 b.17763

Additional context
LOG
2> PROGUARD : warning : android.arch.persistence.room.paging.LimitOffsetDataSource: can't find superclass or interface android.arch.paging.PositionalDataSource
2> PROGUARD : warning : android.arch.persistence.room.paging.LimitOffsetDataSource: can't find referenced class android.arch.paging.PositionalDataSource
2> PROGUARD : warning : android.arch.persistence.room.paging.LimitOffsetDataSource: can't find referenced class android.arch.paging.PositionalDataSource
2> PROGUARD : warning : android.arch.persistence.room.paging.LimitOffsetDataSource: can't find referenced class android.arch.paging.PositionalDataSource$LoadInitialCallback
2> PROGUARD : warning : android.arch.persistence.room.paging.LimitOffsetDataSource: can't find referenced method 'int computeInitialLoadPosition(android.arch.paging.PositionalDataSource$LoadInitialParams,int)' in program class android.arch.persistence.room.paging.LimitOffsetDataSource
2> PROGUARD : warning : android.arch.persistence.room.paging.LimitOffsetDataSource: can't find referenced method 'int computeInitialLoadSize(android.arch.paging.PositionalDataSource$LoadInitialParams,int,int)' in program class android.arch.persistence.room.paging.LimitOffsetDataSource
2> PROGUARD : warning : android.arch.persistence.room.paging.LimitOffsetDataSource: can't find referenced method 'void invalidate()' in program class android.arch.persistence.room.paging.LimitOffsetDataSource
2> PROGUARD : warning : android.arch.persistence.room.paging.LimitOffsetDataSource: can't find referenced class android.arch.paging.PositionalDataSource$LoadRangeParams
2> PROGUARD : warning : android.arch.persistence.room.paging.LimitOffsetDataSource: can't find referenced class android.arch.paging.PositionalDataSource$LoadRangeParams
2> PROGUARD : warning : android.arch.persistence.room.paging.LimitOffsetDataSource: can't find referenced class android.arch.paging.PositionalDataSource$LoadRangeCallback
2> PROGUARD : warning : android.arch.persistence.room.paging.LimitOffsetDataSource: can't find referenced class android.arch.paging.PositionalDataSource
2> PROGUARD : warning : android.arch.persistence.room.paging.LimitOffsetDataSource: can't find referenced class android.arch.paging.PositionalDataSource$LoadInitialParams
2> PROGUARD : warning : android.arch.persistence.room.paging.LimitOffsetDataSource: can't find referenced class android.arch.paging.PositionalDataSource$LoadInitialCallback
2> PROGUARD : warning : android.arch.persistence.room.paging.LimitOffsetDataSource: can't find referenced class android.arch.paging.PositionalDataSource$LoadRangeParams
2> PROGUARD : warning : android.arch.persistence.room.paging.LimitOffsetDataSource: can't find referenced class android.arch.paging.PositionalDataSource$LoadRangeCallback
2> PROGUARD : warning : android.arch.persistence.room.paging.LimitOffsetDataSource: can't find referenced class android.arch.paging.PositionalDataSource$LoadInitialParams
2> PROGUARD : warning : android.arch.persistence.room.paging.LimitOffsetDataSource: can't find referenced class android.arch.paging.PositionalDataSource$LoadInitialCallback
2> PROGUARD : warning : android.arch.persistence.room.paging.LimitOffsetDataSource: can't find referenced class android.arch.paging.PositionalDataSource$LoadInitialParams
2> PROGUARD : warning : android.arch.persistence.room.paging.LimitOffsetDataSource: can't find referenced class android.arch.paging.PositionalDataSource$LoadInitialCallback
2> PROGUARD : warning : android.arch.persistence.room.paging.LimitOffsetDataSource: can't find referenced class android.arch.paging.PositionalDataSource$LoadInitialCallback
2> PROGUARD : warning : android.arch.persistence.room.paging.LimitOffsetDataSource: can't find referenced class android.arch.paging.PositionalDataSource$LoadInitialParams
2> PROGUARD : warning : android.arch.persistence.room.paging.LimitOffsetDataSource: can't find referenced class android.arch.paging.PositionalDataSource$LoadInitialCallback
2> PROGUARD : warning : android.arch.persistence.room.paging.LimitOffsetDataSource: can't find referenced class android.arch.paging.PositionalDataSource$LoadRangeParams
2> PROGUARD : warning : android.arch.persistence.room.paging.LimitOffsetDataSource: can't find referenced class android.arch.paging.PositionalDataSource$LoadRangeCallback
2> PROGUARD : warning : android.arch.persistence.room.paging.LimitOffsetDataSource: can't find referenced class android.arch.paging.PositionalDataSource$LoadRangeParams
2> PROGUARD : warning : android.arch.persistence.room.paging.LimitOffsetDataSource: can't find referenced class android.arch.paging.PositionalDataSource$LoadRangeCallback
2> PROGUARD : warning : android.arch.persistence.room.paging.LimitOffsetDataSource: can't find referenced class android.arch.paging.PositionalDataSource$LoadRangeCallback
2> PROGUARD : warning : android.arch.persistence.room.paging.LimitOffsetDataSource: can't find referenced class android.arch.paging.PositionalDataSource$LoadRangeParams
2> PROGUARD : warning : android.arch.persistence.room.paging.LimitOffsetDataSource: can't find referenced class android.arch.paging.PositionalDataSource$LoadRangeCallback
2> PROGUARD : warning : android.arch.persistence.room.paging.LimitOffsetDataSource: can't find referenced class android.arch.paging.PositionalDataSource
2> PROGUARD : warning : android.arch.persistence.room.paging.LimitOffsetDataSource$1: can't find referenced method 'void invalidate()' in program class android.arch.persistence.room.paging.LimitOffsetDataSource
2> PROGUARD : warning : there were 27 unresolved references to classes or interfaces.
2> PROGUARD : warning : there were 4 unresolved references to program class members.

EDIT: Neither version above 3 works. The same problem with R8.

Get Scheduled Notification Details

Hi

How can I loop through all the scheduled notifications and read their details?

Or how can I get a specific scheduled notification details by ID?

** I a not not talking about Notification_Tapped here but I just want to know what are all the pending notifications

Thanks,
Jassim

Notifications working but no alert sound

Hi,

First of all, thanks and appreciate for the effort of creating this plugin, it is working in anywhere accept no alert sound or ring when notification appears, seeking fo help.

Thank you =)

'Current' is not available in iOS - NotificationCenter

I installed the nuget package in both Android and iOS projects of Xamarin Forms project.
The NotificationCenter.Current property has a compilation error that it does not exist in the iOS project. I tried changing the iOS deployment target to 11, but still the error exist.

I couldn't show the notification due to this issue.

Refer the attached screenshot.
Screenshot 2019-09-28 at 20 32 12

Future local notifications not working on v4.1.1 on Android

Describe the bug
Updated from v4.0.8 to v4.1.1 and now notifications with a NotifyTime set in the future no longer work on Android. Instead the application output displays the following when the time is reached but no notification is displayed:
[WM-WorkerWrapper] Worker result SUCCESS for Work [ id=8b6a975d-8bb3-43c7-9dc8-23110e719443, tags={ md50e8eea8286f69b03ef3779df0abd57a6.ScheduledNotificationWorker, 4 } ]

To Reproduce
Steps to reproduce the behavior:

  1. Install v4.1.1 from nuget.
  2. Setup notification request on Android for a future time.
  3. Wait for notification to reach time.
  4. No local notification is displayed.

Expected behavior
A local notification should appear like previous versions.

Screenshots

Platform (please complete the following information):

  • OS: Android
  • Version: All versions, recently tested on API 29

Smartphone (please complete the following information):

  • Device: Pixel 2XL
  • OS: Android
  • Version: API 29

Additional context

Missing Unbinding NotificationTapped from App | Multiple invokes on singal tap

NotificationCenter.Current.NotificationTapped += LoadPageFromNotification is being binded everytime in App constructor, which binds the event multiple times in android.
That can cause of invoking LoadPageFromNotification multiple time on single notification click. I would appreciate if you add some solution for this too in your sample.

Adding unbinding works for me in onsleep()

protected override void OnSleep()
{
   NotificationCenter.Current.NotificationTapped -= LoadPageFromNotification;
}

Can't get NotificationTapped Event working

Describe the bug
I have the NotificationCenter.Current.NotificationTapped += Current_NotificationTapped; in the App.xaml.cs file above the MainPage=new AppShell(); but no matter what I do this event is not triggered when I click on the notifications. As of writing this, I'm on the latest version of everything including ios, xamarin.forms and this plugin.

[iOS] ArgumentNullException when showing notification if ReturningData is set to null

Describe the bug
On iOS, if ReturningData is null in NotificationRequest, then NotificationCenter.Current.Show results in an ArgumentNullException.
No issue on Android.

To Reproduce
Steps to reproduce the behavior:

  1. Create a NotificationRequest without setting ReturningData (value should be null)
  2. Call NotificationCenter.Current.Show for this notificationRequest
  3. On iOS, the notification is not shown, and an exception is raised

Expected behavior
The notification should be shown on iOS (as it does on Android).

Platform:

  • OS: iOS

Smartphone:

  • Device: simulator (iPhone XR)
  • OS: iOS 12.4

Additional context
Here is the exception:

[0:] System.ArgumentNullException: Value cannot be null.
Parameter name: str
  at Foundation.NSString..ctor (System.String str) [0x00009] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.16.0.5/src/Xamarin.iOS/Foundation/NSString.cs:159
  at Plugin.LocalNotification.Platform.iOS.NotificationServiceImpl.Show (Plugin.LocalNotification.NotificationRequest notificationRequest) [0x00036] in <a9531fbd8e004bca81f421001d65427d>:0

I suspect something is wrong in this part of the code (in NotificationServiceImpl for iOS, method Show):

using (var returningData = new NSString(notificationRequest.ReturningData))
{
           userInfoDictionary.SetValueForKey(
                  string.IsNullOrWhiteSpace(notificationRequest.ReturningData)
                       ? NSString.Empty
                       : returningData, NotificationCenter.ExtraReturnDataIos);
}

Maybe you should test for IsNullOrWhiteSpace before creating the NSString ?

Send Local Notification when app is not running

Hi,

Is it possible with the current version (v4.0.6) to get the Local Notifications even when the app is not running?
I have a sample code which is working fine when the app is running (foreground and background) and the Android app displays the notification, but when I kill the app, the notification is not sent/received.

Thanks,
S.

NotificationTapped doesn't work with splash screen.

Describe the bug
When I use a splash activity tap event never fires.

To Reproduce
Steps to reproduce the behavior:

  1. Create a SplashActivity class.
  2. Set its MainLauncher to true.
  3. Start MainActivity inside its OnCreate method.
  4. Create a notification
  5. Tap on the notification

Expected behavior
NotificationTapped event gets fired

Platform (please complete the following information):
-OS: Android 9

Smartphone (please complete the following information):

  • Device: genymotion emulator
  • OS: Android
  • Version 23

cannot access ListenableFuture

Hello,

I have this error on the project Xamarin.Froms.Android with version 4.0.3 :

Error: error: cannot access ListenableFuture public class ScheduledNotificationWorker class file for com.google.common.util.concurrent.ListenableFuture not found

Does this come from the plugin or an implementation error?

API Level 26 Notification Not Working

I've put all the sample code in my application, and it worked perfectly fine on IOS and Android version 7.1 and below. But on Android 8.0 and above, it won't work. Maybe I missed something?

Here's the code i've inserted to my application.

var notifications = new NotificationRequest
{
NotificationId = 100,
BadgeNumber = 10,
Title = "sample title",
Description = "sample description",
ReturningData = "sample data",
NotifyTime = DateTime.Now.AddSeconds(1),
Android =
{
IconName = "download.jpg",
ChannelId = CrossDeviceInfo.Current.Version.ToString(),
Priority = NotificationPriority.Max,
AutoCancel = false,
TimeoutAfter = TimeSpan.FromSeconds(5),
Ongoing = true,
Color = 255,
LedColor = 255
}
};
NotificationCenter.Current.Show(notifications);

Unable to Set Android Notification Icon

Describe the bug
After setting NotificationRequest.Android.IconName, the notification icon on Android is still the default icon.

To Reproduce
Steps to reproduce the behavior:

  1. Add notification icon (e.g. icon.png) to Resources/drawable.
  2. Initial NotificationRequest object and set Android.IconName to "icon".
  3. Try to push notification.
  4. Notification icon is the default one

Expected behavior
Notification icon should be the customised one.

Platform:

  • Plugin Version: 4.1.1
  • OS: Android 9 (Pie)
  • Emulator: Pixel 2 XL

Additional context
Notification icon can be set only when setting NotificationRequest. Android.IconName to the resource id of the icon (which can be found inside Resource.designer.cs)

Documentation is incorrect

var notification = new Plugin.LocalNotification.LocalNotification
{
    NotificationId = 100,
    Title = "Test",
    Description = "Test Description",
    ReturningData = "Dummy data", // Returning data when tapped on notification.
    NotifyTime = DateTime.Now.AddSeconds(30) // Used for Scheduling local notification, if not specified notification will show immediately.
};
NotificationCenter.Current.Show(notification);

This doesn't complile, new NotificationRequest should be used instead

Schedule Notification

Hello is possibile to schedule notification for a future date?
Will this notification persist after phone reboot?
Thanks for your plugin!

Version conflict when updating Xamarin.Android.Arch.Work.Runtime

I have this warning when building my app:
NU1107: Version conflict detected for ....
... -> Xamarin.Essentials 1.3.1 -> Xamarin.Android.Support.Core.Utils 28.0.0.3 -> Xamarin.Android.Support.Loader 28.0.0.3 -> Xamarin.Android.Arch.Lifecycle.LiveData 1.1.1.3 -> Xamarin.Android.Arch.Core.Common (= 1.1.1.3)
... -> Plugin.LocalNotification 4.0.6 -> Xamarin.Android.Arch.Work.Runtime 1.0.0 -> Xamarin.Android.Arch.Lifecycle.Extensions 1.1.1.1 -> Xamarin.Android.Arch.Core.Common (= 1.1.1.1).

Could you please publish a Plugin.LocalNotification 4.0.7 referencing Xamarin.Android.Arch.Work.Runtime 1.0.0.3 instead of 1.0.0 ?

xamarin/AndroidSupportComponents/issues/204

Notification icon is incorrect

  1. Compile your sample project using Android 10
  2. Run on emulator with android 9
  3. Notification icon is fully white circle

I also tried icons from clipart (Android notification icons) and they also display incorrectly - always full square.

Custom Notification Sound

Is your feature request related to a problem? Please describe.
this Notification plugin is great, but its always using default notification sound. please add feature to custom notification sound each notification

Describe the solution you'd like
sound file may stored on res/raw (Android), so in pcl project just input the name of file in NotificationRequest

Describe alternatives you've considered

Additional context
thank you

cannot access ListenableFuture

Hi,

I am getting:

error: cannot access ListenableFuture public class ScheduledNotificationWorker class file for com.google.common.util.concurrent.ListenableFuture not found LocalNotifications.Android C:\Users\jrahm\Source\Repos\LocalNotifications\LocalNotifications\LocalNotifications.Android\obj\Debug\90\android\src\md50e8eea8286f69b03ef3779df0abd57a6\ScheduledNotificationWorker.java 4

Thanks,
Jassim

Handling notifications that caused the application start

I can use the NotificationTapped event to listen to notification interactions while the application is running, however, this event does not get fired when the App had to be started (was not running).

Consider the following scenario.

  1. I schedule a notification to be displayed in an hour.
  2. The user kills the application before the notification is displayed.
  3. The user taps the delayed notification.

When the application starts, I would like to be able to receive data of the notification that caused the application to start so I can i.e display the correct page.

Is that possible?

how to change notification icon in 2.0.7

I could not change notification icon in Xamarin.forms project.

There is option android in
var notification = new Plugin.LocalNotification.LocalNotification
{

                NotificationId = notification_id,
                Title = body,
                Description = body,
                ReturningData = "Dummy data", // Returning data when tapped on notification.
                                           
                NotifyTime = myDateTime
            };

Unable to install latest rc

Hi,

I am trying to install the latest v5.0.0-rc to my project but getting this error:

Package Plugin.LocalNotification 5.0.0-rc1 is not compatible with netstandard2.0 (.NETStandard,Version=v2.0). Package Plugin.LocalNotification 5.0.0-rc1 supports:

  • monoandroid90 (MonoAndroid,Version=v9.0)
  • netstandard2.1 (.NETStandard,Version=v2.1)
  • xamarinios10 (Xamarin.iOS,Version=v1.0)

Kindly help..

Thanks,
Jassim

Prevent sending message when device is off

Hi,

How can I prevent LocalNotification from sending the message when device is switched on again?

For example, here is my scenario..

I am sending a reminder for prayer time so the app is storing the times and scheduling the messages, let's say the next prayer is at 13:00 and before that the user has switched off his device, and he switched it on at 13:30, in this case I don't want the message to be sent because the time for the prayer is 13:00 so he should not get the message for that prayer

Android notification channel

Hi,

thank you for this great plugin and accepting the PR.

I'm still testing with the channel. When I change the description of the channel name, the settings are set back to default. The NotificationManager can retrieve the channel if it exists with GetNotificationChannel(string channelId).

I checked the android docs:

CharSequence name = getString(R.string.channel_name);
String description = getString(R.string.channel_description);
int importance = NotificationManager.IMPORTANCE_DEFAULT;
NotificationChannel channel = new NotificationChannel(CHANNEL_ID, name, importance);
channel.setDescription(description);
// Register the channel with the system; you can't change the importance
// or other notification behaviors after this
NotificationManager notificationManager = getSystemService(NotificationManager.class);
notificationManager.createNotificationChannel(channel);

Priority can't bet set for each NotificationRequest, it is only working for the first. I don't know what is better: Extend INotificationService with and AndroidCreateChannel Method and remove Priority and ChannelDescription from AndroidOptions, or creating the channel with the first NotificationRequest. With second option, the comment should be extended.

I'm wondering why the channel is recreate, when I change the channel description.

[Android] Scheduled Local Notifications are not shown on time

Describe the bug
I have a solution implementing scheduled local notifications. On Android notifications are sometimes delayed (0 - 40 seconds). What we need in our project to schedule local notification on specified time interval.

I created solution replicating this issue. This project schedules 2 notifications. The first one is scheduled after 60 seconds and second one 120.

To Reproduce
Steps to reproduce the behavior:

  1. Download and run LocalNotificationTestingFinal
  2. Click on the button bellow
  3. Observe countdown and how notifications are sometimes delayed

Expected behavior
Notifications should be triggered exactly on specified second time interval.

Screenshots
NA

Smartphone (please complete the following information):

  • Device: Sasmung S8
  • OS: Android 9
  • Version: API 28

Additional context
LocalNotificationTestingFinal.zip

Notification don't show after reboot

I implemented a JobScheduler to show notifications.
The notifications are nicely shown after I opened my app and the jobscheduler gets triggered.
When I minimize my app the job keeps processing and the notifications are shown.

After reboot my job is still triggered and processing, but the notifications are not shown and the
I added logcats to see if the job is working properly and everything seems fine.
Do I miss any special setting to allow showing notifications after the reboot?

No repeat interval.

there is no such a property which can be use to repeat a local notifications using this plugin.
For Example: If i want to set a schedule for Monday and Tuesday 5 pm and want to get notification every Monday and Tuesday of each week on Same time till I cancel the local notification than there is no scope to do that using this plugin.

Xamarin.Forms' Android doesn't compile with R8/ProGuard active in Release mode

Describe the bug
Xamarin.Forms' Android doesn't compile with R8/ProGuard active in Release mode.

To Reproduce
Steps to reproduce the behavior:

  1. Activate R8/ProGuard with plugin installed and try to compile.

Expected behavior
Successful compilation.

Platform:

  • OS: Windows 10
  • Visual Studio 2019

Smartphone:

  • Device: Tested on Emulator and Samsung A5 2017
  • OS: Android
  • Version 9.0 and 8.0, respectively

Additional context
Error when R8 active: Compilation can't be completed because some library classes are missing.
Error when ProGuard active: "java.exe" exited with code 1

It builds normally when no code reducer is selected.
Haven't tested on Debug mode (where code reducer is useless).

NotifyNotificationTapped is not found

Hello,

I have this error on the project Xamarin.Froms.Android :

Error CS0117: 'NotificationCenter' does not contain a definition for 'NotifyNotificationTapped' (CS0117)

Does this come from the plugin or an implementation error?

[Android] Exception thrown 'java.lang.NoSuchMethodError' on calling notificationService.Show(notification);

Hi there using your plugin with XF 3.4 and target android API level 28, minimum API level 21.

I am getting the following exception:

referenceTable head length=54 111-30 18:09:52.458 F/art ( 5985): art/runtime/check_jni.cc:65] JNI DETECTED ERROR IN APPLICATION: JNI CallObjectMethodA called with pending exception 'java.lang.NoSuchMethodError' thrown in void mono.java.lang.RunnableImplementor.n_run():-2

I am calling this:

ILocalNotificationService notificationService = DependencyService.Get();
LocalNotification notification = new Plugin.LocalNotification.LocalNotification
{
NotificationId =1,
Title = "Title",
Description = "Description",
ReturningData = 1.ToString(), // Returning data when tapped on notification.
NotifyTime = DateTime.Now.AddSeconds(2) // Used for Scheduling local notification.
};
notificationService.Show(notification);

Exception thrown on the code in bold. Not sure what the issue is, pluggin installed in both Forms and android project...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.