norkunas / onesignal-php-api

OneSignal API for PHP
MIT License
234 stars 83 forks source link

Readme configuration not working #159

Closed marcoberetta96 closed 2 years ago

marcoberetta96 commented 2 years ago

I've just try this piece of code from the readme

$config = new Config('your_application_id', 'your_application_auth_key', 'your_auth_key');
$httpClient = new Psr18Client();
$requestFactory = $streamFactory = new Psr17Factory();

$oneSignal = new OneSignal($config, $httpClient, $requestFactory, $streamFactory);

but it gives me this error

Argument 2 passed to OneSignal\OneSignal::__construct() must be an instance of Http\Client\Common\HttpMethodsClient or null, instance of Symfony\Component\HttpClient\Psr18Client given, called in /Users/marco/marco96/projects/symfony_x/src/Controller/Test/OneSignalController.php on line 28

Am I missing something or maybe the readme should be updated? Thanks.

marcoberetta96 commented 2 years ago

Just find out I was using v1 of this package due to old php version. Solved :)