kawankoding/laravel-fcm

working fine on local but not on production

Opened this issue · 4 comments

laravel-FCM notification working on local but not on production. My domain is ssl enabled. is it creating issue.

i try
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);

but its still not working

here is my code...

$firebaseToken = User::where('id',$user->id)->whereNotNull('device_token')->pluck('device_token');

   $recipients =  $firebaseToken->toArray();
    fcm()
      ->to($recipients)
      ->priority('high')
      ->timeToLive(0)
      ->data([
          'title' => $title,
          'body'  => $body,
      ])
      ->send();   

hi, can you plase try to log the curl response (log before json_decode) using laravel logger() ? then post the result here.. thank you

i am getting this as response

{"multicast_id":1978522210307514444,"success":1,"failure":0,"canonical_ids":0,"results":[{"message_id":"0:1613287695171992%c72056e6c72056e6"}]}

i have notice that notification works fine from postman. but its not worked from mobile app

i tried on different devices. i got the notification on some devices. but its blank . without title and body.

Resolved