Skip to content

Frequently Asked Questions

Elvin (Tharindu) Thudugala edited this page Aug 9, 2025 · 16 revisions

Frequently Asked Questions

Android-Specific Issues

Scheduled Notifications

Q: Scheduled notifications aren't showing up for short intervals

A: This is often related to battery optimization settings. Ensure that:

  1. Battery Optimization is disabled for your app
  2. Power usage optimizations are properly configured See Issue #251

Q: Scheduled notifications aren't showing exactly on time

A: This is by design in Android. The system may slightly delay notifications to optimize battery life. See Issue #37

Build and Configuration Issues

Q: No platform plugin found error

A: Ensure that:

  1. The NuGet package is installed in your app project
  2. Android Target Framework is set to Android 12+

Q: Error CS0117: 'NotificationCenter' does not contain 'NotifyNotificationTapped'

A: Update your Android Target Framework to Android 12+

Q: Vibration pattern isn't working

A: Vibration patterns must be set before creating the notification channel. You cannot modify them after channel creation.

Release Mode Issues

Q: App not working in release mode in .NET MAUI

A: Add this to your .csproj file to prevent the library from being trimmed:

<ItemGroup>
    <TrimmerRootAssembly Include="Plugin.LocalNotification" RootMode="library"/>
</ItemGroup>

Q: Compilation failure: androidx.collection.ArraySetKt is defined multiple times

A: The error is due to duplicate class definitions in two AndroidX libraries

Type androidx.collection.ArrayMapKt is defined multiple times:

collection-jvm.jar collection-ktx.jar

Solution:

<ItemGroup>
    <PackageReference Include="Xamarin.AndroidX.Fragment.Ktx" Version="1.8.6.2" />
</ItemGroup>

iOS-Specific Issues

Q: No sound playing with notifications

A: Check the following:

  1. Device's notification volume settings
  2. Vibration intensity settings
  3. Note: On iOS, notification sounds only play when the app is not in the foreground

General Questions

Q: Do notifications need to be manually cancelled?

A: Generally, no, but there are exceptions:

  • On Android, if NotificationRequest.Android.AutoCancel is set to false, you must cancel manually
  • You may want to cancel scheduled notifications that are no longer relevant

Q: What happens with duplicate notification IDs?

A: If two notifications use the same ID:

  1. The newer notification replaces the older one
  2. To show multiple notifications simultaneously, use different ID ranges
  3. Consider using a prefix system for different notification types

Q: Package installation fails with .NET Portable error

A: The plugin only supports:

  • .NET Standard 2.0/2.1
  • .NET MAUI
  • Xamarin.Forms (support ended May 1, 2024) It does not support Xamarin PCL projects.

Legacy Issues (Xamarin.Forms)

Q: ListenableFuture access error

A: This was resolved in Visual Studio 16.2.1 (Xamarin.Android 9.4.1.0) See Issue #27

Q: D8 build failure

A: This was a Xamarin.Android bug. See Android Support Components Issue #168

Best Practices

  1. Always check notification permissions before showing notifications
  2. Use unique notification IDs for different notification types
  3. Consider battery optimization impacts when scheduling notifications
  4. Test notifications in both foreground and background states
  5. Implement proper error handling for notification operations

Need More Help?

If your issue isn't covered here:

  1. Check the GitHub Issues
  2. Create a new issue with:
    • Detailed description of the problem
    • Steps to reproduce
    • Platform and version information
    • Code samples if applicable

Clone this wiki locally