norkunas / onesignal-php-api

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

Can not send a notification #118

Closed richard457 closed 5 years ago

richard457 commented 5 years ago

I am trying to send notification this is error I am getting a 400 Bad Request response: {"errors":["Please include a case-sensitive header of Authorization: Basic

$this->request = $request;

    $this->one_signal_config = new Config();
    $this->one_signal_config->setApplicationId(config('notification.one_signal_app_id'));
    $this->one_signal_config->setApplicationAuthKey(config('notification.one_signal_app_auth_key'));
    $this->one_signal_config->setUserAuthKey(config('notification.one_signal_user_auth_key'));

and $this->one_signal_api->notifications->add([ 'contents' => [ 'en' => "adm_small_icon" ], 'included_segments' => ['All'], // 'data' => $this->request['message'], 'data' => ['foo' => 'bar'], 'send_after' => new \DateTime('1 hour'), 'filters' => [ //currently we have no filters. ],

    ]);
norkunas commented 5 years ago

Hello,

Are you sure you configure a valid application id?