-
Notifications
You must be signed in to change notification settings - Fork 128
Closed
Description
I am repeatedly experiencing this error. It is the response OneSignal gives when making the POST request to send the notification.
GuzzleHttp\Exception\ClientException
Client error: `POST https://onesignal.com/api/v1/notifications` resulted in a `400 Bad Request` response:
{"errors":["include_external_user_ids must be an array of non empty strings"]}
I guess it is because an empty array is being passed to include_external_user_ids
in the line 37 of OneSignalPayloadFactory
However these ids come directly from the routeNotificationForOneSignal
method in the User
model. Which is declared as follows
/**
* Route notifications for the OneSignal channel.
*
* @ @param \IlluminateNotifications $notification
* @return string
*/
public function routeNotificationForOneSignal($notification)
{
return ['include_external_user_ids' => $this->id];
}
The id of my database in the users
table cannot be null. Therefore I deduce that if this array is being filled with the id of the user.
This is what the payload looks like just before it is sent by the Berkayk\OneSignal package
I am using
"laravel-notification-channels/onesignal": "^2.1",
"laravel/framework": "^7.0",
This error has more than 5k occurrences in the last two days.
You can see a full report here.
Any suggestions on how to fix?
AlexR1712
Metadata
Metadata
Assignees
Labels
No labels