laravel-notification-channels / fcm

Firebase Cloud Messaging (FCM) notifications channel for Laravel
https://laravel-notification-channels.com/
MIT License
472 stars 121 forks source link

Unable to create the messaging service without a project ID #184

Closed jaimincygnet closed 6 months ago

jaimincygnet commented 6 months ago

We are using this package "laravel-notification-channels/fcm": "2.7.0" for Laravel 8 and PHP 7.2.

"php": "^7.2|^8.0", "fruitcake/laravel-cors": "^2.0", "guzzlehttp/guzzle": "^7.0.1", "laravel-notification-channels/fcm": "2.7.0", "laravel/framework": "^8.75",

In this package we are facing this issue " Unable to create the messaging service without a project ID "

It's working in package 1.6 but now it's not working.

dwightwatson commented 6 months ago

1.6 sounds very old. We're up to version 4 now. Please review the docs and make sure you've configured everything correctly

jaimincygnet commented 5 months ago

Now we are upgrading version

"laravel-notification-channels/fcm": "4.1.0", "laravel/framework": "^10.10",

Still facing same error.

Unable to determine the Firebase Project ID

`$fcmNotification = FcmNotification::create() ->setTitle($this->notification->title) ->setBody($this->notification->message);

        $sendData = [
            'action'          => 'deep-link',
            'key'             => $this->key,
            'notification_id' => $this->notification->getKey(),
        ];

        if (!empty($this->notification->deep_link_uri)) {
            $sendData['redirect_url'] = $this->notification->deep_link_uri;
        }

        // The FcmMessage contains other options for the notification
        return FcmMessage::create()
            ->setPriority(FcmMessage::PRIORITY_HIGH)
            ->setTimeToLive(86400)
            ->setNotification($fcmNotification)
            ->setData((object) $sendData);`