kreait / laravel-firebase

A Laravel package for the Firebase PHP Admin SDK
https://github.com/kreait/firebase-php
MIT License
992 stars 163 forks source link

Web push with link option doesn't work #123

Closed Stajor closed 1 year ago

Stajor commented 2 years ago

Code from the documentations

        $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://my-server/some-page',
            ],
        ]);

Throws exception

In InvalidMessage.php line 22:
Invalid JSON payload received. Unknown name "link" at 'message.fcm_options': Cannot find field.  
jeromegamez commented 2 years ago

Please provide a reproducible code snippet and/or the full message that you've sent to the Firebase Servers. Also, please share which version of the SDK you're using.

According to https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages#WebpushConfig the code looks correct so far.

github-actions[bot] commented 1 year ago

There hasn't been any activity on this issue recently, and in order to prioritize active issues, it will be marked as stale. Please make sure to update to the latest version and check if that solves the issue. Let me know if that works for you by leaving a 👍. Because this issue is marked as stale, it will be closed and locked in 7 days if no further activity occurs. Thank you for your contributions!