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.
      '),
    ];  
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

jeremyvdm created an issue. See original summary.

jeremyvdm’s picture

Priority: Critical » Major
avpaderno’s picture

Version: 1.0.3 » 1.0.x-dev
Assigned: jeremyvdm » Unassigned
pirtpal_singh’s picture

Thank you for reporting this.

This issue has already been reported and discussed in the following thread:

https://www.drupal.org/project/firebase_ui/issues/3520771#comment-16085835

I'm closing this issue as a duplicate to keep the conversation centralized. Please follow the original thread for updates and resolution progress.

Thanks again for your contribution and support in improving the module!

pirtpal_singh’s picture

Status: Active » Closed (duplicate)