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.
'),
];