@@ 46-63 (lines=18) @@ | ||
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 | $client = $message->client ?? $this->factory->instance(); |
|
57 | ||
58 | $responses = $this->sendNotifications($client, $message, $tokens); |
|
59 | ||
60 | $this->dispatchEvents($notifiable, $notification, $responses); |
|
61 | ||
62 | return $responses; |
|
63 | } |
|
64 | ||
65 | /** |
|
66 | * Send the message to the given tokens through the given client. |
@@ 16-33 (lines=18) @@ | ||
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 | $client = $message->client ?? $this->factory->instance(); |
|
27 | ||
28 | $responses = $this->sendNotifications($client, $message, $tokens); |
|
29 | ||
30 | $this->dispatchEvents($notifiable, $notification, $responses); |
|
31 | ||
32 | return $responses; |
|
33 | } |
|
34 | } |
|
35 |