|
8 | 8 |
|
9 | 9 | This package makes it easy to send web push notifications with Laravel. |
10 | 10 |
|
| 11 | +## Features |
| 12 | + |
| 13 | +- **Easy integration with Laravel notifications:** Seamlessly integrates with Laravel's notification system, allowing you to send web push notifications using familiar notification channels. |
| 14 | +- **Multiple browser support:** Works with all major browsers that implement the [Push API](https://developer.mozilla.org/en-US/docs/Web/API/Push_API), including Chrome, Firefox, Edge, and Safari. |
| 15 | +- **VAPID support:** Easily generate and manage VAPID keys for secure browser authentication. |
| 16 | +- **Flexible message options:** Customize notifications with title, body, icon, actions, TTL, and more. Supports advanced options like vibration, badge, image, and custom data payloads. |
| 17 | +- **Subscription management:** Convenient methods to save, update, and delete push subscriptions directly on your notifiable models. |
| 18 | +- **Automatic expired subscription cleanup:** When sending a push message to an expired subscription, the package detects expired endpoints (using the `expired` flag of `Minishlink\WebPush\MessageSentReport`). This package will automatically delete expired subscriptions. |
| 19 | +- **Configurable and extendable:** Publish and customize the package's config file to fit your application's needs. |
| 20 | + |
11 | 21 | ## Installation |
12 | 22 |
|
13 | 23 | You can install the package via Composer: |
@@ -53,7 +63,10 @@ php artisan webpush:vapid |
53 | 63 |
|
54 | 64 | This command will set `VAPID_PUBLIC_KEY` and `VAPID_PRIVATE_KEY` in your `.env` file. You need the `VAPID_PUBLIC_KEY` as `applicationServerKey` when using the [Push API](https://developer.mozilla.org/en-US/docs/Web/API/Push_API). |
55 | 65 |
|
56 | | -> **Note:** If targeting Safari or iOS after 2023, you will need to include the `VAPID_SUBJECT` variable as well, or Apple will return a `BadJwtToken` error. |
| 66 | +> **Note for Safari:** |
| 67 | +> - If targeting Safari or iOS (especially after 2023), you **must** include the `VAPID_SUBJECT` variable in your `.env` file. This should be a valid URL (e.g. `https://example.com`) or a `mailto:` address (e.g. `mailto:[email protected]`). |
| 68 | +> - Apple will reject requests with a `BadJwtToken` error if `VAPID_SUBJECT` is missing or invalid. |
| 69 | +> - The domain in `VAPID_SUBJECT` must be a valid, existing top-level domain (TLD). |
57 | 70 |
|
58 | 71 | __These keys must be safely stored and should not change.__ |
59 | 72 |
|
|
0 commit comments