Download the PHP package sqmk/pushy without Composer
On this page you can find all versions of the php package sqmk/pushy. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Package pushy
Short Description A PHP client for Pushover.net
License BSD-3-Clause
Homepage http://github.com/sqmk/Pushy
Informations about the package pushy
Pushy - Pushover.net client for PHP
Introduction
Pushy is a PHP client that makes communicating with Pushover.net's API simple.
Pushy makes full use of Pushover's API. This includes sending messages, validating users, and retrieving message statuses.
Interested in sending real-time mobile notifications to your iOS or Android device(s) from your web app? Take a look at Pushover.net. API usage is free, and extremely easy to use with Pushy!
Requirements
- PHP 5.4+
- cURL extension
Installation
You can install Pushy by using composer. Simply add the dependency to your composer.json
configuration:
See composer and packagist for more information.
Usage
Assuming your composer generated or custom autoloader can load Pushy files properly, using it is simple!
For those interested in the complete API, you can check out the auto-generated documentation at GitApiDoc.
Initializing client
In order to send a message, verify a user, or get a message status, you'll first need an application API key. You can get an API key by registering a new application on Pushover.net.
Once you acquire your application key, you can now instantiate a Pushy Client object.
Sending messages
You have a client instantiated, now you can send a message. But first, you want to build a user object for the receiving user.
You'll need to get your user identifier (or user key) at Pushover.net. You'll also want a registered device name if you want to send a message to a single device. You can now create a user object with these details.
After creating a user, you have enough to start creating a message.
To send the message, pass the message object to the client.
If no exceptions are thrown, the message was sent successfully. No data is returned by the sendMessage method unless the message has an emergency priority.
Emergency priority messages
You can send a message with an emergency priority and get a receipt id. Emergency priorities also have additional options.
With a receipt Id, you can cancel messages with an emergency priority:
Priorities
The list of available priorities in Pushy\Priority:
- LowestPriority
- LowPriority
- NormalPriority (default)
- HighPriority
- EmergencyPriority
Sounds
The list of available sounds in Pushy\Sound:
- AlienSound
- BikeSound
- BugleSound
- CashregisterSound
- ClassicalSound
- ClimbSound
- CosmicSound
- EchoSound
- FallingSound
- GamelanSound
- IncomingSound
- IntermissionSound
- MagicSound
- MechanicalSound
- NoSound
- PersistentSound
- PianobarSound
- PushoverSound (default)
- SirenSound
- TugboatSound
- UpdownSound
Verifying a user
A user object can be verified with Pushover prior to sending out messages.
Getting message status
When using an emergency priority with a message, you get a receipt code after sending the message successfully. You can get the status of the message by sending the receipt code by way of getMessageStatus
.
Getting application limitations
Pushover.net allows you to send 7,500 messages per month for each application you own. Sending more than that limit will result in rejected requests from the service.
Pushy provides 3 convenience methods on the client to retrieve your app's message limit, remaining messages, and timestamp for when the limit is reset. These values are available after making any other request to Pushover.
Command-line Interface
Included in Pushy is a convenient script to send messages from the command line.
You can call it like so:
All versions of pushy with dependencies
ext-curl Version *