lekoala/silverstripe-pwa
Composer 安装命令:
composer require lekoala/silverstripe-pwa
包简介
Create your progressive web app (PWA) with SilverStripe
README 文档
README
Features
- Support push notifications
- Generate a valid manifest
- Provides a default configurable service worker that can cache assets
Generate icons
Use the cli npm run generate-assets(-root) (if you have a app/images/logo.svg file) or upload a zip file with the required icons
Note: pay attention to maskable icons. You can test their size in the developer console. You can test them in maskable.app
Subscribe to push notifications
client.js provides some base code for this. You need to put somewhere a checkbox that can be used to toggle push notifications on/off.
<label><input type="checkbox" class="js-push-toggle" /> Enable notifications</label>
This is dealt with by client.js. You can replace client code by your custom code or disable it entirely
LeKoala\SsPwa\ServiceWorkerController: enable_client_js: false custom_client_path: "/my/custom/path"
Service worker
This module provides a default service worker. You can use your own if needed
LeKoala\SsPwa\ServiceWorkerController: custom_sw_path: "/my/custom/path"
Exclude from cache
If you want to exclude specific patterns (eg: pdf files) from cache, you can use:
LeKoala\SsPwa\ServiceWorkerController: exclude_from_cache: - '/\.pdf$/i'
Use vapid keys
You can generate the vapid keys with this online tool or with the cli npm run gen-push-keys
You need to save them either in your .env file or as YML config.
PUSH_PUBLIC_KEY='BK1Zt63e94HgYNm-s9aquI85AUdDRz3uKMxue7woQVZv0_3txywXPgyYd2WPJetayKYq3E_AObBGD9rHWOL_...'
PUSH_PRIVATE_KEY='1nKKQnzGRMNit-TuvklqoTY_ENO8eAybp1MsZWx0...'
Sending push notifications
You can use the following piece of code
PushSubscription::sendPushNotifications($where, $data);
Credits
Thanks to https://github.com/a2nt/silverstripe-progressivewebapp for some inspiration :-)
Compatibility
Tested with ^5
Maintainer
LeKoala - thomas@lekoala.be
lekoala/silverstripe-pwa 适用场景与选型建议
lekoala/silverstripe-pwa 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 13 次下载、GitHub Stars 达 3, 最近一次更新时间为 2022 年 11 月 30 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「module」 「cms」 「web」 「app」 「silverstripe」 「progressive」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 lekoala/silverstripe-pwa 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 lekoala/silverstripe-pwa 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 lekoala/silverstripe-pwa 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Model of a web-based resource
GraphQL authentication for your headless Craft CMS applications.
Set Links with a specific language parameter
Supercharged text field validation.
Retrieve a WebResourceInterface instance over HTTP
Integrate with Snipcart.
统计信息
- 总下载量: 13
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 14
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-11-30