Skip to content

Commit 28c01ae

Browse files
authored
Improve README and issue template (#91)
1 parent e229a3f commit 28c01ae

File tree

2 files changed

+26
-11
lines changed

2 files changed

+26
-11
lines changed

ISSUE_TEMPLATE.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ helps with diagnosing problems quicker.
2626
2727
- [ ] Chrome
2828
- [ ] Firefox
29+
- [ ] Firefox for Mobile
2930
- [ ] Opera for Android
3031
- [ ] Samsung Internet Browser
3132
- [ ] Other
3233

33-
> Please list the browsers you are have tested this, including the version
34-
> of the browser (i.e. Chrome Beta, Firefox Beta etc).
34+
> Please specify the versions (i.e. Chrome Beta, Firefox Beta etc).
3535
3636
# Problem
3737

README.md

+24-9
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,25 @@
44
[![Build Status](https://travis-ci.org/web-push-libs/web-push-php.svg?branch=master)](https://travis-ci.org/web-push-libs/web-push-php)
55
[![SensioLabsInsight](https://insight.sensiolabs.com/projects/d60e8eea-aea1-4739-8ce0-a3c3c12c6ccf/mini.png)](https://insight.sensiolabs.com/projects/d60e8eea-aea1-4739-8ce0-a3c3c12c6ccf)
66

7+
WebPush can be used to send notifications to endpoints which server delivers Web Push notifications as described in
8+
the [Web Push protocol](https://tools.ietf.org/html/draft-thomson-webpush-protocol-00).
9+
As it is standardized, you don't have to worry about what server type it relies on.
10+
11+
## Requirements
12+
* PHP 5.6
13+
* gmp
14+
* mbstring
15+
* curl
16+
* openssl
17+
18+
PHP 7.1 is recommended for better performance.
19+
720
## Installation
821
Use [composer](https://getcomposer.org/) to download and install the library and its dependencies.
922

1023
`composer require minishlink/web-push`
1124

1225
## Usage
13-
WebPush can be used to send notifications to endpoints which server delivers web push notifications as described in
14-
the [Web Push protocol](https://tools.ietf.org/html/draft-thomson-webpush-protocol-00).
15-
As it is standardized, you don't have to worry about what server type it relies on.
16-
17-
Notifications with payloads are supported with this library on Firefox 46+ and Chrome 50+.
18-
19-
You'll need at least PHP 5.6 with the following extensions enabled: gmp, mbstring, curl, openssl.
20-
PHP 7.1 is recommended for much better performance.
21-
2226
```php
2327
<?php
2428

@@ -176,6 +180,8 @@ $res = array(
176180
);
177181
```
178182

183+
Firefox errors are listed in the [autopush documentation](https://autopush.readthedocs.io/en/latest/http.html#errors).
184+
179185
### Payload length, security, and performance
180186
Payloads are encrypted by the library. The maximum payload length is theoretically 4078 bytes (or ASCII characters).
181187
For [compatibility reasons](mozilla-services/autopush/issues/748) though, your payload should be less than 3052 bytes long.
@@ -270,9 +276,18 @@ Make sure to require Composer's [autoloader](https://getcomposer.org/doc/01-basi
270276
require __DIR__ . '/path/to/vendor/autoload.php';
271277
```
272278

279+
### I must use PHP 5.4 or 5.5. What can I do?
280+
You won't be able to send any payload, so you'll be only able to use `sendNotification($endpoint)`.
281+
Install the libray with `composer` using `--ignore-platform-reqs`.
282+
The workaround for getting the payload is to fetch it in the service worker ([example](https://github.com/Minishlink/physbook/blob/2ed8b9a8a217446c9747e9191a50d6312651125d/web/service-worker.js#L75)).
283+
273284
### I lost my VAPID keys!
274285
See [issue #58](https://github.com/web-push-libs/web-push-php/issues/58).
275286

287+
### I'm using Firebase push notifications, how do I use this library?
288+
This library is not designed for Firebase push notifications.
289+
You can still use it for your web projects (for standard WebPush notifications), but you should forget any link to Firebase while using the library.
290+
276291
### I need to send notifications to native apps. (eg. APNS for iOS)
277292
WebPush is for web apps.
278293
You need something like [RMSPushNotificationsBundle](https://github.com/richsage/RMSPushNotificationsBundle) (Symfony).

0 commit comments

Comments
 (0)