@@ 46-65 (lines=20) @@ | ||
43 | * @param \Illuminate\Notifications\Notification $notification |
|
44 | * @return array|void |
|
45 | */ |
|
46 | public function send($notifiable, Notification $notification) |
|
47 | { |
|
48 | $tokens = (array) $notifiable->routeNotificationFor('apn', $notification); |
|
49 | ||
50 | if (empty($tokens)) { |
|
51 | return; |
|
52 | } |
|
53 | ||
54 | $message = $notification->toApn($notifiable); |
|
55 | ||
56 | $responses = $this->sendNotifications( |
|
57 | $message->client ?? $this->client, |
|
58 | $message, |
|
59 | $tokens |
|
60 | ); |
|
61 | ||
62 | $this->dispatchEvents($notifiable, $notification, $responses); |
|
63 | ||
64 | return $responses; |
|
65 | } |
|
66 | ||
67 | /** |
|
68 | * Send the message to the given tokens through the given client. |
@@ 20-39 (lines=20) @@ | ||
17 | * @param \Illuminate\Notifications\Notification $notification |
|
18 | * @return array|void |
|
19 | */ |
|
20 | public function send($notifiable, Notification $notification) |
|
21 | { |
|
22 | $tokens = (array) $notifiable->routeNotificationFor('apn_voip', $notification); |
|
23 | ||
24 | if (empty($tokens)) { |
|
25 | return; |
|
26 | } |
|
27 | ||
28 | $message = $notification->toApnVoip($notifiable); |
|
29 | ||
30 | $responses = $this->sendNotifications( |
|
31 | $message->client ?? $this->client, |
|
32 | $message, |
|
33 | $tokens |
|
34 | ); |
|
35 | ||
36 | $this->dispatchEvents($notifiable, $notification, $responses); |
|
37 | ||
38 | return $responses; |
|
39 | } |
|
40 | } |
|
41 |