benwilkins / laravel-fcm-notification

Laravel FCM (Firebase Cloud Messaging) Notification Channel
MIT License
213 stars 91 forks source link

Help .. nothing receive. #20

Closed tangjh closed 6 years ago

tangjh commented 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\"}"

tangjh commented 6 years ago

ok ... my issue. should use channel manager.

abhiburk commented 4 years ago

can you post your code for reference?