norkunas / onesignal-php-api

OneSignal API for PHP
MIT License
233 stars 82 forks source link

error with httpClient given #131

Closed inkly closed 4 years ago

inkly commented 4 years ago

Hi,

I have only copied your readme for install

composer require symfony/http-client nyholm/psr7 norkunas/onesignal-php-api

and I have this error :

OneSignal\OneSignal::__construct() must be an instance of Http\Client\Common\HttpMethodsClient or null, instance of Symfony\Component\HttpClient\Psr18Client given

code :

`use OneSignal\Config; use OneSignal\OneSignal; use Symfony\Component\HttpClient\Psr18Client; use Nyholm\Psr7\Factory\Psr17Factory;

require DIR . '/../../vendor/autoload.php';

$config = new Config('', '', '***'); $httpClient = new Psr18Client(); $requestFactory = $streamFactory = new Psr17Factory();

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

where is my mistake ?

norkunas commented 4 years ago

Hello, it looks that you installed v1 while current readme is for v2. I've raised php version to 7.3 for v2, so if you are not upgraded,please read v1 readme