Firebase Admin SDK (JSON) upload

Created on 23 April 2025, 25 days ago
Updated 24 April 2025, 24 days ago

Problem/Motivation

I can not load the json file needed for the configuration form of the Firebase Admin SDK (JSON).

Steps to reproduce

go to the firebase_ui config form /admin/config/services/firebase-ui and try to upload the Firebase Admin SDK (JSON).

Proposed resolution

in the config form I think you need to replace :

 $form['service_account_file'] = [
      '#type' => 'managed_file',
      '#title' => $this->t('Firebase Admin SDK (JSON)'),
      '#upload_location' => 'private://firebase',
      '#default_value' => $config->get('service_account_file') ? [$config->get('service_account_file')] : NULL,
      '#upload_validators' => [
        'file_validate_extensions' => ['json'],
      ],
      '#description' => $this->t('
        Upload your Firebase Admin SDK JSON file, required for sending push notifications using Firebase Cloud Messaging. <br>
        You can generate this file from the <a href="https://medium.com/@naveennirbanyadav08/setup-gcp-service-account-for-fcm-9ec15e89fb74" target="_blank">Service Accounts</a> section in your Firebase Console. <br>
        The uploaded file will be stored securely in the private file system.
      '),
    ];

by :

 $form['service_account_file'] = [
      '#type' => 'managed_file',
      '#title' => $this->t('Firebase Admin SDK (JSON)'),
      '#upload_location' => 'private://firebase',
      '#default_value' => $config->get('service_account_file') ? [$config->get('service_account_file')] : NULL,
      '#upload_validators' => ['FileExtension' => ['json']],
      '#description' => $this->t('
        Upload your Firebase Admin SDK JSON file, required for sending push notifications using Firebase Cloud Messaging. <br>
        You can generate this file from the <a href="https://medium.com/@naveennirbanyadav08/setup-gcp-service-account-for-fcm-9ec15e89fb74" target="_blank">Service Accounts</a> section in your Firebase Console. <br>
        The uploaded file will be stored securely in the private file system.
      '),
    ];  
🐛 Bug report
Status

Active

Version

1.0

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024