brunty / pushover
A client to send messages through Pushover
Requires
- php: >=7.1
- php-http/client-implementation: ^1.0
- php-http/discovery: ^1.3
- php-http/httplug: ^1.1
- php-http/message-factory: ^1.0
- psr/http-message: ^1.0
Requires (Dev)
- guzzlehttp/psr7: ^1.4
- kahlan/kahlan: ^3.1
- php-http/guzzle6-adapter: ^1.1
- php-http/mock-client: ^1.0
This package is auto-updated.
Last update: 2023-01-06 05:27:02 UTC
README
❗️ Provides functionality to send messages via Pushover
Requirements
- PHP >= 7.1
Installation
composer require brunty/pushover
You will also need to require your adapter of choice http://docs.php-http.org/en/latest/clients.html
Usage
As per the Pushover API Documentation - user
and token
form your credentials.
Messages are made up of a message body and a title in a Brunty\Pushover\Message
object.
Optionally you can specify a device to send the message to as well, if you don't specify this, it'll send to all devices.
<?php use Brunty\Pushover\Client; use Brunty\Pushover\Credentials; use Brunty\Pushover\Message; use Http\Mock\Client as MockClient; // Mock client here wouldn't send a request, it's used for testing // substitute with your own real client from the adapters above $client = new Client(new MockClient, new Credentials('user', 'token')); $client->pushMessage(new Message('message', 'optional title'), 'optional device');
The following are not (yet) supported, but will be in the near future:
url
url_title
priority
timestamp
sound
Contributing
This started as a small personal project.
Although this project is small, openness and inclusivity are taken seriously. To that end a code of conduct (listed in the contributing guide) has been adopted.