The notifications bridge sends local notifications now, on a schedule, repeating or at a geofence, lists and cancels pending ones, sets the badge and manages channels. A tap reaches the page while it is open. It’s backed by Shiny.Notifications.
Android, iOS, Mac Catalyst, macOS, Windows, and Linux through Shiny.Notifications.Linux.
dotnet add package Shiny.AppDeviceBridge.Notifications
builder . UseAppDeviceBridge (
bridge => bridge . AddNotificationsBridge (),
Client
C#
TypeScript
INotificationsBridge
AddNotificationsBridgeClient()
NotificationsBridge
What send takes, and how taps reach the page, is on Native Calls & Background .
import { NotificationsBridge } from "@shinyorg/appdevicebridge" ;
const notifications = new NotificationsBridge () ;
await notifications . requestAccess ( { timeSensitive : false } ) ;
const { id } = await notifications . send ( {
message : "Table 12 is up" ,
scheduleDate : new Date (Date . now () + 60_000 ) ,
await notifications . onEntry ( n => navigate ( `/orders/ ${ n . data . order } ` )) ; // the user tapped it
await notifications . setBadge ( { value : 3 } ) ;
A channel can carry action buttons. requiresUnlock makes the user unlock the device before the action runs — use it
for actions with a real-world effect, such as opening a garage door. It applies on iOS, Mac Catalyst and macOS, and on
Android 12 and later; older Android versions run the action without asking, and Windows and Linux ignore it.
await notifications . addChannel ( {
{ identifier : "open" , title : "Open Garage" , actionType : "OpenApp" , requiresUnlock : true },
{ identifier : "dismiss" , title : "Dismiss" , actionType : "Destructive" , requiresUnlock : false }
The tapped action reaches notification.entry as action.
GET /_bridge/ notificationsPermission and what this platform supports. POST /_bridge/ notifications/accessRequests permission, optionally for time-sensitive and location-aware notifications too. POST /_bridge/ notifications/sendSends or schedules a notification. GET /_bridge/ notifications/pendingScheduled notifications that have not been shown yet. DELETE /_bridge/ notificationsCancels pending notifications, clears displayed ones, or both. DELETE /_bridge/ notifications/{id} Cancels one notification. GET /_bridge/ notifications/badgeThe app icon's badge number. PUT /_bridge/ notifications/badgeSets the app icon's badge number, 0–99,999. GET /_bridge/ notifications/channelsThe notification channels. POST /_bridge/ notifications/channelsAdds or replaces a channel. DELETE /_bridge/ notifications/channels/{identifier} Removes a channel. GET /_bridge/ notifications# Permission and what this platform supports.
C# INotificationsBridge.GetStatusAsyncTS NotificationsBridge.getStatus
Response 200 NotificationStatus NotificationStatus · 6 fields accessAccessState badgeboolean Whether the app badge can be read and set. entryboolean Whether taps are reported. receivedboolean Whether notifications arriving while the app is open are reported. geofencesboolean Whether a notification can wait for the device to enter an area. imagesboolean Whether a notification can carry an image.
POST /_bridge/ notifications/access# Requests permission, optionally for time-sensitive and location-aware notifications too.
C# INotificationsBridge.RequestAccessAsyncTS NotificationsBridge.requestAccess
Body application/json · NotificationAccessRequest NotificationAccessRequest · 2 fields timeSensitiveboolean locationAwareboolean
Response 200 NotificationAccessResult NotificationAccessResult · 1 field POST /_bridge/ notifications/send# Sends or schedules a notification. Fails with 400 for an invalid one, such as a date already past.
C# INotificationsBridge.SendAsyncTS NotificationsBridge.send
Body application/json · NotificationRequest NotificationRequest · 12 fields messagestring At most 4,000 characters. titlestring | null subtitlestring | null idnumber | null Replaces a notification with the same id; assigned when null. channelstring | null An Android channel identifier. threadstring | null Groups notifications together. badgeCountnumber | null scheduleDateDate | string | null Show it then rather than now. repeatNotificationRepeat | null geofenceNotificationGeofence | null imageBridgeFile | null A .png, .jpg, .gif or .heic of at most 10 MB in a file root. dataRecord < ;string , string > ; | null Comes back on the tap.
Response 200 NotificationSent NotificationSent · 1 field Errors 400 Bad requestGET /_bridge/ notifications/pending# Scheduled notifications that have not been shown yet.
C# INotificationsBridge.GetPendingAsyncTS NotificationsBridge.getPending
Response 200 PendingNotification []PendingNotification · 11 fields idnumber titlestring | null messagestring | null channelstring | null threadstring | null badgeCountnumber | null scheduleDatestring | null repeatNotificationRepeat | null geofenceNotificationGeofence | null fromWebAppboolean Whether the web app sent it, rather than the native app. dataRecord < ;string , string > ;
DELETE /_bridge/ notifications# Cancels pending notifications, clears displayed ones, or both.
C# INotificationsBridge.CancelAllAsyncTS NotificationsBridge.cancelAll
Response 204 No contentDELETE /_bridge/ notifications/{id} # Cancels one notification.
C# INotificationsBridge.CancelAsyncTS NotificationsBridge.cancel
Parameter In Type idpath number required
Response 204 No contentGET /_bridge/ notifications/badge# The app icon's badge number.
C# INotificationsBridge.GetBadgeAsyncTS NotificationsBridge.getBadge
Response 200 NotificationBadge NotificationBadge · 1 field PUT /_bridge/ notifications/badge# Sets the app icon's badge number, 0–99,999.
C# INotificationsBridge.SetBadgeAsyncTS NotificationsBridge.setBadge
Body application/json · NotificationBadge NotificationBadge · 1 field Response 204 No contentGET /_bridge/ notifications/channels# The notification channels.
C# INotificationsBridge.GetChannelsAsyncTS NotificationsBridge.getChannels
Response 200 NotificationChannel []NotificationChannel · 5 fields POST /_bridge/ notifications/channels# Adds or replaces a channel.
C# INotificationsBridge.AddChannelAsyncTS NotificationsBridge.addChannel
Body application/json · NotificationChannel NotificationChannel · 5 fields Response 200 NotificationChannel NotificationChannel · 5 fields DELETE /_bridge/ notifications/channels/{identifier} # Removes a channel.
C# INotificationsBridge.RemoveChannelAsyncTS NotificationsBridge.removeChannel
Parameter In Type identifierpath string required
Response 204 No content
The user tapped a notification, or one of its actions.
C# INotificationsBridge.OnEntryAsyncTS NotificationsBridge.onEntry
Payload NotificationEvent idnumber titlestring | null messagestring | null channelstring | null threadstring | null dataRecord < ;string , string > ;actionstring | null The action chosen, when the user picked one rather than the notification itself. textstring | null What the user typed, for a text reply action.
EVENT notification.received# A notification arrived while the app was open. Apple platforms only.
C# INotificationsBridge.OnReceivedAsyncTS NotificationsBridge.onReceived
Payload NotificationEvent idnumber titlestring | null messagestring | null channelstring | null threadstring | null dataRecord < ;string , string > ;actionstring | null The action chosen, when the user picked one rather than the notification itself. textstring | null What the user typed, for a text reply action.
JSON property names are camelCase and enums travel as their names. A ? marks a property the payload may omit;| null one that may be null.
NotificationStatusobject # accessAccessState badgeboolean Whether the app badge can be read and set. entryboolean Whether taps are reported. receivedboolean Whether notifications arriving while the app is open are reported. geofencesboolean Whether a notification can wait for the device to enter an area. imagesboolean Whether a notification can carry an image.
Where a permission stands. Reported by every bridge that needs one; the names match Shiny's own.
"Unknown""NotSupported""NotSetup""Disabled""Restricted""Denied""Available"
NotificationAccessRequestobject # timeSensitive?boolean locationAware?boolean
NotificationAccessResultobject # NotificationRequestobject # A notification to send.
messagestring At most 4,000 characters. title?string | null subtitle?string | null id?number | null Replaces a notification with the same id; assigned when null. channel?string | null An Android channel identifier. thread?string | null Groups notifications together. badgeCount?number | null scheduleDate?Date | string | null Show it then rather than now. repeat?NotificationRepeat | null geofence?NotificationGeofence | null image?BridgeFile | null A .png, .jpg, .gif or .heic of at most 10 MB in a file root. data?Record < ;string , string > ; | null Comes back on the tap.
NotificationRepeatobject # A repeating schedule: every intervalSeconds, or at timeOfDay, optionally on one day.
intervalSecondsnumber | null timeOfDaystring | null dayOfWeek(" ;Sunday " ; | " ;Monday " ; | " ;Tuesday " ; | " ;Wednesday " ; | " ;Thursday " ; | " ;Friday " ; | " ;Saturday " ;) | null
NotificationGeofenceobject # Show the notification when the device enters an area.
latitudenumber longitudenumber radiusMetersnumber repeatboolean
A file the page can reach through the files bridge: a named root and a path inside it. Bridges that take or return a file use this, so nothing reaches the page that /_bridge/files would not also serve.
PendingNotificationobject # idnumber titlestring | null messagestring | null channelstring | null threadstring | null badgeCountnumber | null scheduleDatestring | null repeatNotificationRepeat | null geofenceNotificationGeofence | null fromWebAppboolean Whether the web app sent it, rather than the native app. dataRecord < ;string , string > ;
NotificationCancelScopeenum # "All""Pending""Displayed"
NotificationChannelobject # "Low""Normal""High""Critical"
"None""Default""High""Custom"
NotificationChannelActionobject # identifierstring titlestring actionTypeChannelActionType requiresUnlockboolean The device must be unlocked before the action runs — for actions with a real-world effect, such as "Open Garage". Combines with any ChannelActionType. Apple: always. Android: 12 (API 31) and later; older versions run the action without asking. Ignored on Windows and Linux.
"TextReply""Destructive""OpenApp""None"
A notification the user tapped or that arrived while the app was open.
idnumber titlestring | null messagestring | null channelstring | null threadstring | null dataRecord < ;string , string > ;actionstring | null The action chosen, when the user picked one rather than the notification itself. textstring | null What the user typed, for a text reply action.
These routes sit under AppDeviceBridgePolicies.Bridges like every other bridge: callers on this device by default.
See Security .