laravel-notification-channels / onesignal

OneSignal notifications channel for Laravel
MIT License
283 stars 119 forks source link

Issue while sending Same Push Notification to Multiple User : 400 Bad Request (Platforms You may only send to one delivery channel at a time. Make sure you are only including push platfor (truncated...)) #89

Closed dishantmehta-easternts closed 5 years ago

dishantmehta-easternts commented 5 years ago

In order to send same push notification to multiple users (for eg. all user following another user in a social networking app) while Referring to the documentation (http://laravel-notification-channels.com/onesignal/), it is mentioned to pass an array with multiple player ID from One Signal.

public function routeNotificationForOneSignal()
{
    return ["ONE_SIGNAL_PLAYER_ID_1","ONE_SIGNAL_PLAYER_ID_2","ONE_SIGNAL_PLAYER_ID_3"];
}

While we try to send push notification for above setup, it throws an error whose stack trace is as below.

{
    "message": "Client error: `POST https://onesignal.com/api/v1/notifications` resulted in a `400 Bad Request` response:\n{\"errors\":[\"Platforms You may only send to one delivery channel at a time. Make sure you are only including push platfor (truncated...)\n",
    "exception": "GuzzleHttp\\Exception\\ClientException",
    "file": "D:\\repo\\socialnetworkingapp\\vendor\\guzzlehttp\\guzzle\\src\\Exception\\RequestException.php",
    "line": 113,
    "trace": [
        {
            "file": "D:\\repo\\socialnetworkingapp\\vendor\\guzzlehttp\\guzzle\\src\\Middleware.php",
            "line": 66,
            "function": "create",
            "class": "GuzzleHttp\\Exception\\RequestException",
            "type": "::"
        },
        {
            "file": "D:\\repo\\socialnetworkingapp\\vendor\\guzzlehttp\\promises\\src\\Promise.php",
            "line": 203,
            "function": "GuzzleHttp\\{closure}",
            "class": "GuzzleHttp\\Middleware",
            "type": "::"
        },
        {
            "file": "D:\\repo\\socialnetworkingapp\\vendor\\guzzlehttp\\promises\\src\\Promise.php",
            "line": 156,
            "function": "callHandler",
            "class": "GuzzleHttp\\Promise\\Promise",
            "type": "::"
        },
        {
            "file": "D:\\repo\\socialnetworkingapp\\vendor\\guzzlehttp\\promises\\src\\TaskQueue.php",
            "line": 47,
            "function": "GuzzleHttp\\Promise\\{closure}",
            "class": "GuzzleHttp\\Promise\\Promise",
            "type": "::"
        },
        {
            "file": "D:\\repo\\socialnetworkingapp\\vendor\\guzzlehttp\\promises\\src\\Promise.php",
            "line": 246,
            "function": "run",
            "class": "GuzzleHttp\\Promise\\TaskQueue",
            "type": "->"
        },
        {
            "file": "D:\\repo\\socialnetworkingapp\\vendor\\guzzlehttp\\promises\\src\\Promise.php",
            "line": 223,
            "function": "invokeWaitFn",
            "class": "GuzzleHttp\\Promise\\Promise",
            "type": "->"
        },
        {
            "file": "D:\\repo\\socialnetworkingapp\\vendor\\guzzlehttp\\promises\\src\\Promise.php",
            "line": 267,
            "function": "waitIfPending",
            "class": "GuzzleHttp\\Promise\\Promise",
            "type": "->"
        },
        {
            "file": "D:\\repo\\socialnetworkingapp\\vendor\\guzzlehttp\\promises\\src\\Promise.php",
            "line": 225,
            "function": "invokeWaitList",
            "class": "GuzzleHttp\\Promise\\Promise",
            "type": "->"
        },
        {
            "file": "D:\\repo\\socialnetworkingapp\\vendor\\guzzlehttp\\promises\\src\\Promise.php",
            "line": 62,
            "function": "waitIfPending",
            "class": "GuzzleHttp\\Promise\\Promise",
            "type": "->"
        },
        {
            "file": "D:\\repo\\socialnetworkingapp\\vendor\\guzzlehttp\\guzzle\\src\\Client.php",
            "line": 131,
            "function": "wait",
            "class": "GuzzleHttp\\Promise\\Promise",
            "type": "->"
        },
        {
            "file": "D:\\repo\\socialnetworkingapp\\vendor\\guzzlehttp\\guzzle\\src\\Client.php",
            "line": 89,
            "function": "request",
            "class": "GuzzleHttp\\Client",
            "type": "->"
        },
        {
            "file": "D:\\repo\\socialnetworkingapp\\vendor\\berkayk\\onesignal-laravel\\src\\OneSignalClient.php",
            "line": 292,
            "function": "__call",
            "class": "GuzzleHttp\\Client",
            "type": "->"
        },
        {
            "file": "D:\\repo\\socialnetworkingapp\\vendor\\berkayk\\onesignal-laravel\\src\\OneSignalClient.php",
            "line": 240,
            "function": "post",
            "class": "Berkayk\\OneSignal\\OneSignalClient",
            "type": "->"
        },
        {
            "file": "D:\\repo\\socialnetworkingapp\\vendor\\laravel-notification-channels\\onesignal\\src\\OneSignalChannel.php",
            "line": 37,
            "function": "sendNotificationCustom",
            "class": "Berkayk\\OneSignal\\OneSignalClient",
            "type": "->"
        },
        {
            "file": "D:\\repo\\socialnetworkingapp\\vendor\\laravel\\framework\\src\\Illuminate\\Notifications\\NotificationSender.php",
            "line": 144,
            "function": "send",
            "class": "NotificationChannels\\OneSignal\\OneSignalChannel",
            "type": "->"
        },
        {
            "file": "D:\\repo\\socialnetworkingapp\\vendor\\laravel\\framework\\src\\Illuminate\\Notifications\\NotificationSender.php",
            "line": 103,
            "function": "sendToNotifiable",
            "class": "Illuminate\\Notifications\\NotificationSender",
            "type": "->"
        },
        {
            "file": "D:\\repo\\socialnetworkingapp\\vendor\\laravel\\framework\\src\\Illuminate\\Support\\Traits\\Localizable.php",
            "line": 19,
            "function": "Illuminate\\Notifications\\{closure}",
            "class": "Illuminate\\Notifications\\NotificationSender",
            "type": "->"
        },
        {
            "file": "D:\\repo\\socialnetworkingapp\\vendor\\laravel\\framework\\src\\Illuminate\\Notifications\\NotificationSender.php",
            "line": 105,
            "function": "withLocale",
            "class": "Illuminate\\Notifications\\NotificationSender",
            "type": "->"
        },
        {
            "file": "D:\\repo\\socialnetworkingapp\\vendor\\laravel\\framework\\src\\Illuminate\\Notifications\\ChannelManager.php",
            "line": 54,
            "function": "sendNow",
            "class": "Illuminate\\Notifications\\NotificationSender",
            "type": "->"
        },
        {
            "file": "D:\\repo\\socialnetworkingapp\\vendor\\laravel\\framework\\src\\Illuminate\\Notifications\\SendQueuedNotifications.php",
            "line": 73,
            "function": "sendNow",
            "class": "Illuminate\\Notifications\\ChannelManager",
            "type": "->"
        },
        {
            "function": "handle",
            "class": "Illuminate\\Notifications\\SendQueuedNotifications",
            "type": "->"
        },
        {
            "file": "D:\\repo\\socialnetworkingapp\\vendor\\laravel\\framework\\src\\Illuminate\\Container\\BoundMethod.php",
            "line": 29,
            "function": "call_user_func_array"
        },
        {
            "file": "D:\\repo\\socialnetworkingapp\\vendor\\laravel\\framework\\src\\Illuminate\\Container\\BoundMethod.php",
            "line": 87,
            "function": "Illuminate\\Container\\{closure}",
            "class": "Illuminate\\Container\\BoundMethod",
            "type": "::"
        },
        {
            "file": "D:\\repo\\socialnetworkingapp\\vendor\\laravel\\framework\\src\\Illuminate\\Container\\BoundMethod.php",
            "line": 31,
            "function": "callBoundMethod",
            "class": "Illuminate\\Container\\BoundMethod",
            "type": "::"
        },
        {
            "file": "D:\\repo\\socialnetworkingapp\\vendor\\laravel\\framework\\src\\Illuminate\\Container\\Container.php",
            "line": 572,
            "function": "call",
            "class": "Illuminate\\Container\\BoundMethod",
            "type": "::"
        },
        {
            "file": "D:\\repo\\socialnetworkingapp\\vendor\\laravel\\framework\\src\\Illuminate\\Bus\\Dispatcher.php",
            "line": 94,
            "function": "call",
            "class": "Illuminate\\Container\\Container",
            "type": "->"
        },
        {
            "file": "D:\\repo\\socialnetworkingapp\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php",
            "line": 116,
            "function": "Illuminate\\Bus\\{closure}",
            "class": "Illuminate\\Bus\\Dispatcher",
            "type": "->"
        },
        {
            "file": "D:\\repo\\socialnetworkingapp\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php",
            "line": 104,
            "function": "Illuminate\\Pipeline\\{closure}",
            "class": "Illuminate\\Pipeline\\Pipeline",
            "type": "->"
        },
        {
            "file": "D:\\repo\\socialnetworkingapp\\vendor\\laravel\\framework\\src\\Illuminate\\Bus\\Dispatcher.php",
            "line": 98,
            "function": "then",
            "class": "Illuminate\\Pipeline\\Pipeline",
            "type": "->"
        },
        {
            "file": "D:\\repo\\socialnetworkingapp\\vendor\\laravel\\framework\\src\\Illuminate\\Queue\\CallQueuedHandler.php",
            "line": 49,
            "function": "dispatchNow",
            "class": "Illuminate\\Bus\\Dispatcher",
            "type": "->"
        },
        {
            "file": "D:\\repo\\socialnetworkingapp\\vendor\\laravel\\framework\\src\\Illuminate\\Queue\\Jobs\\Job.php",
            "line": 83,
            "function": "call",
            "class": "Illuminate\\Queue\\CallQueuedHandler",
            "type": "->"
        },
        {
            "file": "D:\\repo\\socialnetworkingapp\\vendor\\laravel\\framework\\src\\Illuminate\\Queue\\SyncQueue.php",
            "line": 42,
            "function": "fire",
            "class": "Illuminate\\Queue\\Jobs\\Job",
            "type": "->"
        },
        {
            "file": "D:\\repo\\socialnetworkingapp\\vendor\\laravel\\framework\\src\\Illuminate\\Bus\\Dispatcher.php",
            "line": 184,
            "function": "push",
            "class": "Illuminate\\Queue\\SyncQueue",
            "type": "->"
        },
        {
            "file": "D:\\repo\\socialnetworkingapp\\vendor\\laravel\\framework\\src\\Illuminate\\Bus\\Dispatcher.php",
            "line": 160,
            "function": "pushCommandToQueue",
            "class": "Illuminate\\Bus\\Dispatcher",
            "type": "->"
        },
        {
            "file": "D:\\repo\\socialnetworkingapp\\vendor\\laravel\\framework\\src\\Illuminate\\Bus\\Dispatcher.php",
            "line": 73,
            "function": "dispatchToQueue",
            "class": "Illuminate\\Bus\\Dispatcher",
            "type": "->"
        },
        {
            "file": "D:\\repo\\socialnetworkingapp\\vendor\\laravel\\framework\\src\\Illuminate\\Notifications\\NotificationSender.php",
            "line": 195,
            "function": "dispatch",
            "class": "Illuminate\\Bus\\Dispatcher",
            "type": "->"
        },
        {
            "file": "D:\\repo\\socialnetworkingapp\\vendor\\laravel\\framework\\src\\Illuminate\\Notifications\\NotificationSender.php",
            "line": 74,
            "function": "queueNotification",
            "class": "Illuminate\\Notifications\\NotificationSender",
            "type": "->"
        },
        {
            "file": "D:\\repo\\socialnetworkingapp\\vendor\\laravel\\framework\\src\\Illuminate\\Notifications\\ChannelManager.php",
            "line": 39,
            "function": "send",
            "class": "Illuminate\\Notifications\\NotificationSender",
            "type": "->"
        },
        {
            "file": "D:\\repo\\socialnetworkingapp\\vendor\\laravel\\framework\\src\\Illuminate\\Notifications\\RoutesNotifications.php",
            "line": 18,
            "function": "send",
            "class": "Illuminate\\Notifications\\ChannelManager",
            "type": "->"
        },
        {
            "file": "D:\\repo\\socialnetworkingapp\\app\\Http\\Controllers\\Api\\GameController.php",
            "line": 219,
            "function": "notify",
            "class": "App\\Notification",
            "type": "->"
        },
        {
            "file": "D:\\repo\\socialnetworkingapp\\app\\Http\\Controllers\\Api\\GameController.php",
            "line": 153,
            "function": "sendPushNotification",
            "class": "App\\Http\\Controllers\\Api\\GameController",
            "type": "->"
        },
        {
            "file": "D:\\repo\\socialnetworkingapp\\app\\Http\\Controllers\\Api\\GameController.php",
            "line": 38,
            "function": "savePushNotification",
            "class": "App\\Http\\Controllers\\Api\\GameController",
            "type": "->"
        },
        {
            "function": "createGame",
            "class": "App\\Http\\Controllers\\Api\\GameController",
            "type": "->"
        },
        {
            "file": "D:\\repo\\socialnetworkingapp\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Controller.php",
            "line": 54,
            "function": "call_user_func_array"
        },
        {
            "file": "D:\\repo\\socialnetworkingapp\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\ControllerDispatcher.php",
            "line": 45,
            "function": "callAction",
            "class": "Illuminate\\Routing\\Controller",
            "type": "->"
        },
        {
            "file": "D:\\repo\\socialnetworkingapp\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Route.php",
            "line": 219,
            "function": "dispatch",
            "class": "Illuminate\\Routing\\ControllerDispatcher",
            "type": "->"
        },
        {
            "file": "D:\\repo\\socialnetworkingapp\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Route.php",
            "line": 176,
            "function": "runController",
            "class": "Illuminate\\Routing\\Route",
            "type": "->"
        },
        {
            "file": "D:\\repo\\socialnetworkingapp\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Router.php",
            "line": 682,
            "function": "run",
            "class": "Illuminate\\Routing\\Route",
            "type": "->"
        },
        {
            "file": "D:\\repo\\socialnetworkingapp\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Pipeline.php",
            "line": 30,
            "function": "Illuminate\\Routing\\{closure}",
            "class": "Illuminate\\Routing\\Router",
            "type": "->"
        },
        {
            "file": "D:\\repo\\socialnetworkingapp\\app\\Http\\Middleware\\JwtMiddleware.php",
            "line": 33,
            "function": "Illuminate\\Routing\\{closure}",
            "class": "Illuminate\\Routing\\Pipeline",
            "type": "->"
        },
        {
            "file": "D:\\repo\\socialnetworkingapp\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php",
            "line": 151,
            "function": "handle",
            "class": "App\\Http\\Middleware\\JwtMiddleware",
            "type": "->"
        },
        {
            "file": "D:\\repo\\socialnetworkingapp\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Pipeline.php",
            "line": 53,
            "function": "Illuminate\\Pipeline\\{closure}",
            "class": "Illuminate\\Pipeline\\Pipeline",
            "type": "->"
        },
        {
            "file": "D:\\repo\\socialnetworkingapp\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Middleware\\SubstituteBindings.php",
            "line": 41,
            "function": "Illuminate\\Routing\\{closure}",
            "class": "Illuminate\\Routing\\Pipeline",
            "type": "->"
        },
        {
            "file": "D:\\repo\\socialnetworkingapp\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php",
            "line": 151,
            "function": "handle",
            "class": "Illuminate\\Routing\\Middleware\\SubstituteBindings",
            "type": "->"
        },
        {
            "file": "D:\\repo\\socialnetworkingapp\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Pipeline.php",
            "line": 53,
            "function": "Illuminate\\Pipeline\\{closure}",
            "class": "Illuminate\\Pipeline\\Pipeline",
            "type": "->"
        },
        {
            "file": "D:\\repo\\socialnetworkingapp\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Middleware\\ThrottleRequests.php",
            "line": 58,
            "function": "Illuminate\\Routing\\{closure}",
            "class": "Illuminate\\Routing\\Pipeline",
            "type": "->"
        },
        {
            "file": "D:\\repo\\socialnetworkingapp\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php",
            "line": 151,
            "function": "handle",
            "class": "Illuminate\\Routing\\Middleware\\ThrottleRequests",
            "type": "->"
        },
        {
            "file": "D:\\repo\\socialnetworkingapp\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Pipeline.php",
            "line": 53,
            "function": "Illuminate\\Pipeline\\{closure}",
            "class": "Illuminate\\Pipeline\\Pipeline",
            "type": "->"
        },
        {
            "file": "D:\\repo\\socialnetworkingapp\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php",
            "line": 104,
            "function": "Illuminate\\Routing\\{closure}",
            "class": "Illuminate\\Routing\\Pipeline",
            "type": "->"
        },
        {
            "file": "D:\\repo\\socialnetworkingapp\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Router.php",
            "line": 684,
            "function": "then",
            "class": "Illuminate\\Pipeline\\Pipeline",
            "type": "->"
        },
        {
            "file": "D:\\repo\\socialnetworkingapp\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Router.php",
            "line": 659,
            "function": "runRouteWithinStack",
            "class": "Illuminate\\Routing\\Router",
            "type": "->"
        },
        {
            "file": "D:\\repo\\socialnetworkingapp\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Router.php",
            "line": 625,
            "function": "runRoute",
            "class": "Illuminate\\Routing\\Router",
            "type": "->"
        },
        {
            "file": "D:\\repo\\socialnetworkingapp\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Router.php",
            "line": 614,
            "function": "dispatchToRoute",
            "class": "Illuminate\\Routing\\Router",
            "type": "->"
        },
        {
            "file": "D:\\repo\\socialnetworkingapp\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Http\\Kernel.php",
            "line": 176,
            "function": "dispatch",
            "class": "Illuminate\\Routing\\Router",
            "type": "->"
        },
        {
            "file": "D:\\repo\\socialnetworkingapp\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Pipeline.php",
            "line": 30,
            "function": "Illuminate\\Foundation\\Http\\{closure}",
            "class": "Illuminate\\Foundation\\Http\\Kernel",
            "type": "->"
        },
        {
            "file": "D:\\repo\\socialnetworkingapp\\nova\\src\\Http\\Middleware\\ServeNova.php",
            "line": 26,
            "function": "Illuminate\\Routing\\{closure}",
            "class": "Illuminate\\Routing\\Pipeline",
            "type": "->"
        },
        {
            "file": "D:\\repo\\socialnetworkingapp\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php",
            "line": 151,
            "function": "handle",
            "class": "Laravel\\Nova\\Http\\Middleware\\ServeNova",
            "type": "->"
        },
        {
            "file": "D:\\repo\\socialnetworkingapp\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Pipeline.php",
            "line": 53,
            "function": "Illuminate\\Pipeline\\{closure}",
            "class": "Illuminate\\Pipeline\\Pipeline",
            "type": "->"
        },
        {
            "file": "D:\\repo\\socialnetworkingapp\\vendor\\fideloper\\proxy\\src\\TrustProxies.php",
            "line": 57,
            "function": "Illuminate\\Routing\\{closure}",
            "class": "Illuminate\\Routing\\Pipeline",
            "type": "->"
        },
        {
            "file": "D:\\repo\\socialnetworkingapp\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php",
            "line": 151,
            "function": "handle",
            "class": "Fideloper\\Proxy\\TrustProxies",
            "type": "->"
        },
        {
            "file": "D:\\repo\\socialnetworkingapp\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Pipeline.php",
            "line": 53,
            "function": "Illuminate\\Pipeline\\{closure}",
            "class": "Illuminate\\Pipeline\\Pipeline",
            "type": "->"
        },
        {
            "file": "D:\\repo\\socialnetworkingapp\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest.php",
            "line": 31,
            "function": "Illuminate\\Routing\\{closure}",
            "class": "Illuminate\\Routing\\Pipeline",
            "type": "->"
        },
        {
            "file": "D:\\repo\\socialnetworkingapp\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php",
            "line": 151,
            "function": "handle",
            "class": "Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest",
            "type": "->"
        },
        {
            "file": "D:\\repo\\socialnetworkingapp\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Pipeline.php",
            "line": 53,
            "function": "Illuminate\\Pipeline\\{closure}",
            "class": "Illuminate\\Pipeline\\Pipeline",
            "type": "->"
        },
        {
            "file": "D:\\repo\\socialnetworkingapp\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest.php",
            "line": 31,
            "function": "Illuminate\\Routing\\{closure}",
            "class": "Illuminate\\Routing\\Pipeline",
            "type": "->"
        },
        {
            "file": "D:\\repo\\socialnetworkingapp\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php",
            "line": 151,
            "function": "handle",
            "class": "Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest",
            "type": "->"
        },
        {
            "file": "D:\\repo\\socialnetworkingapp\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Pipeline.php",
            "line": 53,
            "function": "Illuminate\\Pipeline\\{closure}",
            "class": "Illuminate\\Pipeline\\Pipeline",
            "type": "->"
        },
        {
            "file": "D:\\repo\\socialnetworkingapp\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Http\\Middleware\\ValidatePostSize.php",
            "line": 27,
            "function": "Illuminate\\Routing\\{closure}",
            "class": "Illuminate\\Routing\\Pipeline",
            "type": "->"
        },
        {
            "file": "D:\\repo\\socialnetworkingapp\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php",
            "line": 151,
            "function": "handle",
            "class": "Illuminate\\Foundation\\Http\\Middleware\\ValidatePostSize",
            "type": "->"
        },
        {
            "file": "D:\\repo\\socialnetworkingapp\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Pipeline.php",
            "line": 53,
            "function": "Illuminate\\Pipeline\\{closure}",
            "class": "Illuminate\\Pipeline\\Pipeline",
            "type": "->"
        },
        {
            "file": "D:\\repo\\socialnetworkingapp\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Http\\Middleware\\CheckForMaintenanceMode.php",
            "line": 62,
            "function": "Illuminate\\Routing\\{closure}",
            "class": "Illuminate\\Routing\\Pipeline",
            "type": "->"
        },
        {
            "file": "D:\\repo\\socialnetworkingapp\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php",
            "line": 151,
            "function": "handle",
            "class": "Illuminate\\Foundation\\Http\\Middleware\\CheckForMaintenanceMode",
            "type": "->"
        },
        {
            "file": "D:\\repo\\socialnetworkingapp\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Pipeline.php",
            "line": 53,
            "function": "Illuminate\\Pipeline\\{closure}",
            "class": "Illuminate\\Pipeline\\Pipeline",
            "type": "->"
        },
        {
            "file": "D:\\repo\\socialnetworkingapp\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php",
            "line": 104,
            "function": "Illuminate\\Routing\\{closure}",
            "class": "Illuminate\\Routing\\Pipeline",
            "type": "->"
        },
        {
            "file": "D:\\repo\\socialnetworkingapp\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Http\\Kernel.php",
            "line": 151,
            "function": "then",
            "class": "Illuminate\\Pipeline\\Pipeline",
            "type": "->"
        },
        {
            "file": "D:\\repo\\socialnetworkingapp\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Http\\Kernel.php",
            "line": 116,
            "function": "sendRequestThroughRouter",
            "class": "Illuminate\\Foundation\\Http\\Kernel",
            "type": "->"
        },
        {
            "file": "D:\\repo\\socialnetworkingapp\\public\\index.php",
            "line": 55,
            "function": "handle",
            "class": "Illuminate\\Foundation\\Http\\Kernel",
            "type": "->"
        },
        {
            "file": "D:\\repo\\socialnetworkingapp\\server.php",
            "line": 21,
            "function": "require_once"
        }
    ]
}
LKaemmerling commented 5 years ago

Close because of lack of activity. If you should encounter this issue again, just open a new issue.

Jahyrm commented 2 years ago

As the error says: "You may only send to one delivery channel at a time." and according to OneSignal Documentation here: https://documentation.onesignal.com/reference/create-notification#platform-to-deliver-to

When you use the "_include_external_userids" or "_include_playerids" to Send to Specific Devices, you can use the parameter "_channel_for_external_userids" to specify the channel which can be "push", "email" or "sms". Then in your code:

OneSignalMessage::create()
    ...
    ->setParameter('channel_for_external_user_ids', 'push')
    ...;