wrep/notificato
最新稳定版本:1.2.1
Composer 安装命令:
composer require wrep/notificato
包简介
Takes care of push notifications in your PHP projects.
README 文档
README
Notificato takes care of push notifications in your PHP projects.
Italian: notificato è: participio passato English: notified
Why use Notificato instead of X?
Notificato has some advantages not all other PHP push libraries have:
- Supports multiple APNS certificates, so you can push to multiple Apps/Passbook Passes
- Takes excellent care of PHPs buggy SSL-sockets, handles quirks and error responses correctly
- Well tested with unit tests and nice Object-Oriented structure
Installation
Installation with Composer is recommended. Run the require command to add Notificato to your project:
composer require wrep/notificato
Suggestion: There is also a Notificato for Symfony bundle available, highly recommended for Symfony2 & Symfony3 users.
Getting started
- Take a look at the snippet below for a impression how Notificato works
- Read the documentation it will help you with common use cases
- Check out the API docs for a deeper understanding what Notificato is capable of
<?php // This imports the Composer autoloader require_once('vendor/autoload.php'); use Wrep\Notificato\Notificato; class GettingStarted { /** * This example sends one pushnotification with an alert to Apples production push servers */ public function sendOnePushNotification() { // First we get a Notificato instance and tell it what certificate to use as default certificate $notificato = new Notificato('./certificate.pem', 'passphrase-to-use'); // Now we get a fresh messagebuilder from Notificato // This message will be send to device with pushtoken 'fffff...' // it will automaticly be associated with the default certificate // and we will set the red badge on the App icon to 1 $message = $notificato->messageBuilder() ->setDeviceToken('ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff') ->setBadge(1) ->build(); // The message is ready, let's send it! // Be aware that this method is blocking and on failure Notificato will retry if necessary $messageEnvelope = $notificato->send($message); // The returned envelope contains usefull information about how many retries where needed and if sending succeeded echo $messageEnvelope->getFinalStatusDescription(); } /** * This example reads all unregistered devices from Apples feedback service */ public function readFeedbackService() { // First we get the a Notificato instance and tell it what certificate to use as default certificate $notificato = new Notificato('./certificate.pem', 'passphrase-to-use'); // Now read all "tuples" from the feedback service, be aware that this method is blocking $tuples = $notificato->receiveFeedback(); // The tuples contain information about what device unregistered and when it did unregister. // Don't forget to check if the device reregistered after the "invaidated at" date! foreach ($tuples as $tuple) { echo 'Device ' . $tuple->getDeviceToken() . ' invalidated at ' . $tuple->getInvalidatedAt()->format(\DateTime::ISO8601) . PHP_EOL; } } } $gettingStarted = new GettingStarted(); $gettingStarted->sendOnePushNotification(); $gettingStarted->readFeedbackService();
Contribute
We'll love contributions, read Contribute.md for some more info on what you can do and stuff that you should know if you want to help!
License & Credits
Notificato is released under the MIT License by Mathijs Kadijk, so feel free to use it in commercial and non-commercial projects.
wrep/notificato 适用场景与选型建议
wrep/notificato 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 367.09k 次下载、GitHub Stars 达 224, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「notifications」 「push」 「ios」 「apns」 「pushnotifications」 「push notifications」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 wrep/notificato 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 wrep/notificato 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 wrep/notificato 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A Laravel Nova package that adds a notification feed in your Nova app.
Generate Apple Passbooks from your Symfony application
PHP framework for easy interaction with Apple's Push Notification Service.
A simple library to decode and parse Apple Sign In client tokens.
Firebase cloud messaging http v1 php
Apple Push Notification & Feedback Provider
统计信息
- 总下载量: 367.09k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 226
- 点击次数: 23
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 未知