norkunas/onesignal-php-api

error with httpClient given

inkly opened this issue · 1 comments

inkly commented

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 ?

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