40 lines
1,004 B
PHP
40 lines
1,004 B
PHP
<?php
|
|
|
|
namespace App\Command;
|
|
|
|
use Symfony\Component\Console\Command\Command;
|
|
use Symfony\Component\Console\Input\InputArgument;
|
|
use Symfony\Component\Console\Input\InputInterface;
|
|
use Symfony\Component\Console\Output\OutputInterface;
|
|
|
|
use App\Service\APNSClient;
|
|
|
|
use DateTime;
|
|
|
|
class TestRegAPNSCommand extends Command
|
|
{
|
|
protected $apns;
|
|
|
|
public function __construct( APNSClient $apns)
|
|
{
|
|
$this->apns = $apns;
|
|
|
|
parent::__construct();
|
|
}
|
|
|
|
protected function configure()
|
|
{
|
|
$this->setName('apns:test_reg')
|
|
->setDescription('Test new format for Apple Push Notification.')
|
|
->setHelp('Test new format for Apple Push Notification.')
|
|
->addArgument('push_id', InputArgument::REQUIRED, 'push_id');
|
|
}
|
|
|
|
protected function execute(InputInterface $input, OutputInterface $output)
|
|
{
|
|
$push_id = $input->getArgument('push_id');
|
|
$this->apns->sendReg($push_id, 'Test Delay', 'Body');
|
|
|
|
return 0;
|
|
}
|
|
}
|