Extra data pass in Push notification in Laravel
By looking in the code , send method has an option argument:
function send($message, $options = array()) {
$push = new Push($this->adapter, $this->addressee, ($message instanceof Message) ? $message : new Message($message, $options));
....
}
So you can send an array of option like described with Message object:
$message = PushNotification::Message('Message Text',array(
'badge' => 1,
'sound' => 'example.aiff',
'actionLocKey' => 'Action button title!',
'locKey' => 'localized key',
'locArgs' => array(
'localized args',
'localized args',
),
'launchImage' => 'image.jpg',
'custom' => array('custom data' => array(
'we' => 'want', 'send to app'
))
));
So you can just use:
\PushNotification::app('AndroidUser')
->to($user->device_token)
->send($push_message, array(
'custom' => array(
'custom_data1' => VALUE,
'custom_data2' => VALUE
)
));