Closed tangjh closed 6 years ago
Any idea what went wrong? I use the following code to send notification but didn't receive notification. No exception found in log also.
$notify = new EventNotification($title, $message); $notifiable = new EventNotifiable(); $fcm = $notify->toFcm($notifiable); $fcm->to('my_device_id');
However when I send with curl ... I receive the notification:
curl -X POST --header "Authorization: key=my_fcm_key" --Header "Content-Type: application/json" https://fcm.googleapis.com/fcm/send -d "{\"notification\":{\"title\": \"title\", \"text\": \"nessage\", \"badge\": \"1\", \"sound\": \"default\"}, \"data\":{\"foo\":\"bar\"}, \"priority\": \"High\", \"to\": \"my_device_id\"}"
ok ... my issue. should use channel manager.
can you post your code for reference?
Any idea what went wrong? I use the following code to send notification but didn't receive notification. No exception found in log also.
However when I send with curl ... I receive the notification:
curl -X POST --header "Authorization: key=my_fcm_key" --Header "Content-Type: application/json" https://fcm.googleapis.com/fcm/send -d "{\"notification\":{\"title\": \"title\", \"text\": \"nessage\", \"badge\": \"1\", \"sound\": \"default\"}, \"data\":{\"foo\":\"bar\"}, \"priority\": \"High\", \"to\": \"my_device_id\"}"