laravel-notification-channels/fcm

Unable to determine the Firebase Project ID

jaimincygnet opened this issue · 2 comments

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);`

Have you set the FIREBASE_CREDENTIALS environment variable that includes project_id?

I got the same error. Can you please help me out @dwightwatson.

I've try with 2 different key set in .env like

FCM_SERVER_KEY="my server key"

and

FCM_CREDENTIALS=file://storage/app/firebase/service-account.json