*foreground-notification
This is an Android-only, Google-independent alternative. For ordinary Android notifications, FCM through *push is the standard recommendation. This adapter starts a native foreground service and maintains a WebSocket to the application's own server. The service displays the Android-required ongoing notification and converts accepted WebSocket messages into local notifications. It does not run Sercrod or the WebView in the background.
Your WebSocket server
→ Android native foreground service
→ local system notification
→ user taps
→ application UI opens
Directives
*foreground-notification/.start: start the service with aws://orwss://URL..stop: close the connection and stop the service..status: read running, connected, last-message, and last-error state..check-permissions/.request-permissions: manage notification permission.
<button *foreground-notification.request-permissions>Allow</button>
<button *foreground-notification.start="{ url: 'wss://example.com/events' }">Start</button>
<button *foreground-notification.status *response="'status'">Status</button>
<button *foreground-notification.stop>Stop</button>
Server message
{ "notification": { "id": 1001, "title": "New message", "body": "Open the app" } }
Use authenticated wss:// in production. The sample plugin reconnects with bounded exponential delay and uses a low-frequency WebSocket ping.
Limits and responsibility
This is not available on iPhone and does not replace APNs there. Android may stop or restrict the service, and public-store distribution requires a legitimate declared foreground-service use that satisfies current policy. The developer owns the server, authentication, message validation, resource usage, privacy, and delivery policy.