berkayk / laravel-onesignal

OneSignal Push Notifications for Laravel
505 stars 175 forks source link

Undefined index: guzzle_client_timeout in sending from a console command #174

Open ChrAus opened 1 year ago

ChrAus commented 1 year ago

Hi there,

I recently udpated the version of this library since I updated to laravel 8. I am sending to multiple devices using this function:

public function sendViaOneSignal($devicelist)
    {
        if (empty($devicelist)) {
            return true;
        }
        OneSignal::sendNotificationCustom([
            'contents' => [
                'en' => $this->data['pushmessage'],
            ],
            'headings' => [
                'en' => $this->data['subject'],
            ],
            'include_player_ids' => $devicelist,
        ]);

        return true;
    }

But after updating I receive the following error:

Undefined index: guzzle_client_timeout in \vendor\berkayk\onesignal-laravel\src\OneSignalServiceProvider.php on line 39

I added this line to my config file:

'guzzle_client_timeout' => env('ONESIGNAL_GUZZLE_CLIENT_TIMEOUT', 0),

Any ideas?