binwiederhier / ntfy

Send push notifications to your phone or desktop using PUT/POST
https://ntfy.sh
Apache License 2.0
17.76k stars 690 forks source link

Project ID error. The sisstem not recognize my firebase-key-file #1065

Closed redenfire closed 5 months ago

redenfire commented 5 months ago

Hi everyone. I'm on a linux Linux Mint 21.1 x86_64, with Docker version 26.0.0, build 2ae903e. I've installed a self-hosted version on ntfy with auth enabled.

I have a problem with my firebase-key-file. I've generated it with FCM, I download the file and I've mount the /etc/ntfy folder with docker. The folder is correctly mount.

I tried to use the ENV var NTFY_FIREBASE_KEY_FILE or a server.yml for use my FCM json but the logs output is always this:

project ID is required to access Firebase Cloud Messaging client

This is the content of my file, named vvfy-XXXX.json, where XXX is the rest of project id inside the file:

{
  "project_info": {
    "project_number": "AAAAAAA",
    "project_id": "vvfy-XXXX",
    "storage_bucket": "vvfy-XXXX.appspot.com"
  },
  "client": [
    {
      "client_info": {
        "mobilesdk_app_id": "APP_ID_VALUE",
        "android_client_info": {
          "package_name": "com.vvfy"
        }
      },
      "oauth_client": [],
      "api_key": [
        {
          "current_key": ""
        }
      ],
      "services": {
        "appinvite_service": {
          "other_platform_oauth_client": []
        }
      }
    }
  ],
  "configuration_version": "1"
}

Can anyone help my?

redenfire commented 5 months ago

Resolved! The file was wrong.

Under Firebase site, I created a new private key into Project settings > Service accounts

The downloaded file need to be linked into container under NTFY_FIREBASE_KEY_FILE env, or in server.yml

After this i downloaded again the google-service.json. This file is necessary for build the apk.

I think this can be useful from someone else, because I didnt undestend the ntfy guide for FCM.

wunter8 commented 5 months ago

Thank you for sharing how you got it working!