You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[](https://packagist.org/packages/laravel-notification-channels/pusher-push-notifications)
-[Sending to multiple platforms](#sending-to-multiple-platforms)
27
+
-[Routing a message](#routing-a-message)
28
+
-[Publish to users](#publish-to-users)
29
+
-[Changelog](#changelog)
30
+
-[Testing](#testing)
31
+
-[Security](#security)
32
+
-[Contributing](#contributing)
33
+
-[Credits](#credits)
34
+
-[License](#license)
30
35
31
36
32
37
## Installation
@@ -87,9 +92,11 @@ class AccountApproved extends Notification
87
92
88
93
### Available Message methods
89
94
90
-
-`platform('')`: Accepts a string value of `iOS`or `Android`.
95
+
-`platform('')`: Accepts a string value of `iOS`, `Android`or `web`.
91
96
-`iOS()`: Sets the platform value to iOS.
92
97
-`android()`: Sets the platform value to Android.
98
+
-`web()`: Sets the platform value to web.
99
+
-`link()`: Accepts a string value which will lead to URI specified on notification click.
93
100
-`title('')`: Accepts a string value for the title.
94
101
-`body('')`: Accepts a string value for the body.
95
102
-`sound('')`: Accepts a string value for the notification sound file. Notice that if you leave blank the default sound value will be `default`.
@@ -120,11 +127,42 @@ public function toPushNotification($notifiable)
120
127
```
121
128
122
129
> - Notice that iOS is the default platform, which means you don't have to call `->iOS()`.
123
-
> - When using `withAndroid()`or `withiOS()` you don't have to define the platform, it's done behind the scenes for you.
130
+
> - When using `withAndroid()`, `withiOS()`or `withWeb()` you don't have to define the platform, it's done behind the scenes for you.
124
131
125
132
### Routing a message
126
133
127
-
By default the pusher "interest" messages will be sent to will be defined using the {notifiable}.{id} convention, for example `App.User.1`, however you can change this behaviour by including a `routeNotificationForPusherPushNotifications()` in the notifiable class method that returns the interest name.
134
+
By default, the pusher "interest" messages will be sent to will be defined using the {notifiable}.{id} convention, for example `App.User.1`,
135
+
however you can change this behaviour by including a `routeNotificationFor()` in the notifiable class.
136
+
137
+
I.e. if you are pushing notification on ``User`` model, you can go to `App\User` class and implement method:
0 commit comments