Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

Laravel-FCM.INFO: notification send to 3 devices success: 0 failures: 3 number of modified token : 0 #23

Closed
umairali opened this issue Dec 26, 2016 · 8 comments

Comments

@umairali
Copy link

umairali commented Dec 26, 2016

I m trying to send notifications but I am receiving this error.

Laravel-FCM.INFO: notification send to 3 devices success: 0 failures: 3 number of modified token : 0

I am using (Sending a Downstream Message to Multiple Devices) code

@brozot
Copy link
Owner

brozot commented Dec 27, 2016

Hello,

Are you sure that you have correctly registered tokens provided by your client app ?
Have you tried to sent a notification with your token from the FCM console

@umairali
Copy link
Author

Yes, I tried but I don't know why some tokens are not working and I received this message.

@rslhdyt
Copy link

rslhdyt commented Mar 4, 2017

Same Issue here,

when I debug downstreamResponse I found this.
tokensWithError: array:1 [▼"<TOKEN>" => "InvalidParameters"

but when I try in postman with same parameters, it works

firebase

@rslhdyt
Copy link

rslhdyt commented Mar 4, 2017

It work's.

the problem is Firebase client for web (javascript), cannot receive notification with message payload
badge and sound. according to https://firebase.google.com/docs/cloud-messaging/http-server-ref.

working sample for notification to web.

$notificationBuilder = new PayloadNotificationBuilder();
$notificationBuilder->setTitle('title')
    ->setBody('body')
    ->setClickAction('http://localhost:8081');
$notification = $notificationBuilder->build();

Thank You @brozot for a Great Package

@shinnlu
Copy link

shinnlu commented Mar 7, 2017

i have the same problem with same code (Sending a Downstream Message to Multiple Devices)
Laravel-FCM.INFO: notification send to 1 devices success: 0 failures: 1 number of modified token : 0
my client is android app, please help me to resolve this problem.

i can't see new message in firebase console.

@shinnlu
Copy link

shinnlu commented Mar 7, 2017

i found the problem
when i get tokens from database with code:

$tokens = Subscribe::select('device_token') ->whereIn('UserID', $users) ->where('type','=','Alert') ->get();

it's return two dimension array like this:
Array ( [0] => Array ( [device_token] => TOKEN1 ) [1] => Array ( [device_token] => TOKEN2 ) )
it's wrong, the tokens array should be one dimension array like this:
Array ( [0] => TOKEN1 [1] => TOKEN2 )

@brozot
Copy link
Owner

brozot commented Mar 10, 2017

@shinnlu Is it solve for you ? can I close the issue ?

@shinnlu
Copy link

shinnlu commented Mar 11, 2017

sure, thanks.

@brozot brozot closed this as completed Mar 11, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants