Closed dong-vh closed 2 years ago
Hi, and thanks for raising this issue - unfortunatelym there is not much I can check for you. Your message composition looks good, and Firebase accepts the message, but how this is handled in the browser/web app is out of the SDK's control here.
As reference (but you certainly have looked this up already)
In the second link, I find this passage interesting:
If the link value points to a page that is already open in a browser tab, a click on the notification brings that tab into the foreground. If the page is not already open, a notification click opens the page in a new tab.
Because data messages don't support fcm_options.link, you are recommended to add a notification payload to all data messages. Alternatively, you can handle notifications using the service worker.
To debug this further, you could enable HTTP debug logging (https://github.com/kreait/laravel-firebase/blob/main/config/firebase.php#L151) and check if the sent JSON message contains everything it should.
If nothing helps (checking the sent messages, checking the handling in the receiving browser/operating system), I believe it would be best to ask in the community for the client-side library you're using, or open a support ticket with Firebase directly at https://firebase.google.com/support
🤞
My function here public function pushNotificationWithLink(Request $request) { try { $config = WebPushConfig::fromArray([ 'notification' => [ 'title' => '$GOOG up 1.43% on the day', 'body' => '$GOOG gained 11.80 points to close at 835.67, up 1.43% on the day.', 'icon' => 'https://my-server/icon.png', ], 'fcm_options' => [ 'link' => 'https://5tmusic.vn', ], ]);
It still pushes the notification but when I click on the notification it doesn't redirect. Can you check for me. Thanks !