1 | <?php |
||
9 | class ApnSendTestNotification extends Command |
||
10 | { |
||
11 | /** |
||
12 | * The name and signature of the console command. |
||
13 | * |
||
14 | * @var string |
||
15 | */ |
||
16 | protected $signature = 'apn:test |
||
17 | {--T|token= : The token of the device that the PN will be sent to.} |
||
18 | {--t|title=Test APN Notification : The title of the PN.} |
||
19 | {--m|message=This is a test push notification sent from the console. : The message body for the PN.} |
||
20 | {--b|badge=1 : The number that will be displayed in the app\'s badge notification.} |
||
21 | {--s|sound=default : The name of the sound that should be played with the notification.}'; |
||
22 | |||
23 | /** |
||
24 | * The console command description. |
||
25 | * |
||
26 | * @var string |
||
27 | */ |
||
28 | protected $description = 'Send a test push notification using the APN service.'; |
||
29 | |||
30 | /** |
||
31 | * Execute the console command. |
||
32 | * |
||
33 | * @return void |
||
34 | */ |
||
35 | public function handle(): void |
||
47 | |||
48 | /** |
||
49 | * Validate whether if the options passed in the command |
||
50 | * are valid. An array of errors is returned if any |
||
51 | * options fail the checks. Null is returned if |
||
52 | * the options are all valid. |
||
53 | * |
||
54 | * @param array $errors |
||
55 | * @return array|null |
||
56 | */ |
||
57 | private function optionsAreInvalid(array $errors = []) |
||
69 | |||
70 | /** |
||
71 | * Trigger the notification to send to the testing device. |
||
72 | * |
||
73 | * @return void |
||
74 | */ |
||
75 | private function sendNotification() |
||
80 | } |