DexieCloudNETPushServer is a helper application that supports WebPush messages in a DexieCloudNET based solution.
The PushServer will use the Dexie Cloud REST API to communicate with any database in a solution agnostic way. The best way to set up your own PushServer is with Docker. Create a Docker image using the buildPushServer.sh script. Make sure --platform matches your desired architecture.
Setting up the app's secrets is a two-step process:
- map any local directory to /pushserver/database/
- Place a secrets.json file inside the mounted directory with the following content
{
"Databases": [
{
"url": "your dexie cloud database url",
"clientId": "your dexie cloud client id",
"clientSecret": "your dexie cloud client secret"
}
],
"VapidKeys": {
"publicKey": "Your Vapid public key",
"privateKey": "your Vapid private key"
}
}
- Add a property to dexie-cloud.json or any other settings file with the vapid public key, e.g.
{
"serviceUrl": "https://dexie.cloud",
"dbUrl": "your dexie cloud database url",
"applicationServerKey": "your Vapid public key"
}
In any case, the vapid public key must be added when configuring the cloud database.
public static async Task ConfigureCloud(this DBBase dexie, DexieCloudOptions cloudOptions,
string? applicationServerKey = null)
See the DexieNETCloudSample for more information.
To enable push support, do the following:
- add the DBAddPushSupport attribute to your *IDBStore
- Store push information in your database like this AddPushNotification