con4gis/pwa
Composer 安装命令:
composer require con4gis/pwa
包简介
Adds PWA functionality to a contao application.
README 文档
README
Overview
Turn your Contao Website into a progressive web app. The con4gis-PwaBundle provides everything you need for basic PWA functionality, including generating a service worker script and a manifest file.
Features include:
- Configuration of required parameters for the webmanifest
- Select a pwa configuration in the page root. On submit the service worker and manifest for this page root will be generated for you.
- Multiple offline behaviours: choose whether you want to cache everything or if you always want to redirect to a chosen offline page.
- WebPushConfiguration: configure the web push library in the backend so your users can register for push notifications.
- Add icons for app splashscreens (Android & iOS)
Installation
Via composer:
composer require con4gis/pwa
Alternatively, you can use the Contao Manager to install the con4gis-PwaBundle.
Requirements
- Contao (latest stable release)
- CoreBundle (latest stable release)
- WebPushBundle (3.* (latest))
- The php-gmp extension is required by the used web-push-library and has to be installed/activated if the installation failes for this reason
Usage
This bundles provides two front end modules for contao:
PWA module (add manifest)
Creates the required HTML code to load the manifest file and the service worker. Can be included anywhere on the page since it contains no visible elements by itself.
Push subscription button
Creates the button to subscribe to push notifications as well as loading the javascript needed to handle the subscription. The button comes unstyled, but can be accessed via the "btn-push-subscribe"-ID for individual styling.
Sending a notification
There are three different ways to send push notifications with this bundle:
- Console Command (
con4gis:send-push <message>) - Backend Module (Create a new dataset and store it - it won't be stored in the database but is sent to all subscribed users instead)
- Sending a notification programmatically
To send a notification in one of your scripts, you have to create a PushNotificationEvent and use the Symfony event dispatcher.
// get the event dispatcher $eventDispatcher = $this->eventDispatcher; // instantiate event $event = new PushNotificationEvent(); // this sends the notification to every subscribed user. You can send a notification to only one subscription, too $event->setSendToAll(true); // set message contents $event->setTitle($title); $event->setMessage($content); // dispatch the event $eventDispatcher->dispatch($event::NAME, $event);
Documentation
Visit docs.con4gis.org for a user documentation. You can also contact us via the support forum there.
con4gis/pwa 适用场景与选型建议
con4gis/pwa 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1.67k 次下载、GitHub Stars 达 9, 最近一次更新时间为 2019 年 05 月 16 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「contao」 「con4gis」 「c4g」 「pwa」 「Progressive Web App」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 con4gis/pwa 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 con4gis/pwa 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 con4gis/pwa 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Contao Open Source CMS
Diese Contao 4 Erweiterung stellt Google reCAPTCHA V2 in Form eines neuen Formularfeldes im Formulargenerator bereit. This extension provides Google reCAPTCHA V2 in the form of a new form field in the form generator of Contao Open Source CMS.
Contao module for creating reservation forms. For example for tables, rooms or other objects.
The contribution brick of the Contao GIS-kit con4gis. Powerful discussion forum amd ticketcenter for Contao.
Generating pdf documents directly or per stack
The batch processing brick of the Contao GIS-kit con4gis.
统计信息
- 总下载量: 1.67k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 9
- 点击次数: 22
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: LGPL-3.0-or-later
- 更新时间: 2019-05-16