shinyorg/shiny/shiny-push
Claude Code and agent skill by shinyorg/shiny
- community
Checking that the SKILL.md file is still in the repository.
Guide for implementing push notifications in .NET MAUI apps using Shiny.Push (native FCM/APNs) and Shiny.Push.AzureNotificationHubs
Install
npx vskill@latest install shinyorg/shiny/shiny-pushSKILL.md
The same SKILL.md was published earlier as shinyorg/shiny/shiny-push.
Shiny Push Notifications
When to Use This Skill
Use this skill when the user needs to:
- Register for push notifications on iOS (APNs) or Android (FCM)
- Handle incoming push notifications (foreground and background)
- Handle push notification tap/entry events
- Manage push notification tags/topics
- Integrate Azure Notification Hubs as a push provider
- Implement a custom push delegate
- Configure Firebase for Android push
- Request push notification permissions
- Unregister from push notifications
- Customize Apple foreground notification presentation
- Build and display Android notifications from push data
- Show an image with a push (iOS notification service extension, Android big picture)
Library Overview
| Item | Value | |
|---|---|---|
| NuGet (Native Push) | Shiny.Push | |
| NuGet (Azure NH) | Shiny.Push.AzureNotificationHubs | |
| Primary Namespace | Shiny.Push | |
| Config Namespace | Shiny (extension methods on IServiceCollection) | |
| Platforms | iOS (APNs), tvOS (APNs, silent/badge only), Android (FCM), Windows (WNS), Blazor WebAssembly (Web Push / VAPID, in the same Shiny.Push package's net11.0 build) |
tvOS
tvOS registers with APNs and delivers silent (background) pushes exactly as iOS does — IPushDelegate.OnReceived fires and token handling is identical. What tvOS does not have is a notification a user can see or tap:
UNNotificationContenton tvOS carries only a badge count — no title, no body, no user info.- There is no
UNNotificationResponse, so `IPushDelegate.OnEntry` is never raised on tvOS and nothing is presented in the foreground. Never generate tvOS code or guidance that relies onOnEntryor on a user tapping a push. RequestAccess()requestsUNAuthorizationOptions.Badgealone on tvOS. Do not pass Alert or Sound to theRequestAccess(UNAuthorizationOptions)overload there — they do nothing.IApplePushDelegate.GetPresentationOptionsis never called on tvOS.
Treat a tvOS push as a signal to go fetch data, not as a message to read.
Setup
Native Push (FCM on Android, APNs on iOS)
Register in your MauiProgram.cs:
On Android, this uses FirebaseConfig with embedded google-services.json by default. To provide Firebase values manually:
Blazor WebAssembly (Web Push)
There is no separate Blazor package - Shiny.Push's net11.0 build carries the Web Push backend (BrowserPushManager). Never reference Shiny.Push.Blazor; it was merged into Shiny.Push in v6.
- Requires HTTPS (or
localhost), a VAPID key pair (send pushes from the backend with the private key), and the service worker. To use your own service worker,importScripts('./_content/Shiny.Push/push-sw.js')from it and pointServiceWorkerPathat yours. - Safari only allows subscribing from an installed PWA.
Tagsis alwaysnullon the browser.
Azure Notification Hubs
Supports iOS, Mac Catalyst, macOS and tvOS (APNs), Android (FCM v1), and Windows (WNS) via a single registration call. A hub's APNs settings carry one bundle ID (the APNs topic), so a macOS or tvOS app with its own bundle ID needs its own hub; on tvOS send silent or badge-only payloads.
On Android with custom Firebase config:
Push Images
The push carries an image URL; Shiny reports it as PushNotification.Notification.ImageUri on every platform.
iOS shows an image only through a Notification Service Extension. Shiny builds one during dotnet build - never generate an Xcode project, a separate extension csproj, or C# UNNotificationServiceExtension code:
- The push must have
"mutable-content": 1inapsand an alert, or iOS never runs the extension (silent pushes never do). - Default keys:
image,image-url,imageUrl,attachment-url,fcm_options.image(Firebase'sapns.fcm_options.image). - The URL must be https (or the extension's ATS must allow the host -
ShinyPushServiceExtensionInfoPlistmerges a plist
with NSAppTransportSecurity into the extension). Max 10 MB (ShinyPushImageMaxBytes). For a private image send a short-lived signed URL; the extension sends no auth headers.
- The extension is Swift only (iOS gives it ~24 MB / 30 s) - your
IPushDelegatecode does not run in it. - Device builds need a provisioning profile for
$(ApplicationId).NotificationService(override with
ShinyPushServiceExtensionBundleId / ShinyPushServiceExtensionCodesignProvision). Built on macOS only.
- Own logic:
<ShinyPushServiceExtensionSource Include="MyService.swift" />replaces the stock Swift; set
ShinyPushServiceExtensionPrincipalClass to its @objc(...) class name.
- Mac Catalyst / macOS: no extension is built.
Android: FCM shows a notification message's notification.image itself while the app is in the background. In the foreground (or for a data message with an image data key), show it from the delegate:
Web Push (Blazor): the bundled service worker shows the payload's image (Chromium) and reports it as ImageUri.
Server: with Shiny.Extensions.Push set PushNotification.ImageUrl - it adds mutable-content + image for APNs and notification.image for FCM in one send.
LoadImageAsync() returns the scaled Bitmap for a builder of your own; FirebaseConfig.ImageKeys changes the data keys. A failed image download never throws - the notification goes out without it.
Code Generation Instructions and Conventions
- Always implement `IPushDelegate` (or subclass
PushDelegate) to handle push events. Register it as a generic type parameter onAddPush<T>()orAddPushAzureNotificationHubs<T>().
- Request access before using push. Call
IPushManager.RequestAccess()and checkPushAccessState.Status == AccessState.Availablebefore assuming push is working.
- Use `PushAccessState.Assert()` when you want to throw on denied/restricted permissions rather than checking the status manually.
- Multiple delegates are supported. You can register multiple
IPushDelegateimplementations; all will be called. Register additional delegates as keyed/standard services viaservices.AddSingleton<IPushDelegate, MyOtherPushDelegate>()or tag the class with[Singleton]fromShiny.Extensions.DependencyInjection.
A revoked permission unregisters the device at the next app start, not live. When a device that registered starts with notifications turned off (iOS/macOS authorization Denied; Android notifications disabled or POST_NOTIFICATIONS revoked on 13+), Shiny runs the same path as UnRegister(): the provider unregisters (e.g. the ANH installation is deleted), OnUnRegistered(oldToken) fires and RegistrationToken / NativeRegistrationToken become null. Put "stop targeting this device" server calls in OnUnRegistered. A timeout or Restricted keeps the registration. Once the user turns notifications back on, the app must call RequestAccess() again - it registers and raises OnNewToken.
- Apple-specific customization:
- Cast
IPushManagertoIApplePushManagerfor customUNAuthorizationOptions. - Implement
IApplePushDelegate(extendsIPushDelegate) to control foreground presentation options and background fetch results. - On iOS,
PushNotificationmay be anApplePushNotificationwith access to the rawNSDictionarypayload.
- Android-specific customization:
PushNotificationreceived inOnReceivedmay be anAndroidPushNotificationwith access to the nativeRemoteMessage.- Use
AndroidPushNotification.CreateBuilder()to build aNotificationCompat.Builderfrom the push data. - Use
AndroidPushNotification.SendDefault(notificationId)for quick notification display, orSendDefaultAsync(notificationId)/CreateBuilderAsync()to include the push image. - Configure
FirebaseConfig.DefaultChannelto set a defaultNotificationChannel. - Configure
FirebaseConfig.IntentActionto set a custom intent action for notification taps. OnEntryruns once per tap - not again when the activity is recreated (rotation) or reopened from recents.
Windows: a device that registered reopens its WNS channel at app startup (a no-prompt RequestAccess), so foreground pushes arrive again after a restart and an expired channel URI reaches the provider and OnNewToken.
- Tags/Topics:
- Check
IPushManager.Tags != null(or usepushManager.IsTagsSupport()) before using tag operations. - Native Firebase on Android supports tags via FCM topic subscriptions.
- Azure Notification Hubs supports tags via installation tags.
- Use extension methods
TrySetTags,TryGetTags,TryRequestAccessWithTagsfor safe tag operations.TryRequestAccessWithTagsonly applies the tags when access isAvailable. - Native Firebase topics are persisted across app restarts, so
ClearTags/SetTagsunsubscribe topics set in an earlier session. - Azure Notification Hubs: tags set before
RequestAccess(or afterUnRegister) are kept locally and sent with the next registration instead of throwing.
- Azure Notification Hubs specifics:
- Implement
IPushInstallationEventto modify theInstallationobject (add templates, tags) before it is sent to ANH. - Use
AzureNotificationConfig.BeforeSendInstallationcallback as an alternative toIPushInstallationEvent. AzureNotificationConfig.ExpirationTimecontrols token expiration. EachRequestAccessor tag update bumps expiration.AzureNotificationConfig.AzureAuthenticationWaitTimeMs(default 1000ms) adds a delay after registration to allow ANH propagation.
- Namespace conventions: Extension methods on
IServiceCollectionlive in theShinynamespace. All push types live inShiny.Push.
- Do NOT reference platform-specific types (e.g.,
AndroidPushNotification,ApplePushNotification,IApplePushManager,IApplePushDelegate,FirebaseConfig) in shared/cross-platform code. Guard them with#if ANDROID/#if APPLEpreprocessor directives or use runtime platform checks.
Namespace Ambiguities
This is the start of the file. Read the full SKILL.md on GitHub.
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-push/SKILL.md
Popularity
- Repository stars
- 1,583
- Repository forks
- 248
- 7-day trend score
- 37
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-push)