Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Send Notification with External User ID return 403 Forbidden #172

Open
caktoy opened this issue Aug 18, 2022 · 1 comment
Open

Send Notification with External User ID return 403 Forbidden #172

caktoy opened this issue Aug 18, 2022 · 1 comment

Comments

@caktoy
Copy link

caktoy commented Aug 18, 2022

My Code:

OneSignal::sendNotificationToExternalUser(
    $message,
    $to,
    $url = null,
    $data = null,
    $buttons = null,
    $schedule = null,
    $title
);

I'am tested it in local environment and everything working, but when I'am tried in server production it return error that says:

local.ERROR: GuzzleHttp\Exception\ClientException: Client error: `POST https://onesignal.com/api/v1/notific><!DOCTYPE html>
<html lang="en-US">
<head>
    <title>Just a moment...</title>
    <meta http-equiv="Content-Type" conte (truncated...)
 in /var/www/sm-rab-api/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php:113
Stack trace:
#0 /var/www/sm-rab-api/vendor/guzzlehttp/guzzle/src/Middleware.php(69): GuzzleHttp\Exception\RequestException::create()
#1 /var/www/sm-rab-api/vendor/guzzlehttp/promises/src/Promise.php(204): GuzzleHttp\Middleware::GuzzleHttp\{closure}()
#2 /var/www/sm-rab-api/vendor/guzzlehttp/promises/src/Promise.php(153): GuzzleHttp\Promise\Promise::callHandler()
#3 /var/www/sm-rab-api/vendor/guzzlehttp/promises/src/TaskQueue.php(48): GuzzleHttp\Promise\Promise::GuzzleHttp\Promise\{closure}>#4 /var/www/sm-rab-api/vendor/guzzlehttp/promises/src/Promise.php(248): GuzzleHttp\Promise\TaskQueue->run()
#5 /var/www/sm-rab-api/vendor/guzzlehttp/promises/src/Promise.php(224): GuzzleHttp\Promise\Promise->invokeWaitFn()
#6 /var/www/sm-rab-api/vendor/guzzlehttp/promises/src/Promise.php(269): GuzzleHttp\Promise\Promise->waitIfPending()
#7 /var/www/sm-rab-api/vendor/guzzlehttp/promises/src/Promise.php(226): GuzzleHttp\Promise\Promise->invokeWaitList()
more...

Please help and give me an advice what I need to do to solve the problem.

@berkayk
Copy link
Owner

berkayk commented Oct 5, 2022

If it's working in a local environment, you should check your production server's settings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants