kawankoding / laravel-fcm

Firebase Cloud Messaging (FCM) sender for Laravel
172 stars 56 forks source link

working fine on local but not on production #55

Closed ghost closed 3 years ago

ghost commented 3 years ago

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();   
erlangparasu commented 3 years ago

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

ghost commented 3 years ago

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

ghost commented 3 years ago

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

ghost commented 3 years ago

Resolved