В моем config.yml я определил это для обработки уведомлений.
rms_push_notifications:
android:
timeout: 5 # Seconds to wait for connection timeout, default is 5
fcm:
api_key: "key"
use_multi_curl: false
ios:
timeout: 60 # Seconds to wait for connection timeout, default is 60
sandbox: true
pem: '%kernel.project_dir%/pushcert.pem'
passphrase: *****
Я определил команду для проверки отправки уведомления
services.yml
app.command.app_sendNotif:
class: AppRefactoredBundle\Command\SendNotif
public: true
arguments: ['@service_container']
tags:
- { name: console.command }
Команда
class SendNotif extends ContainerAwareCommand
{
private $container;
public function __construct(Container $containers)
{
parent::__construct();
$this->container = $containers;
}
protected function configure()
{
// On set le nom de la commande
$this->setName('app:sendNotif');
// On set la description
$this->setDescription("Permet de controler le timeout des offres et demandes");
// On set l'aide
$this->setHelp("Cette commande ne prend pas d'argument et travailler sur toutes les offres et demandes");
}
public function execute(InputInterface $input, OutputInterface $output){
// --------------------- TEST ENVOIE NOTIF ANDROID ET IOS -------------------------------------------//
$output->writeln("Send IOS");
$message = new iOSMessage();
$message->setMessage('Oh my! A push notification IOS !');
$message->setDeviceIdentifier('d03b98b9f5260e2523b03a614d4d2a01278524aaccff8c8b8ea0617e6471c992');
var_dump($this->container->get('rms_push_notifications'));
$output->writeln("Send Done");
}
}
Проблема в том, что я могу получить свой контейнер... но я не могу определить rms_push_notifications в моем config.yml
я получаю эту ошибку
В строке 33 AbstractClient.php:
Ошибка типа: слишком мало аргументов для функции Buzz\Client\AbstractClient::__construct(), 0 передано в /var/www/project/api/vendor/richsage/rms-push-notifications-bundle/RMS/PushNotificationsBundle/Service/OS /AndroidGCMNotification.php в строке 81 и не менее
1 ожидается




Итак, на самом деле проблема была связана с RMS, которая использует Buzz. Это означает, что мы должны добавить зависимости Buzz в наш composer.json (что не указано в официальной документации). Тогда это работает
Вы пробовали container->getParameter вместо container->get ? Я не уверен, что ошибка связана с жесткостью ... какая у вас версия symfony?