Releases: web-push-libs/web-push-php
v1.4.0
- Use Guzzle instead of Buzz (~30% speed increase)
- [BC Break] removed
getBrowser()
andsetBrowser()
- [BC Break] last argument of constructor takes Guzzle Client RequestOptions array instead of Buzz Client
- [BC Break] removed
Feedbacks are welcome!
v1.3.4
- fixes possible problems with VAPID when your server's time was out-of-sync with the browser's server time.
v1.3.3
- fixes compatibility with Firefox for Android. Cf. discussion on #62.
- you can set automatic padding with a custom length
- automatic padding is now smaller than before
- see the README section
v1.3.2
- Authentication details can be customized for each notification in case you've changed/lost your VAPID keys
- It means you'll need to pair each notification with the corresponding VAPID keys in your database
- However, it's very easier and safer to simply not lose or change your VAPID keys.
- Fixed a bug when users wanted to generate their VAPID keys using the bundled function instead of using openssl in the bash; and also when users specified their VAPID keys with a PEM file instead of giving the uncompressed base64encoded keys.
v1.3.1
- Added
createVapidKeys()
that helps in generating VAPID keys for further use.
v1.3 - VAPID
- Added VAPID compatibility:
- It's a standard that authenticates your server for browser vendors. GCM authentification can be replaced by this.
- You should implement this, as VAPID may be strictly required by browsers in the future.
- Look at the readme for more information.
v1.2
- Added the keys 'expired' and 'endpoint' in the return of flush() and sendNotification(..., true);
- New options: "urgency" and "topic";
- Default options in the constructor (replaces the $TTL);
- Some fixes.
For more info on specific features, please look at the README.
v1.1
PHP 5.6 is now needed.
- added content of the response if failure
- fixed a bug that occured when phpecc was updated to 0.4.0
- fixed returning the correct number of responses if there are both success and errors
- stopped replacing GCM URLs because servers are now updated
v1.0.1
You can use URL-safe base 64 user public keys and auth tokens now without the need to convert to MIME base 64 encoded keys.
v1.0 - Payload support
Summary
You can now send notifications with a payload ! Payload is encrypted with the user public key and user authentication secret that you can get with the Web Push API (subscription.getKey('p256dh')
and subscription.getKey('auth')
). You should have every instructions you need in the README.
For the moment, encryption is made through Spomky-Labs/php-aes-gcm. An improved version of the openssl_encrypt function of the native PHP binding of OpenSSL should be available in PHP7.1 and this library will use it when it is available.
Payload will be correctly decrypted by Chrome 50+ and Firefox 46+.
Upgrade notes
- [BC break] new API of
sendNotification(string $endpoint, string $payload, string $userPublicKey, string $userAuthSecret, bool $flush)
in order to take into account the user auth secret. (notice the $flush parameter being shifted to the right) - Automatic padding of the payload can be disabled to save bandwidth with
$webPush->setAutomaticPadding(false)
. Note that it's not recommended for security reasons. - [fix] When there was multiple notifications in the queue and when you would send another notification with the intent to flush the queue, if there was an error with any of the notification, the function would return only the first result.