norkunas / onesignal-php-api

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

`404 Not Found` response: {"errors":["Notification not found"]} #65

Closed gbgelado closed 6 years ago

gbgelado commented 7 years ago

How can I resolve this?

I do this to not stop to work on OneSignal Class


    public function request($method, $uri, array $headers = [], $body = null)
    {
        try {
            $response = $this->client->send($method, self::API_URL.$uri, array_merge([
                'Content-Type' => 'application/json',
            ], $headers), $body);

            return json_decode($response->getBody(), true);
        } catch (\Exception $e) {
            $response = $e->getResponse();

            return [
                'status' => 'error',
                'message' => $e->getMessage(),
                'statusCode' => $response->getStatusCode(),
            ];
        }
    }
norkunas commented 7 years ago

I don't understand your problem, could you explain further?

norkunas commented 7 years ago

You could just catch exception and then do what you want if this is the case