TsgcWSAPIServer_WebPush

TsgcWSAPIServer_WebPush component.

Introduction

TsgcWSServer_API_WebPush is a component that provides functionality for handling WebPush subscriptions. WebPush is a protocol for delivering real-time notifications to web applications that run in the browser. This component can be used to manage subscriptions and send notifications to subscribed clients. Find below the properties, events, and methods provided by TsgcWSServer_API_WebPush class, along with code examples that demonstrate how to use them.

 

Configuration

  1. Attach a TsgcWSServer_API_WebPush to a WebSocket server using the Server property.
  2. Configure the public and private keys in the WebPush.VAPID property. (Registered users can download an executable that generates the VAPID keys for windows).
  3. Requires deploying the OpenSSL 3.0.0 version
  4. In the WebPush.Endpoints property you can define your own endpoints to handle the WebPush subscriptions; by default, accessing the "/sgcWebPush.html" endpoint will show a simple webpage that allows you to subscribe to the WebPush notifications.
  5. Start the server and access the endpoint configured to test it.

 

Reference