avatar

麦兜的小站

MDO.INK

  • 首页
  • 随笔
  • 知识库
  • 归档
  • 动态
  • 标签
  • 关于
Home An example for sending Web Push notifications, using web-push-php
文章

An example for sending Web Push notifications, using web-push-php

Posted 2025-03-21 Updated 2025-03- 21
By power 已删除用户
3~4 min read

Navigating through the commits and files will help you build:

  • on the client

    • a user friendly opt-in push notification button
  • on the server

    • an endpoint for managing your push notification subscriptions
    • an endpoint that triggers push notification thanks to web-push-php
  • Chrome or Firefox

  • composer

  • PHP 8.0+

    • gmp
    • mbstring
    • curl
    • openssl

PHP 7.2 is no longer maintained, but you can checkout the v3.x tags. PHP 7.1 is no longer maintained, but you can checkout the v2.x tags. PHP 5.6+ is no longer maintained, but you can checkout the v1.x tags.

$ composer create-project minishlink/web-push-php-example
$ cd web-push-php-example

You can change the VAPID keys in the keys folder with this guide. Don't forget to update the public key in app.js too.

$ php -S localhost:8000 router.php

And open localhost:8000.

随笔
License:  CC BY 4.0
Share

Further Reading

Mar 24, 2025

一个人的“成熟”标准

过去我一直就认为,家和似乎仅仅只是一个人幸福的起点,并不是天花板。我们应该追求的幸福标准能够更高才对,但后来当我接触到了越来越多的案例之后,我才发现,一个人的“成熟”标准,其实就是从能否认命开始的。 ...

Mar 21, 2025

An example for sending Web Push notifications, using web-push-php

Navigatingthroughthecommitsandfileswillhelpyoubuild: ontheclient auserfriendlyopt-inpushnotificati...

Mar 20, 2025

Bloxflip Rain Autojoin

Wraplines 1.//==UserScript== 2.//@nameBloxflipRainAutojoin 3.//@namespacehttp://tampermonkey.net/ 4....

OLDER

搭建专属于你的消息推送服务,支持多种消息推送方式,支持 Markdown,基于 Golang 仅单可执行文件

NEWER

一个人的“成熟”标准

Recently Updated

  • 如何实现接口幂等性
  • 10个npm工具包
  • How to set up PHP7.4 on MacOS.
  • Automa:一键自动化,网页数据采集与工作流程优化专家Automa:解锁自动化
  • Mac 下用 brew 搭建 LNMP

Trending Tags

thinkphp clippings

Contents

©2025 麦兜的小站. Some rights reserved.

Using the Halo theme Chirpy