Closed valentin-harrang closed 6 years ago
Most of the time default guzzle configuration is enough for api usage, but if you think you need to configure something then I suggest to you to read it's documentation http://docs.guzzlephp.org/.
As for sending notifications you can find some examples here: https://github.com/norkunas/onesignal-php-api/blob/master/docs/getting-started.md#notifications
I created a mobile application with Ionic 3 and I would like send notification in Symfony 3 via One Signal.
I read the documentation of One Signal and this documentation: https://github.com/norkunas/onesignal-php-api/blob/master/docs/setup-guzzle5.md
I created a service in Symfony, but I'm blocked, I do not know what to put in.
$guzzle = new GuzzleClient([ // ..config ]);
My service :
`namespace SGBundle\Service\OneSignal;
use GuzzleHttp\Client as GuzzleClient; use Http\Adapter\Guzzle5\Client as GuzzleAdapter; use Http\Client\Common\HttpMethodsClient as HttpClient; use Http\Message\MessageFactory\GuzzleMessageFactory; use OneSignal\Config; use OneSignal\Devices; use OneSignal\OneSignal; use SGBundle\Controller\BaseController;
class OneSignalService extends BaseController {
And where I define the body of my notification (title and message for example) ?
Thank you in advance for your help