Estou usando a biblioteca https://github.com/Alymosul/laravel-exponent-push-notifications, fiz como no exemplo, porém minha notificação não aparece.
private $reserve;
/**
* Create a new notification instance.
*
* @return void
*/
public function __construct(Reserve $reserve)
{
$this->reserve = $reserve;
}
/**
* Get the notification's delivery channels.
*
* @param mixed $notifiable
* @return array
*/
public function via($notifiable)
{
// return ['mail'];
return [ExpoChannel::class];
}
/**
* Get the mail representation of the notification.
*
* @param mixed $notifiable
* @return \Illuminate\Notifications\Messages\MailMessage
*/
public function toMail($notifiable)
{
return (new MailMessage)
->line('The introduction to the notification.')
->action('Notification Action', url('/'))
->line('Thank you for using our application!');
}
/**
* Get the array representation of the notification.
*
* @param mixed $notifiable
* @return array
*/
public function toArray($notifiable)
{
return [
//
];
}
public function toExpoPush($notifiable)
{
return ExpoMessage::create()
->badge(1)
->enableSound()
->title("Congratulations!")
->body("Your account was approved!")
//->setChannelId("reserve-alert");
}
}
Minha classe controller está assim:
public function store(Request $request)
{
$data = $request->all();
$reserve = Reserve::find(21);
$create = true;//$this->reserve->create($data);
//broadcast(new EventResponseReserve)->toOthers();
if($create){
$reserve->notify(new NewReserve($reserve));
broadcast(new EventResponseReserve)->toOthers();
return redirect()->route('reserve.index')->with(['success'=>"Cadastrado realizado com sucesso!"]);
}else
return redirect()->route('reserve.index')->with(['success'=>"Cadastrado realizado com sucesso!"]);
}
Estou realizando testes pela ferramenta expo tools e já funciona, mas pelo Laravel não.