-
Notifications
You must be signed in to change notification settings - Fork 73
Frequently Asked Questions
Q: Scheduled notifications aren't showing up for short intervals
A: This is often related to battery optimization settings. Ensure that:
- Battery Optimization is disabled for your app
- 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
Q: No platform plugin found error
A: Ensure that:
- The NuGet package is installed in your app project
- 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.
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>Q: No sound playing with notifications
A: Check the following:
- Device's notification volume settings
- Vibration intensity settings
- Note: On iOS, notification sounds only play when the app is not in the foreground
Q: Do notifications need to be manually cancelled?
A: Generally, no, but there are exceptions:
- On Android, if
NotificationRequest.Android.AutoCancelis set tofalse, 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:
- The newer notification replaces the older one
- To show multiple notifications simultaneously, use different ID ranges
- 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.
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
- Always check notification permissions before showing notifications
- Use unique notification IDs for different notification types
- Consider battery optimization impacts when scheduling notifications
- Test notifications in both foreground and background states
- Implement proper error handling for notification operations
If your issue isn't covered here:
- Check the GitHub Issues
- Create a new issue with:
- Detailed description of the problem
- Steps to reproduce
- Platform and version information
- Code samples if applicable