Git Product home page Git Product logo

Comments (8)

shinnlu avatar shinnlu commented on June 26, 2024 1

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 )

from laravel-fcm.

brozot avatar brozot commented on June 26, 2024

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

from laravel-fcm.

umairali avatar umairali commented on June 26, 2024

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

from laravel-fcm.

rslhdyt avatar rslhdyt commented on June 26, 2024

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

from laravel-fcm.

rslhdyt avatar rslhdyt commented on June 26, 2024

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

from laravel-fcm.

shinnlu avatar shinnlu commented on June 26, 2024

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.

from laravel-fcm.

brozot avatar brozot commented on June 26, 2024

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

from laravel-fcm.

shinnlu avatar shinnlu commented on June 26, 2024

sure, thanks.

from laravel-fcm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.