@@ 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. |
@@ 16-35 (lines=20) @@ | ||
13 | * @param \Illuminate\Notifications\Notification $notification |
|
14 | * @return array|void |
|
15 | */ |
|
16 | public function send($notifiable, Notification $notification) |
|
17 | { |
|
18 | $tokens = (array) $notifiable->routeNotificationFor('apn_voip', $notification); |
|
19 | ||
20 | if (empty($tokens)) { |
|
21 | return; |
|
22 | } |
|
23 | ||
24 | $message = $notification->toApnVoip($notifiable); |
|
25 | ||
26 | $responses = $this->sendNotifications( |
|
27 | $message->client ?? $this->client, |
|
28 | $message, |
|
29 | $tokens |
|
30 | ); |
|
31 | ||
32 | $this->dispatchEvents($notifiable, $notification, $responses); |
|
33 | ||
34 | return $responses; |
|
35 | } |
|
36 | } |
|
37 |