The push bridge registers and unregisters for push, gives the page the token and tags, raises token events, and can hand push payloads to the page or background.js. It’s backed by Shiny.Push.
Android, iOS, Mac Catalyst, macOS and Windows. Linux has no push and answers 501.
dotnet add package Shiny.AppDeviceBridge.Push
builder. UseAppDeviceBridge (
bridge => bridge. AddPushBridge ( o => o.DispatchToWebApp = true ),
Client
C#
TypeScript
IPushBridge
AddPushBridgeClient()
PushBridge
The platform setup is Shiny.Push’s: the aps-environment entitlement and the remote-notification background mode on
Apple platforms, google-services.json on Android. How payloads reach background.js is on
Native Calls & Background .
import { PushBridge } from "@shinyorg/appdevicebridge" ;
const push = new PushBridge ();
await push. onToken ( t => sendToServer (t.token)); // the token can change; keep your server current
await push. onReceived ( p => toast (p.title, p.message)); // while the page is open
const status = await push. register ();
if (status.token) await sendToServer (status.token);
The provider issued a new token.
C# IPushBridge.OnTokenAsyncTS PushBridge.onToken
Payload PushTokenEvent The device was unregistered.
C# IPushBridge.OnUnregisteredAsyncTS PushBridge.onUnregistered
Payload PushTokenEvent A push arrived. Raised only when the app hands pushes to the web app.
C# IPushBridge.OnReceivedAsyncTS PushBridge.onReceived
Payload PushPayload dataRecord < ;string , string > ;The push's data fields. titlestring | null The visible notification's title, when the push carried one. messagestring | null The visible notification's body, when the push carried one.
The user opened the app from a push. Raised only when the app hands pushes to the web app.
C# IPushBridge.OnEntryAsyncTS PushBridge.onEntry
Payload PushPayload dataRecord < ;string , string > ;The push's data fields. titlestring | null The visible notification's title, when the push carried one. messagestring | null The visible notification's body, when the push carried one.
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.
Push permission and registration.
accessAccessState Whether the app may receive pushes. tokenstring | null The provider's token — what a server sends to. Null until registered. nativeTokenstring | null The platform's own token (APNs, FCM) where it differs from token.
Where a permission stands. Reported by every bridge that needs one; the names match Shiny's own.
"Unknown""NotSupported""NotSetup""Disabled""Restricted""Denied""Available"
The tags a device is registered with.
A token that was issued or unregistered.
A push as the web app sees it.
dataRecord < ;string , string > ;The push's data fields. titlestring | null The visible notification's title, when the push carried one. messagestring | null The visible notification's body, when the push carried one.
These routes sit under AppDeviceBridgePolicies.Bridges like every other bridge: callers on this device by default.
See Security .