定制 con4gis/pwa 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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

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 我们能提供哪些服务?
定制开发 / 二次开发

基于 con4gis/pwa 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 1.67k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 9
  • 点击次数: 22
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 9
  • Watchers: 4
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: LGPL-3.0-or-later
  • 更新时间: 2019-05-16