I'm trying the demo of your new component and it's working well on my local pc. If I put the WebPushServer on a server (xcopy of the bin directory), it doesn't work. I got the message: "Got request from: /registerSubscription". When I click on "Send to all" nothing happens.
If I restart the program and click on "Send to all" button without registerSubscription , a popup windows show "Canno't load library Midas.dll'.
I've tried deleting the “Push.ini” file but it's never created. I've also tried deleting the “dataset.xml” file, but it too is never created.
Can you give me a way to debug this problem?
midas.dll: This is used by the underlying TClientDataSet that is created by the TTMSFNCWebPushDB when no datasource is assigned.
Normally you can find this in C:\Program Files (x86)\Embarcadero\Studio\23.0\Redist\win32 (or win64 if that's what you targeted)
dataset.xml: This is the file created by the internal TClientDataSet to store the notifications and it will be created automatically when the internal dataset is being persisted at application shutdown.
push.ini: It is only created when the server (or sender) needs a key and doesn't have any yet.
server: when the VAPID key is requested by the web client application
sender: when a push message is being sent (and not failed due to missing DLLs)
Other things to consider and understand
Why did you get /registerSubscription without /vapidPublicKey:
Your browser stores the active subscription for a given page in the PushManager. It won't register with the push service again, until the current subscription is available (= no unsubscribe was called on it and it did not expire). This means you'll need the VAPID key it was registered with to send notifications to it. You can unsubscribe first (and reload the page after) to clear the VAPID key from the demo application.
HTTPS:
If your web application is served via HTTPS, you'll need to provide a certificate to the server if you haven't already.
Make sure to look at the browser console too to see if any errors occurred there.
The documentation has some information that cover how individual concepts of web push work together. We can extend this if you feel it's not sufficient.
Question: I have compiler the demo as 32bits. The exe run on a 64bits OS. Should I use 32bits Midas.dll or 64bits ? Anyway, if I put one or the other, I still get the error message.
This means the push service rejected the push notification, usually that's an issue with the VAPID header. Assuming you have WebPush.dll deployed as in your screenshot earlier, most likely you have a mismatch with your VAPID key.
If you are using the same browser as you did in your localhost test and you did not unsubscribe manually first, then your browser persisted a subscription object with a different key. The push service expects the original key the subscription object was created with.
What can you do?
Don't mix localhost with dedicated server testing, or if you do, use the same key in both servers. If still have the original key, use that.
If you don't have the key anymore, reset everything to get back to a working state: Do an Unsubscribe from the web application (in all browsers that you used) & reload the page. At this point the web app demo should not persist any more VAPID keys. You can verify this by subscribing again, the first request in the push server should go to /vapidPublicKey.