Error when trying to set devices or notifications

Created on 21 April 2025, 11 days ago

Problem/Motivation

After installation and configuration of OneSignal 3.0.2 on my local website (Drupal 10.4.6), when I try to configure 'Devices' (/admin/config/services/onesignal/devices), i get this error message:

The website encountered an unexpected error. Try again later.

OneSignal\Exception\JsonException: Response content-type is 'text/plain' while a JSON-compatible one was expected. in OneSignal\OneSignal->sendRequest() (line 75 of /var/www/html/vendor/norkunas/onesignal-php-api/src/OneSignal.php).

OneSignal\Devices->getAll() (Line: 126)
Drupal\onesignal\OneSignalService->getDevices() (Line: 147)
Drupal\onesignal\Controller\OneSignalController->getDevices()
call_user_func_array() (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 638)
Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 121)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext() (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 181)
Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 53)
Drupal\Core\StackMiddleware\Session->handle() (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 28)
Drupal\Core\StackMiddleware\ContentLength->handle() (Line: 32)
Drupal\big_pipe\StackMiddleware\ContentLength->handle() (Line: 116)
Drupal\page_cache\StackMiddleware\PageCache->pass() (Line: 90)
Drupal\page_cache\StackMiddleware\PageCache->handle() (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 36)
Drupal\Core\StackMiddleware\AjaxPageState->handle() (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle() (Line: 741)
Drupal\Core\DrupalKernel->handle() (Line: 19)

Any idea of what I did wrong?

🐛 Bug report
Status

Active

Version

3.0

Component

Code

Created by

🇫🇷France gbmapo

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024