shinyorg/shiny/shiny-notifications
Claude Code and agent skill by shinyorg/shiny
- community
Checking that the SKILL.md file is still in the repository.
Cross-platform local notification management for .NET MAUI apps using Shiny, supporting scheduled, repeating, and geofence-triggered notifications with channels, badges, and interactive actions.
Install
npx vskill@latest install shinyorg/shiny/shiny-notificationsSKILL.md
The same SKILL.md was published earlier as shinyorg/shiny/shiny-notifications.
Shiny Notifications
When to Use This Skill
Use this skill when the user needs to:
- Send local notifications (immediate, scheduled, repeating, or geofence-triggered)
- Manage notification channels with importance levels, sounds, and actions
- Handle notification tap responses and interactive action buttons
- Request notification permissions on iOS and Android
- Manage app icon badge counts
- Configure platform-specific notification behavior (Android ongoing, iOS subtitles, etc.)
Library Overview
| Item | Value | |
|---|---|---|
| NuGet Package | Shiny.Notifications (iOS, Mac Catalyst, Android, macOS, Windows); Shiny.Notifications.Linux (Linux) | |
| Primary Namespace | Shiny.Notifications | |
| Registration Namespace | Shiny (extension methods on IServiceCollection) | |
| Platforms | iOS, Mac Catalyst, Android, macOS, Windows, Linux | |
| Dependencies | Shiny.Core, Shiny.Geofencing (Android only - geofence-triggered notifications), Shiny.Support.Repositories |
Linux
Linux notifications ship in a separate package, Shiny.Notifications.Linux. They are delivered via the freedesktop org.freedesktop.Notifications D-Bus service (GNOME, KDE, XFCE, etc.) and support the same INotificationManager API surface as the other platforms. Scheduled notifications are tracked in-process only — there is no OS-level scheduler like BGTaskScheduler or WorkManager, so the host process must be running for a scheduled notification to fire. Scheduled and repeating notifications are checked every 30 seconds, so expect up to ~30s of lateness. IntervalTrigger.Interval repeats every interval from the Send call; IntervalTrigger.TimeOfDay is local time and fires today if that time is still ahead, otherwise the next day (or next matching DayOfWeek). Clicking the notification or one of its actions raises INotificationDelegate.OnEntry. Channels are exposed but only a subset of freedesktop hints (urgency, category, image) are actually honoured by most daemons. Geofence triggers and time-sensitive flags are not applicable.
Register with services.AddNotifications<TDelegate>(); from the Shiny namespace — the same call site as the other platforms.
Setup
Register the notification services in your MauiProgram.cs:
On iOS, you can optionally pass an IosConfiguration to control authorization and presentation options:
Code Generation Instructions
When generating code that uses Shiny Notifications, follow these conventions:
- Always request access before sending notifications:
``csharp var access = await notificationManager.RequestAccess(); if (access != AccessState.Available) { // Handle denied permission return; } ``
- Use `AccessRequestFlags` when the notification uses triggers:
AccessRequestFlags.TimeSensitivityfor scheduled or repeating notifications.AccessRequestFlags.LocationAwarefor geofence-triggered notifications.- Or use the
RequestRequiredAccessextension method that infers flags from the notification object.
- A `Notification` must have a `Message` set -- validation will throw otherwise.
- Only one trigger type per notification -- you cannot mix
ScheduleDate,RepeatInterval, andGeofenceon the same notification.
- Implement `INotificationDelegate` for handling user taps:
``csharp public class MyNotificationDelegate : INotificationDelegate { public async Task OnEntry(NotificationResponse response) { // response.Notification -- the original notification // response.ActionIdentifier -- which action button was pressed // response.Text -- text reply if action was TextReply type } } ``
- Create channels before sending notifications that reference them:
``csharp notificationManager.AddChannel(new Channel { Identifier = "alerts", Importance = ChannelImportance.High, Sound = ChannelSound.High }); ``
- Use the convenience `Send` extension for simple notifications:
``csharp await notificationManager.Send("Title", "Message body"); ``
- For platform-specific properties, use the native subclasses:
- Android:
AndroidNotificationandAndroidChannel - iOS:
AppleNotificationandAppleChannel
- Always inject `INotificationManager` via constructor injection -- never create instances directly.
- Show an image with `ImageUri` - an https URL, a
file://URI or a local path. Never build
UNNotificationAttachments or BigPictureStyle by hand for this: ``csharp await notificationManager.Send(new Notification { Title = "Your order shipped", Message = "Arriving Thursday", ImageUri = "https://cdn.example.com/orders/1234.jpg", ScheduleDate = DateTimeOffset.Now.AddHours(1) }); ` It is downloaded/copied when Send runs (so a scheduled notification needs no network when it fires, and shows the image as it was at send time). A failed download is logged and the notification still goes out without it. iOS/macOS attach it (JPEG/PNG/GIF/HEIC, max 10 MB), Android shows a big picture plus large icon (it replaces UseBigTextStyle), Windows uses it as the toast's hero image; Linux ignores it. The source file is never moved. For an image that needs auth, download it yourself and pass the local path. For push images see the shiny-push` skill.
- Use `CancelScope` wisely when cancelling:
CancelScope.DisplayedOnly-- clears only shown notifications.CancelScope.Pending-- clears only scheduled/triggered notifications.CancelScope.All-- clears everything (default).
Namespace Ambiguities
- `Notification`: Both
Shiny.NotificationsandShiny.Pushdefine aNotificationtype. If both packages are referenced in the same project, do NOT add both namespaces as global usings. UseShiny.Notifications.NotificationFQN or a file-levelusing Shiny.Notifications;directive to disambiguate.
Best Practices
- Always check the
AccessStateresult before attempting to send notifications. - Use channels to group notifications by category (e.g., "alerts", "reminders", "messages").
- The default channel (
Channel.Default) always exists withIdentifier = "Notifications"andChannelImportance.Low. - Do not remove the default channel -- the library will throw an
InvalidOperationException. - Set
ChannelAction.RequiresUnlock = true(orChannelAction.Create(id, title, type, requiresUnlock: true)) for any action with a real-world effect ("Open Garage", "Disarm") - otherwise it runs straight from the lock screen. It combines with anyChannelActionType; do not useOpenAppjust to force an unlock. Honoured on iOS/Mac Catalyst/macOS and Android 12+ (API 31); older Android runs the action without prompting, and Windows/Linux ignore it. - Set
BadgeCountonly on immediate notifications (not triggered ones) -- validation will fail otherwise. - Use
IntervalTriggerwith eitherInterval(raw TimeSpan) orTimeOfDay(daily/weekly recurring), never both.TimeOfDayis local time (the device time zone, DST-aware) and fires today if that time is still ahead, otherwise the next day or next matchingDayOfWeek- on every platform. A repeatingIntervalmust be at least 1 minute on iOS/Mac Catalyst/macOS (Sendthrows otherwise); Windows rounds it up to 1 minute. - Windows has no repeating toast: Shiny schedules the next 30 occurrences of a repeating notification and tops them up each time the app starts, so a short
Intervalruns out if the app is not opened. - Android sets scheduled/repeating notification alarms again after a reboot (Shiny declares
RECEIVE_BOOT_COMPLETEDand listens forBOOT_COMPLETED); ones that came due while the device was off are shown at boot. - Windows does not deliver toast taps or actions to
INotificationDelegate.OnEntry. Linux does, through the daemon'sActionInvokedsignal: a body click arrives withActionIdentifier == null, a button with its action identifier (text replies are not supported there). - For geofence notifications, ensure
CenterandRadiusare both set onGeofenceTrigger. - On Android, create a drawable resource named
notificationfor the default small icon, or setSmallIconResourceNameonAndroidNotification. - Prefer the
RequestRequiredAccessextension method to automatically determine needed permission flags from aNotificationobject. - Use
Payloaddictionary onNotificationto pass custom data that you can read back in yourINotificationDelegate.OnEntry.
AI Tool Integration (Shiny.Notifications.Extensions.AI)
The optional Shiny.Notifications.Extensions.AI package exposes INotificationManager as reminder-framed Microsoft.Extensions.AI tool functions (AIFunctions) for LLM agents. You opt-in exactly which operations the model can see — a read/write allow-list you control on behalf of the agent (not an OS permission prompt; the platform notification permission must already be granted). Read-only by default; write is opt-in. AOT-compatible (hand-built schemas, JsonNode results — no reflection).
Key types:
AddNotificationAITools(Action<INotificationAIToolBuilder>)— DI extension; throws if nothing is added.INotificationAIToolBuilder—AddReminders(ReminderAICapabilities, string? channel = null). The channel (if supplied) must already be registered viaAddChannel.ReminderAICapabilities[Flags]—None,Read(default),Write,ReadWrite.NotificationAITools— resolve from DI;.ToolsisIReadOnlyList<AITool>.
Generated tools (only for opted-in capabilities): list_reminders (pending/scheduled), create_reminder (omit both scheduleFor/repeatDailyAt to send now, scheduleFor for a one-time reminder, repeatDailyAt "HH:mm" for a daily one), cancel_reminder (by id). scheduleFor and repeatDailyAt are mutually exclusive; dates are ISO-8601.
The AI tools assume permissions are already granted — they do not trigger the platform permission UI (needs a foreground activity). CallINotificationManager.RequestAccess(...)from the app before invoking the agent.
Combine with the app's own functions:Shiny.AppFunctions.Extensions.AI(AddAppFunctionAITools, see the shiny-appfunctions skill) exposes the[AppFunction]s Siri and Gemini call as tools in the same*AIToolsbundle shape - concatenate the.Toolslists into oneChatOptions.Tools.
Reference Files
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/shiny-notifications/SKILL.md
Popularity
- Repository stars
- 1,577
- Repository forks
- 246
- 7-day trend score
- 0
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/shinyorg/shiny/shiny-notifications)