We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hellow, first, thanks for share your work with us.
I dont have any response when i send notifications to an iPhone device. With php Curl the notifications works fine, but when i use FCM dosent send.
This is my code:
$fcm_token = User::select('fcm_token')->where('id',$request->partner_id)->first()->toArray(); $respuesta = fcm() ->to($fcm_token) // $recipients must an array ->priority('normal') ->timeToLive(0) ->data([ 'sender_id' => intval($request->user_id), 'sender_name' => $user->name, 'type' => 'partner', 'date' => $request->date, 'shift' => $user->shift_id ]) ->notification([ 'title' => 'Test FCM', 'body' => 'This is a test of FCM', ]) ->send(); ->send();
And the return of json_encode($respuesta) is {}
Thanks again!!
The text was updated successfully, but these errors were encountered:
$fcm_token = User::select('fcm_token') ->where('id', $request->partner_id) ->first() ->fcm_token; $respuesta = fcm() ->to([$fcm_token]) // ...
Sorry, something went wrong.
Thanks for answer so fast!!!
still return {} with the changes that you propose....
@olkotz
have you added .env FCM_SERVER_KEY=yourkeyhere
FCM_SERVER_KEY=yourkeyhere
then execute php artisan config:cache
php artisan config:cache
?
Hi, @olkotz .. maybe you can try to enable debug response. then check the firebase log in the laravel.log file.
laravel.log
fcm() ->to($recipients) // ... ->enableResponseLog() ->send();
if you like, please share the response log here so we can see the problem
No branches or pull requests
Hellow, first, thanks for share your work with us.
I dont have any response when i send notifications to an iPhone device. With php Curl the notifications works fine, but when i use FCM dosent send.
This is my code:
$fcm_token = User::select('fcm_token')->where('id',$request->partner_id)->first()->toArray();
$respuesta = fcm()
->to($fcm_token) // $recipients must an array
->priority('normal')
->timeToLive(0)
->data([
'sender_id' => intval($request->user_id),
'sender_name' => $user->name,
'type' => 'partner',
'date' => $request->date,
'shift' => $user->shift_id
])
->notification([
'title' => 'Test FCM',
'body' => 'This is a test of FCM',
])
->send();
->send();
And the return of json_encode($respuesta) is {}
Thanks again!!
The text was updated successfully, but these errors were encountered: