web-push-libs / web-push-php

Web Push library for PHP
MIT License
1.69k stars 295 forks source link

Send push notification with cron job #320

Closed 8Ozymandias closed 3 years ago

8Ozymandias commented 3 years ago

Is it possible to have a notification be sent if a certain criteria is met with or within a cron job?

I noticed that inside app.js that in order to send a notification we utilized the following:

send_push_notification.php

And that it used inside of a click event.

However, I don't want it to be bounded by a click event.

I want it to be able to send a notification based on another criteria/condition being met , WITHOUT A CLICK EVENT.

Any help would be appreciated.

Minishlink commented 3 years ago

Yes it's possible, the send_push_notification.php is only an example for a demo, not for a real world use case. You'd need to store the push subscriptions in a database.